From a489f8cb5e8fbf2c090df84b47b475375563e8d7 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Tue, 2 Jun 2020 20:34:38 +0100 Subject: [PATCH] add test case for #3945 (#3948) --- test/compress/hoist_props.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/test/compress/hoist_props.js b/test/compress/hoist_props.js index 4fcbd796..692dc676 100644 --- a/test/compress/hoist_props.js +++ b/test/compress/hoist_props.js @@ -973,7 +973,7 @@ issue_3871: { expect_stdout: "PASS" } -issue_3945: { +issue_3945_1: { options = { hoist_props: true, reduce_vars: true, @@ -995,3 +995,24 @@ issue_3945: { } } } + +issue_3945_2: { + options = { + hoist_props: true, + reduce_vars: true, + toplevel: true, + } + input: { + console.log(typeof o); + var o = { + p: 0, + }; + } + expect: { + console.log(typeof o); + var o = { + p: 0, + }; + } + expect_stdout: "undefined" +} -- 2.34.1