From e8c04f8cb691ee132c7d3b0b10db0d7da8ce3bf6 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sun, 3 Jan 2021 02:34:46 +0000 Subject: suppress invalid AST transform in `--reduce-test` (#4498) --- test/mocha/reduce.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/mocha') 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"), { -- cgit v1.2.3