From 2cd7133411c34aedbd622ca4e6175ed0d0cb64bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Mon, 2 Dec 2024 10:17:23 +0900 Subject: [PATCH 1/3] disable --- crates/swc_ecma_preset_env/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/swc_ecma_preset_env/src/lib.rs b/crates/swc_ecma_preset_env/src/lib.rs index 8db8e15570e2..0e1c7c0e6315 100644 --- a/crates/swc_ecma_preset_env/src/lib.rs +++ b/crates/swc_ecma_preset_env/src/lib.rs @@ -90,7 +90,7 @@ where pass, Optional::new( class_fields_use_set(assumptions.pure_getters), - assumptions.set_public_class_fields, + assumptions.set_public_class_fields && should_enable!(ClassProperties, true), ), ); From f433c78aa0a4309def05752e316caaa3738319f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Mon, 2 Dec 2024 10:18:12 +0900 Subject: [PATCH 2/3] Add a test --- .../fixture/issues-9xxx/9743/input/.swcrc | 21 +++++++++++++++++++ .../tests/fixture/issues-9xxx/9743/input/1.js | 3 +++ 2 files changed, 24 insertions(+) create mode 100644 crates/swc/tests/fixture/issues-9xxx/9743/input/.swcrc create mode 100644 crates/swc/tests/fixture/issues-9xxx/9743/input/1.js diff --git a/crates/swc/tests/fixture/issues-9xxx/9743/input/.swcrc b/crates/swc/tests/fixture/issues-9xxx/9743/input/.swcrc new file mode 100644 index 000000000000..30f0c4ad1d36 --- /dev/null +++ b/crates/swc/tests/fixture/issues-9xxx/9743/input/.swcrc @@ -0,0 +1,21 @@ +{ + "jsc": { + "parser": { + "syntax": "ecmascript", + "jsx": false + }, + "loose": true, + "minify": { + "compress": false, + "mangle": false + } + }, + "module": { + "type": "es6" + }, + "minify": false, + "isModule": true, + "env": { + "targets": "node >= 18.18" + } +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/issues-9xxx/9743/input/1.js b/crates/swc/tests/fixture/issues-9xxx/9743/input/1.js new file mode 100644 index 000000000000..66c43a66aecf --- /dev/null +++ b/crates/swc/tests/fixture/issues-9xxx/9743/input/1.js @@ -0,0 +1,3 @@ +class Foo extends Bar { + handleScroll = () => { } +} \ No newline at end of file From 9e654fa224db9ab3def1e9d3507b0eefc85ed900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Mon, 2 Dec 2024 10:31:38 +0900 Subject: [PATCH 3/3] Update test refs --- .../tests/fixture/issues-1xxx/1456/case1/output/index.ts | 7 +++++++ .../tests/fixture/issues-1xxx/1456/case2/output/index.ts | 2 ++ crates/swc/tests/fixture/issues-9xxx/9743/output/1.js | 3 +++ 3 files changed, 12 insertions(+) create mode 100644 crates/swc/tests/fixture/issues-9xxx/9743/output/1.js diff --git a/crates/swc/tests/fixture/issues-1xxx/1456/case1/output/index.ts b/crates/swc/tests/fixture/issues-1xxx/1456/case1/output/index.ts index 514561b0fe2a..eacdc1f1a7e2 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1456/case1/output/index.ts +++ b/crates/swc/tests/fixture/issues-1xxx/1456/case1/output/index.ts @@ -3,6 +3,7 @@ var _ts_decorate = require("@swc/helpers/_/_ts_decorate"); var _ts_metadata = require("@swc/helpers/_/_ts_metadata"); var _ts_param = require("@swc/helpers/_/_ts_param"); class MyClass1 { + param1; constructor(param1){ this.param1 = param1; } @@ -15,6 +16,7 @@ MyClass1 = _ts_decorate._([ ]) ], MyClass1); class MyClass2 { + param1; constructor(param1){ this.param1 = param1; } @@ -27,6 +29,7 @@ MyClass2 = _ts_decorate._([ ]) ], MyClass2); class MyClass3 { + param1; constructor(param1){ this.param1 = param1; } @@ -39,6 +42,7 @@ MyClass3 = _ts_decorate._([ ]) ], MyClass3); class MyClass4 { + param1; constructor(param1){ this.param1 = param1; } @@ -51,6 +55,7 @@ MyClass4 = _ts_decorate._([ ]) ], MyClass4); class MyClass5 { + param1; constructor(param1){ this.param1 = param1; } @@ -63,6 +68,8 @@ MyClass5 = _ts_decorate._([ ]) ], MyClass5); class MyClass6 { + param1; + param2; constructor(param1, param2){ this.param1 = param1; this.param2 = param2; diff --git a/crates/swc/tests/fixture/issues-1xxx/1456/case2/output/index.ts b/crates/swc/tests/fixture/issues-1xxx/1456/case2/output/index.ts index 3ec82114db04..0abd491d1838 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1456/case2/output/index.ts +++ b/crates/swc/tests/fixture/issues-1xxx/1456/case2/output/index.ts @@ -13,6 +13,7 @@ MyClass1 = _ts_decorate._([ ]) ], MyClass1); class MyClass2 { + param1; constructor(param1, param2){ this.param1 = param1; } @@ -27,6 +28,7 @@ MyClass2 = _ts_decorate._([ ]) ], MyClass2); class MyClass3 { + param2; constructor(param1, param2){ this.param2 = param2; } diff --git a/crates/swc/tests/fixture/issues-9xxx/9743/output/1.js b/crates/swc/tests/fixture/issues-9xxx/9743/output/1.js new file mode 100644 index 000000000000..4867750d14de --- /dev/null +++ b/crates/swc/tests/fixture/issues-9xxx/9743/output/1.js @@ -0,0 +1,3 @@ +class Foo extends Bar { + handleScroll = ()=>{}; +}