diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-11-22 23:05:20 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-23 07:05:20 +0800 |
commit | 1e8fa1aa1db199835e328d7a042155ce859df596 (patch) | |
tree | 1299e6366d70335388244e226bd01fb3483e8201 /test | |
parent | 9f67866147a3031f80cd3d5dba17cf2cabd18c94 (diff) | |
download | tracifyjs-1e8fa1aa1db199835e328d7a042155ce859df596.tar.gz tracifyjs-1e8fa1aa1db199835e328d7a042155ce859df596.zip |
fix corner case in `passes` & `reduce_vars` (#4316)
fixes #4315
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/destructured.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/compress/destructured.js b/test/compress/destructured.js index e654847a..6eea10d2 100644 --- a/test/compress/destructured.js +++ b/test/compress/destructured.js @@ -1647,3 +1647,40 @@ issue_4312: { expect_stdout: "PASS" node_version: ">=6" } + +issue_4315: { + options = { + conditionals: true, + dead_code: true, + evaluate: true, + inline: true, + passes: 2, + reduce_funcs: true, + reduce_vars: true, + side_effects: true, + toplevel: true, + unused: true, + } + input: { + function f() { + console; + } + var a = function() { + if ([ 0[f && f] ] = []) + return this; + }(), b; + do { + console.log("PASS"); + } while (0 && (b = 0), b && a); + } + expect: { + [ 0[function() { + console + }] ] = []; + do { + console.log("PASS"); + } while (void 0); + } + expect_stdout: "PASS" + node_version: ">=6" +} |