has_side_effects() should take AST_Switch.expression into account (#1699)

fixes #1698
This commit is contained in:
Alex Lam S.L
2017-03-27 18:09:35 +08:00
committed by GitHub
parent 581630e0a7
commit c526da59a1
2 changed files with 27 additions and 2 deletions

View File

@@ -593,3 +593,24 @@ if_switch_typeof: {
a;
}
}
issue_1698: {
options = {
side_effects: true,
}
input: {
var a = 1;
!function() {
switch (a++) {}
}();
console.log(a);
}
expect: {
var a = 1;
!function() {
switch (a++) {}
}();
console.log(a);
}
expect_stdout: "2"
}