aboutsummaryrefslogtreecommitdiff
path: root/test/compress/default-values.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-30 17:47:00 +0000
committerGitHub <noreply@github.com>2020-12-31 01:47:00 +0800
commit8b954b022bf206048f8380878251bd64795da5f9 (patch)
tree31d7ca925c3f47982c672cef70799e204dc60822 /test/compress/default-values.js
parent0013cbf91f5a833eb51e3473ef2f18844f722ae9 (diff)
downloadtracifyjs-8b954b022bf206048f8380878251bd64795da5f9.tar.gz
tracifyjs-8b954b022bf206048f8380878251bd64795da5f9.zip
fix corner case with default values (#4484)
fixes #4483
Diffstat (limited to 'test/compress/default-values.js')
-rw-r--r--test/compress/default-values.js21
1 files changed, 21 insertions, 0 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"
+}