aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/ie8.js50
-rw-r--r--test/compress/optional-chains.js22
2 files changed, 72 insertions, 0 deletions
diff --git a/test/compress/ie8.js b/test/compress/ie8.js
index 23532968..3221c92a 100644
--- a/test/compress/ie8.js
+++ b/test/compress/ie8.js
@@ -2947,3 +2947,53 @@ issue_4729: {
}
expect_stdout: "PASS"
}
+
+issue_4928_1: {
+ options = {
+ ie8: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = function f() {
+ f(a);
+ };
+ console.log(typeof f);
+ }
+ expect: {
+ var a = function f() {
+ f(a);
+ };
+ console.log(typeof f);
+ }
+ expect_stdout: "undefined"
+}
+
+issue_4928_2: {
+ options = {
+ ie8: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ switch (42) {
+ case console:
+ var a = function f() {
+ f(a);
+ };
+ case 42:
+ var a = console.log("PASS");
+ }
+ }
+ expect: {
+ switch (42) {
+ case console:
+ var a = function f() {
+ f(a);
+ };
+ case 42:
+ a = console.log("PASS");
+ }
+ }
+ expect_stdout: "PASS"
+}
diff --git a/test/compress/optional-chains.js b/test/compress/optional-chains.js
index 43033c92..7f61263c 100644
--- a/test/compress/optional-chains.js
+++ b/test/compress/optional-chains.js
@@ -253,3 +253,25 @@ issue_4906: {
expect_stdout: "PASS"
node_version: ">=14"
}
+
+issue_4928: {
+ options = {
+ ie8: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = a?.[function f() {
+ f(a);
+ }];
+ console.log(typeof f);
+ }
+ expect: {
+ var a = a?.[function f() {
+ f(a);
+ }];
+ console.log(typeof f);
+ }
+ expect_stdout: "undefined"
+ node_version: ">=14"
+}