enhance inline (#3352)

This commit is contained in:
Alex Lam S.L
2019-03-21 02:58:33 +08:00
committed by GitHub
parent 65648d84a5
commit 54b0b49b68
2 changed files with 29 additions and 1 deletions

View File

@@ -2675,3 +2675,31 @@ cross_references_3: {
"9 27",
]
}
loop_inline: {
options = {
inline: true,
reduce_vars: true,
unused: true,
}
input: {
console.log(function(o) {
function g(p) {
return o[p];
}
function h(q) {
while (g(q));
}
return h;
}([ 1, "foo", 0 ])(2));
}
expect: {
console.log(function(o) {
return function(q) {
while (p = q, o[p]);
var p;
};
}([ 1, "foo", 0 ])(2));
}
expect_stdout: "undefined"
}