Merge branch 'master' into harmony-v3.0.21
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ describe("minify", function() {
|
||||
});
|
||||
var err = result.error;
|
||||
assert.ok(err instanceof Error);
|
||||
assert.strictEqual(err.stack.split(/\n/)[0], "Error: Can't handle expression: debugger");
|
||||
assert.strictEqual(err.stack.split(/\n/)[0], "SyntaxError: Unexpected token: keyword (debugger)");
|
||||
});
|
||||
it("should skip inherited properties", function() {
|
||||
var foo = Object.create({ skip: this });
|
||||
|
||||
Reference in New Issue
Block a user