From 1e4de2e6d31a50dafee4a4e4d020f22691d22292 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Tue, 27 Jun 2017 10:31:19 +0800 Subject: parse `@global_defs` as expressions (#2169) - let parser rejects non-conformant input - eliminate need for extraneous parenthesis --- test/compress/global_defs.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/compress/global_defs.js') diff --git a/test/compress/global_defs.js b/test/compress/global_defs.js index d784d335..74147ded 100644 --- a/test/compress/global_defs.js +++ b/test/compress/global_defs.js @@ -174,3 +174,24 @@ issue_1986: { console.log(42); } } + +issue_2167: { + options = { + conditionals: true, + dead_code: true, + evaluate: true, + global_defs: { + "@isDevMode": "function(){}", + }, + side_effects: true, + } + input: { + if (isDevMode()) { + greetOverlord(); + } + doWork(); + } + expect: { + doWork(); + } +} -- cgit v1.2.3