aboutsummaryrefslogtreecommitdiff
path: root/test/mocha
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-01-03 02:34:46 +0000
committerGitHub <noreply@github.com>2021-01-03 10:34:46 +0800
commite8c04f8cb691ee132c7d3b0b10db0d7da8ce3bf6 (patch)
treea63d1918822a0d876351d55df5a1f26f16f260b9 /test/mocha
parent110c1ac0978dbfbcd16150abadaa9f049bafa04c (diff)
downloadtracifyjs-e8c04f8cb691ee132c7d3b0b10db0d7da8ce3bf6.tar.gz
tracifyjs-e8c04f8cb691ee132c7d3b0b10db0d7da8ce3bf6.zip
suppress invalid AST transform in `--reduce-test` (#4498)
Diffstat (limited to 'test/mocha')
-rw-r--r--test/mocha/reduce.js12
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"), {