From 6768e6578f0e39389fc6499ddf2b7282e3621d7c Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Tue, 26 Nov 2019 01:51:04 +0800 Subject: inline functions with directives more effectively (#3604) --- test/compress/functions.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test/compress/functions.js') diff --git a/test/compress/functions.js b/test/compress/functions.js index 2af14a62..4f3139b1 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -3568,3 +3568,29 @@ pr_3592_2: { } expect_stdout: "PASS" } + +inline_use_strict: { + options = { + evaluate: true, + inline: true, + reduce_vars: true, + sequences: true, + side_effects: true, + unused: true, + } + input: { + console.log(function() { + "use strict"; + return function() { + "use strict"; + var a = "foo"; + a += "bar"; + return a; + }; + }()()); + } + expect: { + console.log("foobar"); + } + expect_stdout: "foobar" +} -- cgit v1.2.3