From 7cf72b8d66ea3a504648f42a2142728d520f3141 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 19 Jul 2018 18:14:36 +0800 Subject: fix corner case in `global_defs` (#3218) fixes #3217 --- test/compress/global_defs.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/compress/global_defs.js b/test/compress/global_defs.js index 98fa3e9f..f1ef81d9 100644 --- a/test/compress/global_defs.js +++ b/test/compress/global_defs.js @@ -142,7 +142,6 @@ mixed: { } expect_warnings: [ "WARN: global_defs CONFIG.VALUE redefined [test/compress/global_defs.js:4,22]", - "WARN: global_defs CONFIG.VALUE redefined [test/compress/global_defs.js:5,22]", "WARN: global_defs CONFIG.VALUE redefined [test/compress/global_defs.js:7,8]", ] } @@ -197,3 +196,23 @@ issue_2167: { doWork(); } } + +issue_3217: { + options = { + collapse_vars: true, + global_defs: { + "@o": "{fn:function(){var a=42;console.log(a)}}", + }, + inline: true, + properties: true, + reduce_vars: true, + side_effects: true, + unused: true, + } + input: { + o.fn(); + } + expect: { + console.log(42); + } +} -- cgit v1.2.3