From 1bc0df1569c08618cf9c14e6e7a22dc89f25eb86 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sun, 26 Jul 2020 02:27:34 +0100 Subject: fix corner case in `hoist_props` (#4024) fixes #4023 --- test/compress/hoist_props.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test/compress') diff --git a/test/compress/hoist_props.js b/test/compress/hoist_props.js index 692dc676..09137cc9 100644 --- a/test/compress/hoist_props.js +++ b/test/compress/hoist_props.js @@ -1016,3 +1016,28 @@ issue_3945_2: { } expect_stdout: "undefined" } + +issue_4023: { + options = { + comparisons: true, + hoist_props: true, + inline: true, + reduce_vars: true, + toplevel: true, + typeofs: true, + unused: true, + } + input: { + function f() { + var a = function() { + return { p: 0 }; + }(); + return console.log("undefined" != typeof a); + } + f(); + } + expect: { + console.log(void 0 !== {}); + } + expect_stdout: "true" +} -- cgit v1.2.3