diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/default-values.js | 21 | ||||
-rw-r--r-- | test/reduce.js | 1 |
2 files changed, 21 insertions, 1 deletions
diff --git a/test/compress/default-values.js b/test/compress/default-values.js index 39fcddbd..5b21ae6a 100644 --- a/test/compress/default-values.js +++ b/test/compress/default-values.js @@ -1206,3 +1206,24 @@ issue_4468: { expect_stdout: "PASS" node_version: ">=6" } + +issue_4483: { + options = { + conditionals: true, + evaluate: true, + reduce_vars: true, + toplevel: true, + } + input: { + if (console) + var [ a = "FAIL" ] = [], b = a = "PASS"; + console.log(b); + } + expect: { + var a, b; + console && ([ a = "FAIL" ] = [], b = "PASS"); + console.log(b); + } + expect_stdout: "PASS" + node_version: ">=6" +} diff --git a/test/reduce.js b/test/reduce.js index 48030b0f..120868fe 100644 --- a/test/reduce.js +++ b/test/reduce.js @@ -124,7 +124,6 @@ module.exports = function reduce_test(testcase, minify_options, reduce_options) // ignore lvalues if (parent instanceof U.AST_Assign && parent.left === node) return; - if (parent instanceof U.AST_DestructuredArray) return; if (parent instanceof U.AST_DestructuredKeyVal && parent.value === node) return; if (parent instanceof U.AST_Unary && parent.expression === node) switch (parent.operator) { case "++": |