inline functions with directives more effectively (#3604)

This commit is contained in:
Alex Lam S.L
2019-11-26 01:51:04 +08:00
committed by GitHub
parent 48a0f6fe41
commit 6768e6578f
2 changed files with 36 additions and 2 deletions

View File

@@ -3568,3 +3568,29 @@ pr_3592_2: {
}
expect_stdout: "PASS"
}
inline_use_strict: {
options = {
evaluate: true,
inline: true,
reduce_vars: true,
sequences: true,
side_effects: true,
unused: true,
}
input: {
console.log(function() {
"use strict";
return function() {
"use strict";
var a = "foo";
a += "bar";
return a;
};
}()());
}
expect: {
console.log("foobar");
}
expect_stdout: "foobar"
}