diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-03-26 18:08:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-26 18:08:44 +0800 |
commit | e76fb354eb62d8e7b6968f1f77cfbb219814cea3 (patch) | |
tree | 8f1523df409bf635fd41ca9a4c2ecdf51e9dc327 /test/compress | |
parent | 3276740779077f2ee7b686c4aa7f1bd46fbc1c66 (diff) | |
download | tracifyjs-e76fb354eb62d8e7b6968f1f77cfbb219814cea3.tar.gz tracifyjs-e76fb354eb62d8e7b6968f1f77cfbb219814cea3.zip |
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
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/sequences.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/compress/sequences.js b/test/compress/sequences.js index 49b61ae0..af6e0c36 100644 --- a/test/compress/sequences.js +++ b/test/compress/sequences.js @@ -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 +} |