From 35435d4bd302e33011e91260f2c4b94f429b7a52 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Fri, 29 Jan 2021 05:21:19 +0000 Subject: suppress false positives due to nested objects (#4597) --- test/compress/sandbox.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test/compress') 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, -- cgit v1.2.3 >aboutsummaryrefslogtreecommitdiff