aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/classes.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/compress/classes.js b/test/compress/classes.js
index a1b4f0cd..cebccf95 100644
--- a/test/compress/classes.js
+++ b/test/compress/classes.js
@@ -1244,3 +1244,34 @@ new_target: {
expect_stdout: "function"
node_version: ">=6"
}
+
+issue_4756: {
+ options = {
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ try {
+ class A extends 42 {
+ static [console.log("foo")] = console.log("bar");
+ }
+ } catch (e) {
+ console.log("baz");
+ }
+ }
+ expect: {
+ try {
+ (class extends 42 {
+ [console.log("foo")]() {}
+ }),
+ (() => console.log("bar"))();
+ } catch (e) {
+ console.log("baz");
+ }
+ }
+ expect_stdout: [
+ "foo",
+ "baz",
+ ]
+ node_version: ">=12"
+}