aboutsummaryrefslogtreecommitdiff
path: root/test/input/reduce
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/input/reduce
parent110c1ac0978dbfbcd16150abadaa9f049bafa04c (diff)
downloadtracifyjs-e8c04f8cb691ee132c7d3b0b10db0d7da8ce3bf6.tar.gz
tracifyjs-e8c04f8cb691ee132c7d3b0b10db0d7da8ce3bf6.zip
suppress invalid AST transform in `--reduce-test` (#4498)
Diffstat (limited to 'test/input/reduce')
-rw-r--r--test/input/reduce/destructured_assign.js3
-rw-r--r--test/input/reduce/destructured_assign.reduced.js17
2 files changed, 20 insertions, 0 deletions
diff --git a/test/input/reduce/destructured_assign.js b/test/input/reduce/destructured_assign.js
new file mode 100644
index 00000000..26e1580b
--- /dev/null
+++ b/test/input/reduce/destructured_assign.js
@@ -0,0 +1,3 @@
+var o = {};
+[ o[1 + .1 + .1] ] = [ 42 ];
+console.log(o[1.2]);
diff --git a/test/input/reduce/destructured_assign.reduced.js b/test/input/reduce/destructured_assign.reduced.js
new file mode 100644
index 00000000..887810d4
--- /dev/null
+++ b/test/input/reduce/destructured_assign.reduced.js
@@ -0,0 +1,17 @@
+// (beautified)
+var o = {};
+
+[ o[1 + .1 + .1] ] = [];
+
+console.log(o);
+// output: { '1.2000000000000002': undefined }
+//
+// minify: { '1.2': undefined }
+//
+// options: {
+// "compress": {
+// "unsafe_math": true
+// },
+// "mangle": false,
+// "validate": true
+// } \ No newline at end of file