diff options
Diffstat (limited to 'test/mocha/reduce.js')
-rw-r--r-- | test/mocha/reduce.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/mocha/reduce.js b/test/mocha/reduce.js index ce931fe9..e3653314 100644 --- a/test/mocha/reduce.js +++ b/test/mocha/reduce.js @@ -307,6 +307,18 @@ describe("test/reduce.js", function() { if (result.error) throw result.error; assert.strictEqual(result.code, read("test/input/reduce/diff_error.reduced.js")); }); + it("Should maintain valid LHS in destructuring assignments", function() { + if (semver.satisfies(process.version, "<6")) return; + var result = reduce_test(read("test/input/reduce/destructured_assign.js"), { + compress: { + unsafe_math: true, + }, + mangle: false, + validate: true, + }); + if (result.error) throw result.error; + assert.strictEqual(result.code, read("test/input/reduce/destructured_assign.reduced.js")); + }); it("Should handle destructured catch expressions", function() { if (semver.satisfies(process.version, "<6")) return; var result = reduce_test(read("test/input/reduce/destructured_catch.js"), { |