From eff45eac0ee284a113d1b587263fcef8e397daa3 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Tue, 25 May 2021 17:12:31 +0100 Subject: fix corner case in `ie8` (#4963) fixes #4962 --- test/compress/classes.js | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'test') diff --git a/test/compress/classes.js b/test/compress/classes.js index 69d7047e..11dc801f 100644 --- a/test/compress/classes.js +++ b/test/compress/classes.js @@ -1590,3 +1590,56 @@ issue_4951_2: { expect_stdout: "PASS" node_version: ">=14.6" } + +issue_4962_1: { + options = { + ie8: true, + inline: true, + reduce_vars: true, + unused: true, + } + input: { + (function() { + function f() { + while (console.log(typeof g)); + } + class A { + static p = f(); + } + })(function g() {}); + } + expect: { + (function g() {}), + void function() { + while (console.log(typeof g)); + }(); + } + expect_stdout: "undefined" + node_version: ">=12" +} + +issue_4962_2: { + options = { + ie8: true, + inline: true, + reduce_vars: true, + unused: true, + } + input: { + console.log(function f() {}(function g() { + function h() { + f; + } + class A { + static p = h(); + } + }, typeof g)); + } + expect: { + console.log(function f() {}(function g() { + f; + })); + } + expect_stdout: "undefined" + node_version: ">=12" +} -- cgit v1.2.3