aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-01-29 05:21:19 +0000
committerGitHub <noreply@github.com>2021-01-29 13:21:19 +0800
commit35435d4bd302e33011e91260f2c4b94f429b7a52 (patch)
treeaaad576bb53f5ebefeda93a2119e9a944b0b6da6 /test/compress
parentd0bb1476397d2cf6f240267aa003fe6edc445683 (diff)
downloadtracifyjs-35435d4bd302e33011e91260f2c4b94f429b7a52.tar.gz
tracifyjs-35435d4bd302e33011e91260f2c4b94f429b7a52.zip
suppress false positives due to nested objects (#4597)
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/sandbox.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/compress/sandbox.js b/test/compress/sandbox.js
index 338afd11..9cf76725 100644
--- a/test/compress/sandbox.js
+++ b/test/compress/sandbox.js
@@ -98,6 +98,31 @@ log_global: {
expect_stdout: "[object global]"
}
+log_nested: {
+ options = {
+ unused: true,
+ }
+ input: {
+ var o = { p: 42 };
+ for (var i = 0; i < 10; i++)
+ o = {
+ p: o,
+ q: function foo() {},
+ };
+ console.log(o);
+ }
+ expect: {
+ var o = { p: 42 };
+ for (var i = 0; i < 10; i++)
+ o = {
+ p: o,
+ q: function() {},
+ };
+ console.log(o);
+ }
+ expect_stdout: true
+}
+
timers: {
options = {
reduce_vars: true,