aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-11-17 20:03:20 +0000
committerGitHub <noreply@github.com>2020-11-18 04:03:20 +0800
commitcaa92aea5d6ff4f0ac053df3163a6bc2266002ec (patch)
tree3f1cc64312599e71c23bc26218c283e51d9bb93c /test
parent383163afa67c5726e18da145d6eb012ee1b064e3 (diff)
downloadtracifyjs-caa92aea5d6ff4f0ac053df3163a6bc2266002ec.tar.gz
tracifyjs-caa92aea5d6ff4f0ac053df3163a6bc2266002ec.zip
fix corner case in `merge_vars` (#4289)
fixes #4288
Diffstat (limited to 'test')
-rw-r--r--test/compress/destructured.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/compress/destructured.js b/test/compress/destructured.js
index 6feb5bd6..7eaad226 100644
--- a/test/compress/destructured.js
+++ b/test/compress/destructured.js
@@ -1440,3 +1440,33 @@ issue_4286_2: {
expect_stdout: "PASS"
node_version: ">=6"
}
+
+issue_4288: {
+ options = {
+ merge_vars: true,
+ }
+ input: {
+ function f({
+ [new function() {
+ console.log(typeof b);
+ }()]: a,
+ }) {
+ var b = a;
+ b++;
+ }
+ f(0);
+ }
+ expect: {
+ function f({
+ [new function() {
+ console.log(typeof b);
+ }()]: a,
+ }) {
+ var b = a;
+ b++;
+ }
+ f(0);
+ }
+ expect_stdout: "undefined"
+ node_version: ">=6"
+}