fix cascade on delete operator (#1687)

Conditions including strict mode would make `delete` return `true` or `false`, and are too complex to be evaluated by the compressor.

Suppress assignment folding into said operator.

fixes #1685
This commit is contained in:
Alex Lam S.L
2017-03-26 18:08:44 +08:00
committed by GitHub
parent 3276740779
commit e76fb354eb
2 changed files with 28 additions and 2 deletions

View File

@@ -306,3 +306,27 @@ unsafe_undefined: {
}
}
}
issue_1685: {
options = {
cascade: true,
side_effects: true,
}
input: {
var a = 100, b = 10;
function f() {
var a = (a--, delete a && --b);
}
f();
console.log(a, b);
}
expect: {
var a = 100, b = 10;
function f() {
var a = (a--, delete a && --b);
}
f();
console.log(a, b);
}
expect_stdout: true
}