improve AST_For.init & AST_Switch.expression compression (#2546)

This commit is contained in:
Alex Lam S.L
2017-12-01 12:53:59 +08:00
committed by GitHub
parent 09b320e8a5
commit f6610baaa8
4 changed files with 50 additions and 8 deletions

View File

@@ -452,3 +452,19 @@ in_parenthesis_2: {
}
expect_exact: 'for(function(){"foo"in{}};0;);'
}
init_side_effects: {
options = {
loops: true,
side_effects: true,
};
input: {
for (function() {}(), i = 0; i < 5; i++) console.log(i);
for (function() {}(); i < 10; i++) console.log(i);
}
expect: {
for (i = 0; i < 5; i++) console.log(i);
for (; i < 10; i++) console.log(i);
}
expect_stdout: true
}