aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-10-12 16:10:32 +0100
committerGitHub <noreply@github.com>2020-10-12 23:10:32 +0800
commit4d33cb2f94d2a9326c67032836f8fa3d4c0731f8 (patch)
treea5dfde9ef96880a0483e6acce931db10617135a3 /test/compress
parent00d0eda85baba441e8aaac056b6f32b12e79dd6e (diff)
downloadtracifyjs-4d33cb2f94d2a9326c67032836f8fa3d4c0731f8.tar.gz
tracifyjs-4d33cb2f94d2a9326c67032836f8fa3d4c0731f8.zip
fix corner case in `inilne` (#4204)
fixes #4202
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/const.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/compress/const.js b/test/compress/const.js
index 72033f4a..28dda019 100644
--- a/test/compress/const.js
+++ b/test/compress/const.js
@@ -840,3 +840,35 @@ issue_4198: {
}
expect_stdout: "PASS"
}
+
+issue_4202: {
+ options = {
+ inline: true,
+ toplevel: true,
+ }
+ input: {
+ {
+ const o = {};
+ (function() {
+ function f() {
+ o.p = 42;
+ }
+ f(f);
+ })();
+ console.log(o.p++);
+ }
+ }
+ expect: {
+ {
+ const o = {};
+ (function() {
+ function f() {
+ o.p = 42;
+ }
+ f(f);
+ })();
+ console.log(o.p++);
+ }
+ }
+ expect_stdout: "42"
+}