Merge branch 'master' into harmony-v3.0.21

This commit is contained in:
alexlamsl
2017-06-29 00:58:28 +08:00
6 changed files with 45 additions and 27 deletions

View File

@@ -265,7 +265,7 @@ issue_203: {
}
expect: {
var m = {};
var fn = Function("n", "o", "o.exports=42");
var fn = Function("n,o", "o.exports=42");
fn(null, m, m.exports);
console.log(m.exports);
}

View File

@@ -174,3 +174,24 @@ issue_1986: {
console.log(42);
}
}
issue_2167: {
options = {
conditionals: true,
dead_code: true,
evaluate: true,
global_defs: {
"@isDevMode": "function(){}",
},
side_effects: true,
}
input: {
if (isDevMode()) {
greetOverlord();
}
doWork();
}
expect: {
doWork();
}
}

View File

@@ -8,7 +8,7 @@ compress_new_function: {
new Function("aa, bb", 'return aa;');
}
expect: {
Function("n", "r", "return n");
Function("n,r", "return n");
}
}
@@ -27,9 +27,9 @@ compress_new_function_with_destruct: {
new Function("[[aa]], [{bb}]", 'return aa;');
}
expect: {
Function("n", "[r]", "return n");
Function("n", "{bb:b}", "return n");
Function("[[n]]", "[{bb:b}]", "return n");
Function("n,[r]", "return n");
Function("n,{bb:b}", "return n");
Function("[[n]],[{bb:b}]", "return n");
}
}
@@ -49,8 +49,8 @@ compress_new_function_with_destruct_arrows: {
new Function("[[aa]], [{bb}]", 'return aa;');
}
expect: {
Function("N", "[a]", 'return N');
Function("b", "{bb:N}", 'return b');
Function("[[b]]", "[{bb:N}]", 'return b');
Function("n,[a]", "return n");
Function("b,{bb:n}", "return b");
Function("[[b]],[{bb:n}]", "return b");
}
}