aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-11-28 21:38:24 +0000
committerGitHub <noreply@github.com>2020-11-29 05:38:24 +0800
commitf045e2b46077e84db8b7ae787819a010077ce1fd (patch)
tree386cf2b4c0368950e28cfa23b93fb0d7be579320 /test/compress
parent8791f258e3996adb882fc62329f970270366b216 (diff)
downloadtracifyjs-f045e2b46077e84db8b7ae787819a010077ce1fd.tar.gz
tracifyjs-f045e2b46077e84db8b7ae787819a010077ce1fd.zip
fix corner case in `merge_vars` (#4324)
fixes #4323
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/destructured.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/compress/destructured.js b/test/compress/destructured.js
index d751e253..eb6834a4 100644
--- a/test/compress/destructured.js
+++ b/test/compress/destructured.js
@@ -1741,3 +1741,39 @@ issue_4321: {
expect_stdout: "PASS"
node_version: ">=6"
}
+
+issue_4323: {
+ options = {
+ ie8: true,
+ inline: true,
+ merge_vars: true,
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = 0;
+ (function b({
+ [function a() {
+ console.log(typeof a);
+ }()]: d,
+ }) {})(0);
+ (function c(e) {
+ e.p;
+ })(1, console.log);
+ }
+ expect: {
+ var a = 0;
+ (function({
+ [function a() {
+ console.log(typeof a);
+ }()]: d,
+ }) {})(0);
+ e = 1,
+ console.log,
+ void e.p;
+ var e;
+ }
+ expect_stdout: "function"
+ node_version: ">=6"
+}