diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-07-26 02:27:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-26 09:27:34 +0800 |
commit | 1bc0df1569c08618cf9c14e6e7a22dc89f25eb86 (patch) | |
tree | c04f26c7aee2250ec806a3e47e37e1c9a2f6c32e /test/compress | |
parent | a98ba994bdcec80e47cf0964534a2d721014b458 (diff) | |
download | tracifyjs-1bc0df1569c08618cf9c14e6e7a22dc89f25eb86.tar.gz tracifyjs-1bc0df1569c08618cf9c14e6e7a22dc89f25eb86.zip |
fix corner case in `hoist_props` (#4024)
fixes #4023
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/hoist_props.js | 25 |
1 files changed, 25 insertions, 0 deletions
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" +} |