From fc4735ce8595d01280189f44471b2a8b14a4114d 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, 1 Jul 2024 16:48:22 +0900 Subject: [PATCH 1/6] Test --- .../scripts/split-decorator-tests.mjs | 44 ++++ ...orators: Basic (instance auto-accessor).js | 37 +++ ... Basic (private instance auto-accessor).js | 37 +++ ...s: Basic (private static auto-accessor).js | 35 +++ ...ecorators: Basic (static auto-accessor).js | 36 +++ ...ra initializer (instance auto-accessor).js | 22 ++ ...alizer (private instance auto-accessor).js | 22 ++ ...tializer (private static auto-accessor).js | 20 ++ ...xtra initializer (static auto-accessor).js | 20 ++ ...s: Return null (instance auto-accessor).js | 11 + ...n null (private instance auto-accessor).js | 11 + ...urn null (private static auto-accessor).js | 11 + ...ors: Return null (static auto-accessor).js | 11 + ...corators: Shim (instance auto-accessor).js | 23 ++ ...: Shim (private instance auto-accessor).js | 27 ++ ...rs: Shim (private static auto-accessor).js | 28 +++ ...decorators: Shim (static auto-accessor).js | 26 ++ ...decorators: Basic expression: Anonymous.js | 23 ++ ...rators: Basic expression: Array binding.js | 23 ++ ...ic expression: Assignment array binding.js | 25 ++ ...asic expression: Assignment initializer.js | 25 ++ ...c expression: Assignment object binding.js | 25 ++ ...ion: Instance auto-accessor initializer.js | 29 +++ ... expression: Instance field initializer.js | 29 +++ ...ators: Basic expression: Object binding.js | 23 ++ ...ators: Basic expression: Property value.js | 27 ++ ...ssion: Static auto-accessor initializer.js | 27 ++ ...ic expression: Static field initializer.js | 27 ++ ... Basic expression: Variable initializer.js | 23 ++ .../Class decorators: Basic statement.js | 17 ++ .../Class decorators: Extra initializer.js | 19 ++ .../Class decorators: Order.js | 32 +++ .../Class decorators: Return null.js | 10 + .../Class decorators: Return object.js | 10 + ...aluation: \"await\" (class expression).js" | 32 +++ ...valuation: \"await\" (class statement).js" | 31 +++ ...valuation: \"this\" (class expression).js" | 37 +++ ...evaluation: \"this\" (class statement).js" | 36 +++ ...ation: Class binding (class expression).js | 44 ++++ ...uation: Class binding (class statement).js | 61 +++++ ...tion: Computed names (class expression).js | 39 +++ ...ation: Computed names (class statement).js | 38 +++ ...: Inner private name (class expression).js | 48 ++++ ...n: Inner private name (class statement).js | 56 +++++ ...: Outer private name (class expression).js | 37 +++ ...n: Outer private name (class statement).js | 36 +++ .../Decorator metadata: class expression.js | 68 +++++ .../Decorator metadata: class statement.js | 67 +++++ ...ield decorators: Basic (instance field).js | 30 +++ ...orators: Basic (private instance field).js | 28 +++ ...ecorators: Basic (private static field).js | 27 ++ .../Field decorators: Basic (static field).js | 30 +++ ...ors: Extra initializer (instance field).js | 22 ++ ...ra initializer (private instance field).js | 22 ++ ...xtra initializer (private static field).js | 20 ++ ...ators: Extra initializer (static field).js | 20 ++ ...ield decorators: Order (instance field).js | 22 ++ ...orators: Order (private instance field).js | 24 ++ ...ecorators: Order (private static field).js | 22 ++ .../Field decorators: Order (static field).js | 20 ++ ...ecorators: Return null (instance field).js | 11 + ...s: Return null (private instance field).js | 11 + ...ors: Return null (private static field).js | 11 + ... decorators: Return null (static field).js | 11 + ...orators: Return object (instance field).js | 11 + ... Return object (private instance field).js | 11 + ...s: Return object (private static field).js | 11 + ...ecorators: Return object (static field).js | 11 + ...Field decorators: Shim (instance field).js | 20 ++ ...corators: Shim (private instance field).js | 30 +++ ...decorators: Shim (private static field).js | 31 +++ .../Field decorators: Shim (static field).js | 23 ++ ...ter decorators: Basic (instance getter).js | 28 +++ ...rators: Basic (private instance getter).js | 26 ++ ...corators: Basic (private static getter).js | 26 ++ ...etter decorators: Basic (static getter).js | 28 +++ ...rs: Extra initializer (instance getter).js | 22 ++ ...a initializer (private instance getter).js | 22 ++ ...tra initializer (private static getter).js | 20 ++ ...tors: Extra initializer (static getter).js | 20 ++ ...ter decorators: Order (instance getter).js | 32 +++ ...rators: Order (private instance getter).js | 33 +++ ...corators: Order (private static getter).js | 33 +++ ...etter decorators: Order (static getter).js | 32 +++ ...corators: Return null (instance getter).js | 11 + ...: Return null (private instance getter).js | 11 + ...rs: Return null (private static getter).js | 11 + ...decorators: Return null (static getter).js | 11 + ...rators: Return object (instance getter).js | 11 + ...Return object (private instance getter).js | 11 + ...: Return object (private static getter).js | 11 + ...corators: Return object (static getter).js | 11 + ...tter decorators: Shim (instance getter).js | 14 ++ ...orators: Shim (private instance getter).js | 15 ++ ...ecorators: Shim (private static getter).js | 15 ++ ...Getter decorators: Shim (static getter).js | 14 ++ ...der (private members, class expression).js | 236 ++++++++++++++++++ ...rder (private members, class statement).js | 235 +++++++++++++++++ ...rder (public members, class expression).js | 236 ++++++++++++++++++ ...order (public members, class statement).js | 235 +++++++++++++++++ ...hod decorators: Basic (instance method).js | 29 +++ ...rators: Basic (private instance method).js | 27 ++ ...corators: Basic (private static method).js | 27 ++ ...ethod decorators: Basic (static method).js | 29 +++ ...rs: Extra initializer (instance method).js | 22 ++ ...a initializer (private instance method).js | 22 ++ ...tra initializer (private static method).js | 20 ++ ...tors: Extra initializer (static method).js | 20 ++ ...hod decorators: Order (instance method).js | 32 +++ ...rators: Order (private instance method).js | 34 +++ ...corators: Order (private static method).js | 34 +++ ...ethod decorators: Order (static method).js | 32 +++ ...corators: Return null (instance method).js | 11 + ...: Return null (private instance method).js | 11 + ...rs: Return null (private static method).js | 11 + ...decorators: Return null (static method).js | 11 + ...rators: Return object (instance method).js | 11 + ...Return object (private instance method).js | 11 + ...: Return object (private static method).js | 11 + ...corators: Return object (static method).js | 11 + ...thod decorators: Shim (instance method).js | 14 ++ ...orators: Shim (private instance method).js | 16 ++ ...ecorators: Shim (private static method).js | 16 ++ ...Method decorators: Shim (static method).js | 14 ++ ...ter decorators: Basic (instance setter).js | 35 +++ ...rators: Basic (private instance setter).js | 32 +++ ...corators: Basic (private static setter).js | 30 +++ ...etter decorators: Basic (static setter).js | 34 +++ ...rs: Extra initializer (instance setter).js | 22 ++ ...a initializer (private instance setter).js | 22 ++ ...tra initializer (private static setter).js | 20 ++ ...tors: Extra initializer (static setter).js | 20 ++ ...ter decorators: Order (instance setter).js | 32 +++ ...rators: Order (private instance setter).js | 33 +++ ...corators: Order (private static setter).js | 33 +++ ...etter decorators: Order (static setter).js | 32 +++ ...corators: Return null (instance setter).js | 11 + ...: Return null (private instance setter).js | 11 + ...rs: Return null (private static setter).js | 11 + ...decorators: Return null (static setter).js | 11 + ...rators: Return object (instance setter).js | 11 + ...Return object (private instance setter).js | 11 + ...: Return object (private static setter).js | 11 + ...corators: Return object (static setter).js | 11 + ...tter decorators: Shim (instance setter).js | 16 ++ ...orators: Shim (private instance setter).js | 17 ++ ...ecorators: Shim (private static setter).js | 16 ++ ...Setter decorators: Shim (static setter).js | 15 ++ 148 files changed, 4307 insertions(+) create mode 100644 crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (instance auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (private instance auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (private static auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (static auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (instance auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (private instance auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (private static auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (static auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (instance auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (private instance auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (private static auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (static auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (instance auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (private instance auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (private static auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (static auto-accessor).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Anonymous.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Array binding.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment array binding.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment initializer.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment object binding.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Instance auto-accessor initializer.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Instance field initializer.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Object binding.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Property value.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Static auto-accessor initializer.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Static field initializer.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Variable initializer.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic statement.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Extra initializer.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Order.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Return null.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Return object.js create mode 100644 "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" (class expression).js" create mode 100644 "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" (class statement).js" create mode 100644 "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" (class expression).js" create mode 100644 "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" (class statement).js" create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding (class expression).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding (class statement).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names (class expression).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names (class statement).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name (class expression).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name (class statement).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name (class expression).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name (class statement).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator metadata: class expression.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator metadata: class statement.js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (instance field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (private instance field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (private static field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (static field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (instance field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (private instance field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (private static field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (static field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (instance field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (private instance field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (private static field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (static field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (instance field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (private instance field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (private static field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (static field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (instance field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (private instance field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (private static field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (static field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (instance field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (private instance field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (private static field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (static field).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (instance getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (private instance getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (private static getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (static getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (instance getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (private instance getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (private static getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (static getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (instance getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (private instance getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (private static getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (static getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (instance getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (private instance getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (private static getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (static getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (instance getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (private instance getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (private static getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (static getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (instance getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (private instance getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (private static getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (static getter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (private members, class expression).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (private members, class statement).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (public members, class expression).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (public members, class statement).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (instance method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (private instance method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (private static method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (static method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (instance method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (private instance method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (private static method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (static method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (instance method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (private instance method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (private static method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (static method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (instance method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (private instance method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (private static method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (static method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (instance method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (private instance method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (private static method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (static method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (instance method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (private instance method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (private static method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (static method).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (instance setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (private instance setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (private static setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (static setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (instance setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (private instance setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (private static setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (static setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (instance setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (private instance setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (private static setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (static setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (instance setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (private instance setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (private static setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (static setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (instance setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (private instance setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (private static setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (static setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (instance setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (private instance setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (private static setter).js create mode 100644 crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (static setter).js diff --git a/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs b/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs new file mode 100644 index 000000000000..09318d745800 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs @@ -0,0 +1,44 @@ +import typescript from 'typescript' +import fs from 'fs' +import module from 'module' + +const require = module.createRequire(import.meta.url) +const ts = fs.readFileSync('./tests/decorator-tests/decorator-tests.ts', 'utf8') + +// Convert TypeScript to JavaScript for testing JavaScript VMs +console.log('Converting TypeScript to JavaScript...') + +const program = typescript.createProgram({ + rootNames: ['./tests/decorator-tests/decorator-tests.ts'], + options: { target: typescript.ScriptTarget.ESNext } +}); +// console.log('program', program) +const mainFile = program.getSourceFile('./tests/decorator-tests/decorator-tests.ts') +// console.log('mainFile', mainFile) + +const testVarStmt = mainFile.statements.find((s) => s.kind === typescript.SyntaxKind.VariableStatement) +// console.log('testVarStmt', testVarStmt) + +const testVarDecl = testVarStmt.declarationList.declarations[0] +// console.log('testVarDecl', testVarDecl) + +const properties = testVarDecl.initializer.properties +// console.log('properties', properties) + +fs.mkdirSync(`tests/decorator-evanw-split`, { recursive: true }); + +for (const property of properties) { + let name = property.name.getText(mainFile) + const value = property.initializer.getText(mainFile) + + name = name.replace(/'/g, '') + + // console.log('name', name) + // console.log('value', value) + + const code = `(${value})()`; + const transpiiled = typescript.transpile(code, { target: typescript.ScriptTarget.ESNext }) + + fs.writeFileSync(`tests/decorator-evanw-split/${name}.js`, transpiiled) +} + diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (instance auto-accessor).js new file mode 100644 index 000000000000..a94f1386deec --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (instance auto-accessor).js @@ -0,0 +1,37 @@ +(() => { + const dec = (key, getName, setName) => (target, ctx) => { + assertEq(() => typeof target.get, 'function'); + assertEq(() => typeof target.set, 'function'); + assertEq(() => target.get.name, getName); + assertEq(() => target.set.name, setName); + assertEq(() => ctx.kind, 'accessor'); + assertEq(() => ctx.name, key); + assertEq(() => ctx.static, false); + assertEq(() => ctx.private, false); + assertEq(() => ctx.access.has({ [key]: false }), true); + assertEq(() => ctx.access.has({ bar: true }), false); + assertEq(() => ctx.access.get({ [key]: 123 }), 123); + assertEq(() => { + const obj = {}; + ctx.access.set(obj, 123); + return obj[key]; + }, 123); + }; + const bar = Symbol('bar'); + const baz = Symbol(); + class Foo { + @dec('foo', 'get foo', 'set foo') + accessor foo = 0; + @dec(bar, 'get [bar]', 'set [bar]') + accessor [bar] = 0; + @dec(baz, 'get ', 'set ') + accessor [baz] = 0; + } + var obj = new Foo; + obj.foo = 321; + assertEq(() => obj.foo, 321); + obj[bar] = 4321; + assertEq(() => obj[bar], 4321); + obj[baz] = 54321; + assertEq(() => obj[baz], 54321); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (private instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (private instance auto-accessor).js new file mode 100644 index 000000000000..5c9260a5f8bb --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (private instance auto-accessor).js @@ -0,0 +1,37 @@ +(() => { + let lateAsserts; + const dec = (target, ctx) => { + assertEq(() => typeof target.get, 'function'); + assertEq(() => typeof target.set, 'function'); + assertEq(() => target.get.name, 'get #foo'); + assertEq(() => target.set.name, 'set #foo'); + assertEq(() => ctx.kind, 'accessor'); + assertEq(() => ctx.name, '#foo'); + assertEq(() => ctx.static, false); + assertEq(() => ctx.private, true); + lateAsserts = () => { + assertEq(() => ctx.access.has(new Foo), true); + assertEq(() => ctx.access.has({}), false); + assertEq(() => ctx.access.get(new Foo), 0); + assertEq(() => { + const obj = new Foo; + ctx.access.set(obj, 123); + return get$foo(obj); + }, 123); + }; + }; + let get$foo; + let set$foo; + class Foo { + @dec + accessor #foo = 0; + static { + get$foo = x => x.#foo; + set$foo = (x, y) => { x.#foo = y; }; + } + } + lateAsserts(); + var obj = new Foo; + assertEq(() => set$foo(obj, 321), undefined); + assertEq(() => get$foo(obj), 321); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (private static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (private static auto-accessor).js new file mode 100644 index 000000000000..6085b1b05e9b --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (private static auto-accessor).js @@ -0,0 +1,35 @@ +(() => { + let lateAsserts; + const dec = (target, ctx) => { + assertEq(() => typeof target.get, 'function'); + assertEq(() => typeof target.set, 'function'); + assertEq(() => target.get.name, 'get #foo'); + assertEq(() => target.set.name, 'set #foo'); + assertEq(() => ctx.kind, 'accessor'); + assertEq(() => ctx.name, '#foo'); + assertEq(() => ctx.static, true); + assertEq(() => ctx.private, true); + lateAsserts = () => { + assertEq(() => ctx.access.has(Foo), true); + assertEq(() => ctx.access.has({}), false); + assertEq(() => ctx.access.get(Foo), 0); + assertEq(() => { + ctx.access.set(Foo, 123); + return get$foo(Foo); + }, 123); + }; + }; + let get$foo; + let set$foo; + class Foo { + @dec + static accessor #foo = 0; + static { + get$foo = x => x.#foo; + set$foo = (x, y) => { x.#foo = y; }; + } + } + lateAsserts(); + assertEq(() => set$foo(Foo, 321), undefined); + assertEq(() => get$foo(Foo), 321); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (static auto-accessor).js new file mode 100644 index 000000000000..5c93cd282edc --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (static auto-accessor).js @@ -0,0 +1,36 @@ +(() => { + const dec = (key, getName, setName) => (target, ctx) => { + assertEq(() => typeof target.get, 'function'); + assertEq(() => typeof target.set, 'function'); + assertEq(() => target.get.name, getName); + assertEq(() => target.set.name, setName); + assertEq(() => ctx.kind, 'accessor'); + assertEq(() => ctx.name, key); + assertEq(() => ctx.static, true); + assertEq(() => ctx.private, false); + assertEq(() => ctx.access.has({ [key]: false }), true); + assertEq(() => ctx.access.has({ bar: true }), false); + assertEq(() => ctx.access.get({ [key]: 123 }), 123); + assertEq(() => { + const obj = {}; + ctx.access.set(obj, 123); + return obj[key]; + }, 123); + }; + const bar = Symbol('bar'); + const baz = Symbol(); + class Foo { + @dec('foo', 'get foo', 'set foo') + static accessor foo = 0; + @dec(bar, 'get [bar]', 'set [bar]') + static accessor [bar] = 0; + @dec(baz, 'get ', 'set ') + static accessor [baz] = 0; + } + Foo.foo = 321; + assertEq(() => Foo.foo, 321); + Foo[bar] = 4321; + assertEq(() => Foo[bar], 4321); + Foo[baz] = 54321; + assertEq(() => Foo[baz], 54321); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (instance auto-accessor).js new file mode 100644 index 000000000000..52bfe012535f --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (instance auto-accessor).js @@ -0,0 +1,22 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (target, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + accessor foo; + } + assertEq(() => got, undefined); + const instance = new Foo; + assertEq(() => got.this, instance); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (private instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (private instance auto-accessor).js new file mode 100644 index 000000000000..fc7f426a4b34 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (private instance auto-accessor).js @@ -0,0 +1,22 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (target, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + accessor #foo; + } + assertEq(() => got, undefined); + const instance = new Foo; + assertEq(() => got.this, instance); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (private static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (private static auto-accessor).js new file mode 100644 index 000000000000..a1347763c6bf --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (private static auto-accessor).js @@ -0,0 +1,20 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (target, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + static accessor #foo; + } + assertEq(() => got.this, Foo); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (static auto-accessor).js new file mode 100644 index 000000000000..9f64461e296e --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (static auto-accessor).js @@ -0,0 +1,20 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (target, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + static accessor foo; + } + assertEq(() => got.this, Foo); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (instance auto-accessor).js new file mode 100644 index 000000000000..62a6cc395811 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (instance auto-accessor).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (target, ctx) => { + return null; + }; + class Foo { + @dec + accessor foo; + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (private instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (private instance auto-accessor).js new file mode 100644 index 000000000000..483228ef0381 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (private instance auto-accessor).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (target, ctx) => { + return null; + }; + class Foo { + @dec + accessor #foo; + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (private static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (private static auto-accessor).js new file mode 100644 index 000000000000..8339e54d8b19 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (private static auto-accessor).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (target, ctx) => { + return null; + }; + class Foo { + @dec + static accessor #foo; + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (static auto-accessor).js new file mode 100644 index 000000000000..faa52b9b0afd --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (static auto-accessor).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (target, ctx) => { + return null; + }; + class Foo { + @dec + static accessor foo; + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (instance auto-accessor).js new file mode 100644 index 000000000000..2e9fb2f3c42e --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (instance auto-accessor).js @@ -0,0 +1,23 @@ +(() => { + let get; + let set; + const dec = (target, ctx) => { + function init(x) { + assertEq(() => this instanceof Foo, true); + return x + 1; + } + get = function () { return target.get.call(this) * 10; }; + set = function (x) { target.set.call(this, x * 2); }; + return { get, set, init }; + }; + class Foo { + @dec + accessor foo = 123; + } + assertEq(() => Object.getOwnPropertyDescriptor(Foo.prototype, 'foo').get, get); + assertEq(() => Object.getOwnPropertyDescriptor(Foo.prototype, 'foo').set, set); + var obj = new Foo; + assertEq(() => obj.foo, (123 + 1) * 10); + obj.foo = 321; + assertEq(() => obj.foo, (321 * 2) * 10); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (private instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (private instance auto-accessor).js new file mode 100644 index 000000000000..709d80851fd3 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (private instance auto-accessor).js @@ -0,0 +1,27 @@ +(() => { + let get; + let set; + const dec = (target, ctx) => { + function init(x) { + assertEq(() => this instanceof Foo, true); + return x + 1; + } + get = function () { return target.get.call(this) * 10; }; + set = function (x) { target.set.call(this, x * 2); }; + return { get, set, init }; + }; + let get$foo; + let set$foo; + class Foo { + @dec + accessor #foo = 123; + static { + get$foo = x => x.#foo; + set$foo = (x, y) => { x.#foo = y; }; + } + } + var obj = new Foo; + assertEq(() => get$foo(obj), (123 + 1) * 10); + assertEq(() => set$foo(obj, 321), undefined); + assertEq(() => get$foo(obj), (321 * 2) * 10); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (private static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (private static auto-accessor).js new file mode 100644 index 000000000000..2b088065fdea --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (private static auto-accessor).js @@ -0,0 +1,28 @@ +(() => { + let foo; + let get; + let set; + const dec = (target, ctx) => { + function init(x) { + assertEq(() => this, foo); + return x + 1; + } + get = function () { return target.get.call(this) * 10; }; + set = function (x) { target.set.call(this, x * 2); }; + return { get, set, init }; + }; + let get$foo; + let set$foo; + class Foo { + static { + foo = Foo; + get$foo = x => x.#foo; + set$foo = (x, y) => { x.#foo = y; }; + } + @dec + static accessor #foo = 123; + } + assertEq(() => get$foo(Foo), (123 + 1) * 10); + assertEq(() => set$foo(Foo, 321), undefined); + assertEq(() => get$foo(Foo), (321 * 2) * 10); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (static auto-accessor).js new file mode 100644 index 000000000000..3f2dd6420830 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (static auto-accessor).js @@ -0,0 +1,26 @@ +(() => { + let foo; + let get; + let set; + const dec = (target, ctx) => { + function init(x) { + assertEq(() => this, foo); + return x + 1; + } + get = function () { return target.get.call(this) * 10; }; + set = function (x) { target.set.call(this, x * 2); }; + return { get, set, init }; + }; + class Foo { + static { + foo = Foo; + } + @dec + static accessor foo = 123; + } + assertEq(() => Object.getOwnPropertyDescriptor(Foo, 'foo').get, get); + assertEq(() => Object.getOwnPropertyDescriptor(Foo, 'foo').set, set); + assertEq(() => Foo.foo, (123 + 1) * 10); + Foo.foo = 321; + assertEq(() => Foo.foo, (321 * 2) * 10); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Anonymous.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Anonymous.js new file mode 100644 index 000000000000..b9deb05827fc --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Anonymous.js @@ -0,0 +1,23 @@ +(() => { + let old; + const dec = (name) => (cls, ctx) => { + assertEq(() => typeof cls, 'function'); + assertEq(() => cls.name, name); + assertEq(() => ctx.kind, 'class'); + assertEq(() => ctx.name, name); + assertEq(() => 'static' in ctx, false); + assertEq(() => 'private' in ctx, false); + assertEq(() => 'access' in ctx, false); + old = cls; + }; + const Foo = (x => x)( + @dec('') + class { + }); + assertEq(() => Foo, old); + const Bar = (x => x)( + @dec('Baz') + class Baz { + }); + assertEq(() => Bar, old); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Array binding.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Array binding.js new file mode 100644 index 000000000000..3027e251aed9 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Array binding.js @@ -0,0 +1,23 @@ +(() => { + let old; + const dec = (name) => (cls, ctx) => { + assertEq(() => typeof cls, 'function'); + assertEq(() => cls.name, name); + assertEq(() => ctx.kind, 'class'); + assertEq(() => ctx.name, name); + assertEq(() => 'static' in ctx, false); + assertEq(() => 'private' in ctx, false); + assertEq(() => 'access' in ctx, false); + old = cls; + }; + const [Foo = + @dec('Foo') + class { + }] = []; + assertEq(() => Foo, old); + const [Bar = + @dec('Baz') + class Baz { + }] = []; + assertEq(() => Bar, old); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment array binding.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment array binding.js new file mode 100644 index 000000000000..ae70bae4d207 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment array binding.js @@ -0,0 +1,25 @@ +(() => { + let old; + const dec = (name) => (cls, ctx) => { + assertEq(() => typeof cls, 'function'); + assertEq(() => cls.name, name); + assertEq(() => ctx.kind, 'class'); + assertEq(() => ctx.name, name); + assertEq(() => 'static' in ctx, false); + assertEq(() => 'private' in ctx, false); + assertEq(() => 'access' in ctx, false); + old = cls; + }; + let Foo; + [Foo = + @dec('Foo') + class { + }] = []; + assertEq(() => Foo, old); + let Bar; + [Bar = + @dec('Baz') + class Baz { + }] = []; + assertEq(() => Bar, old); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment initializer.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment initializer.js new file mode 100644 index 000000000000..e836a58b2e47 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment initializer.js @@ -0,0 +1,25 @@ +(() => { + let old; + const dec = (name) => (cls, ctx) => { + assertEq(() => typeof cls, 'function'); + assertEq(() => cls.name, name); + assertEq(() => ctx.kind, 'class'); + assertEq(() => ctx.name, name); + assertEq(() => 'static' in ctx, false); + assertEq(() => 'private' in ctx, false); + assertEq(() => 'access' in ctx, false); + old = cls; + }; + let Foo; + Foo = + @dec('Foo') + class { + }; + assertEq(() => Foo, old); + let Bar; + Bar = + @dec('Baz') + class Baz { + }; + assertEq(() => Bar, old); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment object binding.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment object binding.js new file mode 100644 index 000000000000..1695f02f0a05 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment object binding.js @@ -0,0 +1,25 @@ +(() => { + let old; + const dec = (name) => (cls, ctx) => { + assertEq(() => typeof cls, 'function'); + assertEq(() => cls.name, name); + assertEq(() => ctx.kind, 'class'); + assertEq(() => ctx.name, name); + assertEq(() => 'static' in ctx, false); + assertEq(() => 'private' in ctx, false); + assertEq(() => 'access' in ctx, false); + old = cls; + }; + let Foo; + ({ Foo = + @dec('Foo') + class { + } } = {}); + assertEq(() => Foo, old); + let Bar; + ({ Bar = + @dec('Baz') + class Baz { + } } = {}); + assertEq(() => Bar, old); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Instance auto-accessor initializer.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Instance auto-accessor initializer.js new file mode 100644 index 000000000000..a73b22562d48 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Instance auto-accessor initializer.js @@ -0,0 +1,29 @@ +(() => { + let old; + const dec = (name) => (cls, ctx) => { + assertEq(() => typeof cls, 'function'); + assertEq(() => cls.name, name); + assertEq(() => ctx.kind, 'class'); + assertEq(() => ctx.name, name); + assertEq(() => 'static' in ctx, false); + assertEq(() => 'private' in ctx, false); + assertEq(() => 'access' in ctx, false); + old = cls; + }; + class Class { + accessor Foo = + @dec('Foo') + class { + }; + } + const Foo = new Class().Foo; + assertEq(() => Foo, old); + class Class2 { + accessor Bar = + @dec('Baz') + class Baz { + }; + } + const Bar = new Class2().Bar; + assertEq(() => Bar, old); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Instance field initializer.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Instance field initializer.js new file mode 100644 index 000000000000..5a15962d0ce6 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Instance field initializer.js @@ -0,0 +1,29 @@ +(() => { + let old; + const dec = (name) => (cls, ctx) => { + assertEq(() => typeof cls, 'function'); + assertEq(() => cls.name, name); + assertEq(() => ctx.kind, 'class'); + assertEq(() => ctx.name, name); + assertEq(() => 'static' in ctx, false); + assertEq(() => 'private' in ctx, false); + assertEq(() => 'access' in ctx, false); + old = cls; + }; + class Class { + Foo = + @dec('Foo') + class { + }; + } + const Foo = new Class().Foo; + assertEq(() => Foo, old); + class Class2 { + Bar = + @dec('Baz') + class Baz { + }; + } + const Bar = new Class2().Bar; + assertEq(() => Bar, old); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Object binding.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Object binding.js new file mode 100644 index 000000000000..c9c43a80ff80 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Object binding.js @@ -0,0 +1,23 @@ +(() => { + let old; + const dec = (name) => (cls, ctx) => { + assertEq(() => typeof cls, 'function'); + assertEq(() => cls.name, name); + assertEq(() => ctx.kind, 'class'); + assertEq(() => ctx.name, name); + assertEq(() => 'static' in ctx, false); + assertEq(() => 'private' in ctx, false); + assertEq(() => 'access' in ctx, false); + old = cls; + }; + const { Foo = + @dec('Foo') + class { + } } = {}; + assertEq(() => Foo, old); + const { Bar = + @dec('Baz') + class Baz { + } } = {}; + assertEq(() => Bar, old); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Property value.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Property value.js new file mode 100644 index 000000000000..3d04727e4003 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Property value.js @@ -0,0 +1,27 @@ +(() => { + let old; + const dec = (name) => (cls, ctx) => { + assertEq(() => typeof cls, 'function'); + assertEq(() => cls.name, name); + assertEq(() => ctx.kind, 'class'); + assertEq(() => ctx.name, name); + assertEq(() => 'static' in ctx, false); + assertEq(() => 'private' in ctx, false); + assertEq(() => 'access' in ctx, false); + old = cls; + }; + const obj = { + Foo: + @dec('Foo') + class { + }, + }; + assertEq(() => obj.Foo, old); + const obj2 = { + Bar: + @dec('Baz') + class Baz { + }, + }; + assertEq(() => obj2.Bar, old); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Static auto-accessor initializer.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Static auto-accessor initializer.js new file mode 100644 index 000000000000..e51530876809 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Static auto-accessor initializer.js @@ -0,0 +1,27 @@ +(() => { + let old; + const dec = (name) => (cls, ctx) => { + assertEq(() => typeof cls, 'function'); + assertEq(() => cls.name, name); + assertEq(() => ctx.kind, 'class'); + assertEq(() => ctx.name, name); + assertEq(() => 'static' in ctx, false); + assertEq(() => 'private' in ctx, false); + assertEq(() => 'access' in ctx, false); + old = cls; + }; + class Class { + static accessor Foo = + @dec('Foo') + class { + }; + } + assertEq(() => Class.Foo, old); + class Class2 { + static accessor Bar = + @dec('Baz') + class Baz { + }; + } + assertEq(() => Class2.Bar, old); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Static field initializer.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Static field initializer.js new file mode 100644 index 000000000000..8d2ad6126df8 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Static field initializer.js @@ -0,0 +1,27 @@ +(() => { + let old; + const dec = (name) => (cls, ctx) => { + assertEq(() => typeof cls, 'function'); + assertEq(() => cls.name, name); + assertEq(() => ctx.kind, 'class'); + assertEq(() => ctx.name, name); + assertEq(() => 'static' in ctx, false); + assertEq(() => 'private' in ctx, false); + assertEq(() => 'access' in ctx, false); + old = cls; + }; + class Class { + static Foo = + @dec('Foo') + class { + }; + } + assertEq(() => Class.Foo, old); + class Class2 { + static Bar = + @dec('Baz') + class Baz { + }; + } + assertEq(() => Class2.Bar, old); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Variable initializer.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Variable initializer.js new file mode 100644 index 000000000000..a63df6320341 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Variable initializer.js @@ -0,0 +1,23 @@ +(() => { + let old; + const dec = (name) => (cls, ctx) => { + assertEq(() => typeof cls, 'function'); + assertEq(() => cls.name, name); + assertEq(() => ctx.kind, 'class'); + assertEq(() => ctx.name, name); + assertEq(() => 'static' in ctx, false); + assertEq(() => 'private' in ctx, false); + assertEq(() => 'access' in ctx, false); + old = cls; + }; + const Foo = + @dec('Foo') + class { + }; + assertEq(() => Foo, old); + const Bar = + @dec('Baz') + class Baz { + }; + assertEq(() => Bar, old); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic statement.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic statement.js new file mode 100644 index 000000000000..12a11b0c292c --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic statement.js @@ -0,0 +1,17 @@ +(() => { + let old; + const dec = (name) => (cls, ctx) => { + assertEq(() => typeof cls, 'function'); + assertEq(() => cls.name, name); + assertEq(() => ctx.kind, 'class'); + assertEq(() => ctx.name, name); + assertEq(() => 'static' in ctx, false); + assertEq(() => 'private' in ctx, false); + assertEq(() => 'access' in ctx, false); + old = cls; + }; + @dec('Foo') + class Foo { + } + assertEq(() => Foo, old); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Extra initializer.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Extra initializer.js new file mode 100644 index 000000000000..85819c9759f3 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Extra initializer.js @@ -0,0 +1,19 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (cls, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + @dec + @dec + class Foo { + } + assertEq(() => got.this, Foo); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Order.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Order.js new file mode 100644 index 000000000000..fe303b9130e2 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Order.js @@ -0,0 +1,32 @@ +(() => { + const log = []; + let Bar; + let Baz; + const dec1 = (cls, ctx) => { + log.push(2); + Bar = function () { + log.push(4); + return new cls; + }; + return Bar; + }; + const dec2 = (cls, ctx) => { + log.push(1); + Baz = function () { + log.push(5); + return new cls; + }; + return Baz; + }; + log.push(0); + @dec1 + @dec2 + class Foo { + constructor() { log.push(6); } + } + log.push(3); + new Foo; + log.push(7); + assertEq(() => Foo, Bar); + assertEq(() => log + '', '0,1,2,3,4,5,6,7'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Return null.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Return null.js new file mode 100644 index 000000000000..13bb99837afa --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Return null.js @@ -0,0 +1,10 @@ +(() => { + assertThrows(() => { + const dec = (cls, ctx) => { + return null; + }; + @dec + class Foo { + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Return object.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Return object.js new file mode 100644 index 000000000000..c966f3106428 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Return object.js @@ -0,0 +1,10 @@ +(() => { + assertThrows(() => { + const dec = (cls, ctx) => { + return {}; + }; + @dec + class Foo { + } + }, TypeError); +})(); diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" (class expression).js" "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" (class expression).js" new file mode 100644 index 000000000000..c8feec9ea0d2 --- /dev/null +++ "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" (class expression).js" @@ -0,0 +1,32 @@ +(async () => { + const log = []; + const dummy = () => { }; + async function wrapper() { + ( + @(log.push(await Promise.resolve(0)), dummy) + class extends (log.push(await Promise.resolve(1)), Object) { + @(log.push(await Promise.resolve(2)), dummy) + method() { } + @(log.push(await Promise.resolve(3)), dummy) + static method() { } + @(log.push(await Promise.resolve(4)), dummy) + field; + @(log.push(await Promise.resolve(5)), dummy) + static field; + @(log.push(await Promise.resolve(6)), dummy) + get getter() { return; } + @(log.push(await Promise.resolve(7)), dummy) + static get getter() { return; } + @(log.push(await Promise.resolve(8)), dummy) + set setter(x) { } + @(log.push(await Promise.resolve(9)), dummy) + static set setter(x) { } + @(log.push(await Promise.resolve(10)), dummy) + accessor accessor; + @(log.push(await Promise.resolve(11)), dummy) + static accessor accessor; + }); + } + await wrapper(); + assertEq(() => '' + log, '0,1,2,3,4,5,6,7,8,9,10,11'); +})(); diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" (class statement).js" "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" (class statement).js" new file mode 100644 index 000000000000..829eef635dfd --- /dev/null +++ "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" (class statement).js" @@ -0,0 +1,31 @@ +(async () => { + const log = []; + const dummy = () => { }; + async function wrapper() { + @(log.push(await Promise.resolve(0)), dummy) + class Foo extends (log.push(await Promise.resolve(1)), Object) { + @(log.push(await Promise.resolve(2)), dummy) + method() { } + @(log.push(await Promise.resolve(3)), dummy) + static method() { } + @(log.push(await Promise.resolve(4)), dummy) + field; + @(log.push(await Promise.resolve(5)), dummy) + static field; + @(log.push(await Promise.resolve(6)), dummy) + get getter() { return; } + @(log.push(await Promise.resolve(7)), dummy) + static get getter() { return; } + @(log.push(await Promise.resolve(8)), dummy) + set setter(x) { } + @(log.push(await Promise.resolve(9)), dummy) + static set setter(x) { } + @(log.push(await Promise.resolve(10)), dummy) + accessor accessor; + @(log.push(await Promise.resolve(11)), dummy) + static accessor accessor; + } + } + await wrapper(); + assertEq(() => '' + log, '0,1,2,3,4,5,6,7,8,9,10,11'); +})(); diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" (class expression).js" "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" (class expression).js" new file mode 100644 index 000000000000..a18e9c2c7a91 --- /dev/null +++ "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" (class expression).js" @@ -0,0 +1,37 @@ +(() => { + const log = []; + const dummy = () => { }; + const ctx = { + foo(n) { + log.push(n); + } + }; + function wrapper() { + ( + @(assertEq(() => this.foo(0), undefined), dummy) + class extends (assertEq(() => this.foo(1), undefined), Object) { + @(assertEq(() => this.foo(2), undefined), dummy) + method() { } + @(assertEq(() => this.foo(3), undefined), dummy) + static method() { } + @(assertEq(() => this.foo(4), undefined), dummy) + field; + @(assertEq(() => this.foo(5), undefined), dummy) + static field; + @(assertEq(() => this.foo(6), undefined), dummy) + get getter() { return; } + @(assertEq(() => this.foo(7), undefined), dummy) + static get getter() { return; } + @(assertEq(() => this.foo(8), undefined), dummy) + set setter(x) { } + @(assertEq(() => this.foo(9), undefined), dummy) + static set setter(x) { } + @(assertEq(() => this.foo(10), undefined), dummy) + accessor accessor; + @(assertEq(() => this.foo(11), undefined), dummy) + static accessor accessor; + }); + } + wrapper.call(ctx); + assertEq(() => '' + log, '0,1,2,3,4,5,6,7,8,9,10,11'); +})(); diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" (class statement).js" "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" (class statement).js" new file mode 100644 index 000000000000..5e785ce06bf6 --- /dev/null +++ "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" (class statement).js" @@ -0,0 +1,36 @@ +(() => { + const log = []; + const dummy = () => { }; + const ctx = { + foo(n) { + log.push(n); + } + }; + function wrapper() { + @(assertEq(() => this.foo(0), undefined), dummy) + class Foo extends (assertEq(() => this.foo(1), undefined), Object) { + @(assertEq(() => this.foo(2), undefined), dummy) + method() { } + @(assertEq(() => this.foo(3), undefined), dummy) + static method() { } + @(assertEq(() => this.foo(4), undefined), dummy) + field; + @(assertEq(() => this.foo(5), undefined), dummy) + static field; + @(assertEq(() => this.foo(6), undefined), dummy) + get getter() { return; } + @(assertEq(() => this.foo(7), undefined), dummy) + static get getter() { return; } + @(assertEq(() => this.foo(8), undefined), dummy) + set setter(x) { } + @(assertEq(() => this.foo(9), undefined), dummy) + static set setter(x) { } + @(assertEq(() => this.foo(10), undefined), dummy) + accessor accessor; + @(assertEq(() => this.foo(11), undefined), dummy) + static accessor accessor; + } + } + wrapper.call(ctx); + assertEq(() => '' + log, '0,1,2,3,4,5,6,7,8,9,10,11'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding (class expression).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding (class expression).js new file mode 100644 index 000000000000..4079ebc6fbc1 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding (class expression).js @@ -0,0 +1,44 @@ +(() => { + const fns = []; + const capture = (fn) => { + fns.push(fn); + return () => { }; + }; + const originalFoo = ( + @(capture(() => Foo)) + class Foo { + @(capture(() => Foo)) + method() { } + @(capture(() => Foo)) + static method() { } + @(capture(() => Foo)) + field; + @(capture(() => Foo)) + static field; + @(capture(() => Foo)) + get getter() { return; } + @(capture(() => Foo)) + static get getter() { return; } + @(capture(() => Foo)) + set setter(x) { } + @(capture(() => Foo)) + static set setter(x) { } + @(capture(() => Foo)) + accessor accessor; + @(capture(() => Foo)) + static accessor accessor; + }); + // Decorators on the class itself should reference a global called "Foo", + // which should still be a reference error. This is because a class + // expression runs "DecoratorListEvaluation" in the outer environment and + // then passes the evaluated decorators to "ClassDefinitionEvaluation". + const firstFn = fns.shift(); + assertThrows(() => firstFn(), ReferenceError); + // All other decorators should reference the classBinding called "Foo", + // which should now be initialized. This is because all other decorators + // are evaluated within "ClassDefinitionEvaluation" while the running + // execution context's environment is the nested class environment. + for (const fn of fns) { + assertEq(() => fn(), originalFoo); + } +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding (class statement).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding (class statement).js new file mode 100644 index 000000000000..52a855d73298 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding (class statement).js @@ -0,0 +1,61 @@ +(() => { + const fns = []; + const capture = (fn) => { + fns.push(fn); + // Note: As far as I can tell, early reference to the class name should + // throw a reference error because: + // + // 1. Class decorators run first in the top-level scope before entering + // BindingClassDeclarationEvaluation. + // + // 2. Class element decorators run in ClassDefinitionEvaluation, which + // runs ClassElementEvaluation for each class element before eventually + // running classEnv.InitializeBinding(classBinding, F). + // + assertThrows(() => fn(), ReferenceError); + return () => { }; + }; + @(capture(() => Foo)) + class Foo { + @(capture(() => Foo)) + method() { } + @(capture(() => Foo)) + static method() { } + @(capture(() => Foo)) + field; + @(capture(() => Foo)) + static field; + @(capture(() => Foo)) + get getter() { return; } + @(capture(() => Foo)) + static get getter() { return; } + @(capture(() => Foo)) + set setter(x) { } + @(capture(() => Foo)) + static set setter(x) { } + @(capture(() => Foo)) + accessor accessor; + @(capture(() => Foo)) + static accessor accessor; + } + const originalFoo = Foo; + // Once we get here, these should all reference the now-initialized class, + // either through classBinding (for class element decorators) or through + // className (for decorators on the class itself). + for (const fn of fns) { + assertEq(() => fn(), originalFoo); + } + // Mutating a class binding is allowed in JavaScript. Let's test what + // happens when we do this. + Foo = null; + // As far as I can tell, class decorators should observe this change because + // they are evaluated in the top-level scope. + const firstFn = fns.shift(); + assertEq(() => firstFn(), null); + // But I believe class element decorators should not observe this change + // because they are evaluated in the environment that exists for the + // duration of ClassDefinitionEvaluation (i.e. classEnv, not env). + for (const fn of fns) { + assertEq(() => fn(), originalFoo); + } +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names (class expression).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names (class expression).js new file mode 100644 index 000000000000..b49082e56f5c --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names (class expression).js @@ -0,0 +1,39 @@ +(() => { + const log = []; + const foo = (n) => { + log.push(n); + return () => { }; + }; + const computed = { + get method() { log.push(log.length); return Symbol('method'); }, + get field() { log.push(log.length); return Symbol('field'); }, + get getter() { log.push(log.length); return Symbol('getter'); }, + get setter() { log.push(log.length); return Symbol('setter'); }, + get accessor() { log.push(log.length); return Symbol('accessor'); }, + }; + ( + @foo(0) + class extends (foo(1), Object) { + @foo(2) + [computed.method]() { } + @foo(4) + static [computed.method]() { } + @foo(6) + [computed.field]; + @foo(8) + static [computed.field]; + @foo(10) + get [computed.getter]() { return; } + @foo(12) + static get [computed.getter]() { return; } + @foo(14) + set [computed.setter](x) { } + @foo(16) + static set [computed.setter](x) { } + @foo(18) + accessor [computed.accessor]; + @foo(20) + static accessor [computed.accessor]; + }); + assertEq(() => '' + log, '0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names (class statement).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names (class statement).js new file mode 100644 index 000000000000..6c06f5204498 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names (class statement).js @@ -0,0 +1,38 @@ +(() => { + const log = []; + const foo = (n) => { + log.push(n); + return () => { }; + }; + const computed = { + get method() { log.push(log.length); return Symbol('method'); }, + get field() { log.push(log.length); return Symbol('field'); }, + get getter() { log.push(log.length); return Symbol('getter'); }, + get setter() { log.push(log.length); return Symbol('setter'); }, + get accessor() { log.push(log.length); return Symbol('accessor'); }, + }; + @foo(0) + class Foo extends (foo(1), Object) { + @foo(2) + [computed.method]() { } + @foo(4) + static [computed.method]() { } + @foo(6) + [computed.field]; + @foo(8) + static [computed.field]; + @foo(10) + get [computed.getter]() { return; } + @foo(12) + static get [computed.getter]() { return; } + @foo(14) + set [computed.setter](x) { } + @foo(16) + static set [computed.setter](x) { } + @foo(18) + accessor [computed.accessor]; + @foo(20) + static accessor [computed.accessor]; + } + assertEq(() => '' + log, '0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name (class expression).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name (class expression).js new file mode 100644 index 000000000000..0c6205a298c0 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name (class expression).js @@ -0,0 +1,48 @@ +(() => { + const fns = []; + const capture = (fn) => { + fns.push(fn); + return () => { }; + }; + class Outer { + static #foo = 0; + static { + ( + @(capture(() => Outer.#foo + 0)) + class Foo { + #foo = 10; + @(capture(() => new Foo().#foo + 1)) + method() { } + @(capture(() => new Foo().#foo + 2)) + static method() { } + @(capture(() => new Foo().#foo + 3)) + field; + @(capture(() => new Foo().#foo + 4)) + static field; + @(capture(() => new Foo().#foo + 5)) + get getter() { return; } + @(capture(() => new Foo().#foo + 6)) + static get getter() { return; } + @(capture(() => new Foo().#foo + 7)) + set setter(x) { } + @(capture(() => new Foo().#foo + 8)) + static set setter(x) { } + @(capture(() => new Foo().#foo + 9)) + accessor accessor; + @(capture(() => new Foo().#foo + 10)) + static accessor accessor; + }); + } + } + // Accessing the outer "#foo" on "Outer" from within the class decorator + // should succeed. Class decorators are evaluated in the outer private + // environment before entering "ClassDefinitionEvaluation". + // + // Accessing the inner "#foo" on "Foo" from within any of the class element + // decorators should also succeed. Class element decorators are evaluated + // in the inner private environment inside "ClassDefinitionEvaluation". + const log = []; + for (const fn of fns) + log.push(fn()); + assertEq(() => '' + log, '0,11,12,13,14,15,16,17,18,19,20'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name (class statement).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name (class statement).js new file mode 100644 index 000000000000..4d60f789fde3 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name (class statement).js @@ -0,0 +1,56 @@ +(() => { + const fns = []; + const capture = (fn) => { + fns.push(fn); + return () => { }; + }; + class Dummy { + static #foo = NaN; + static { + @(capture(() => new Foo().#foo + 0)) + class Foo { + #foo = 10; + @(capture(() => new Foo().#foo + 1)) + method() { } + @(capture(() => new Foo().#foo + 2)) + static method() { } + @(capture(() => new Foo().#foo + 3)) + field; + @(capture(() => new Foo().#foo + 4)) + static field; + @(capture(() => new Foo().#foo + 5)) + get getter() { return; } + @(capture(() => new Foo().#foo + 6)) + static get getter() { return; } + @(capture(() => new Foo().#foo + 7)) + set setter(x) { } + @(capture(() => new Foo().#foo + 8)) + static set setter(x) { } + @(capture(() => new Foo().#foo + 9)) + accessor accessor; + @(capture(() => new Foo().#foo + 10)) + static accessor accessor; + } + } + } + // Accessing "#foo" in the class decorator should fail. The "#foo" should + // refer to the outer "#foo", not the inner "#foo". + const firstFn = fns.shift(); + assertEq(() => { + try { + firstFn(); + throw new Error('Expected a TypeError to be thrown'); + } + catch (err) { + if (err instanceof TypeError) + return true; + throw err; + } + }, true); + // Accessing "#foo" from any of the class element decorators should succeed. + // Each "#foo" should refer to the inner "#foo", not the outer "#foo". + const log = []; + for (const fn of fns) + log.push(fn()); + assertEq(() => '' + log, '11,12,13,14,15,16,17,18,19,20'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name (class expression).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name (class expression).js new file mode 100644 index 000000000000..b09a167b053c --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name (class expression).js @@ -0,0 +1,37 @@ +(() => { + const log = []; + class Dummy { + static #foo(n) { + log.push(n); + return () => { }; + } + static { + const dummy = this; + ( + @(dummy.#foo(0)) + class extends (dummy.#foo(1), Object) { + @(dummy.#foo(2)) + method() { } + @(dummy.#foo(3)) + static method() { } + @(dummy.#foo(4)) + field; + @(dummy.#foo(5)) + static field; + @(dummy.#foo(6)) + get getter() { return; } + @(dummy.#foo(7)) + static get getter() { return; } + @(dummy.#foo(8)) + set setter(x) { } + @(dummy.#foo(9)) + static set setter(x) { } + @(dummy.#foo(10)) + accessor accessor; + @(dummy.#foo(11)) + static accessor accessor; + }); + } + } + assertEq(() => '' + log, '0,1,2,3,4,5,6,7,8,9,10,11'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name (class statement).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name (class statement).js new file mode 100644 index 000000000000..903bba491ed7 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name (class statement).js @@ -0,0 +1,36 @@ +(() => { + const log = []; + class Dummy { + static #foo(n) { + log.push(n); + return () => { }; + } + static { + const dummy = this; + @(dummy.#foo(0)) + class Foo extends (dummy.#foo(1), Object) { + @(dummy.#foo(2)) + method() { } + @(dummy.#foo(3)) + static method() { } + @(dummy.#foo(4)) + field; + @(dummy.#foo(5)) + static field; + @(dummy.#foo(6)) + get getter() { return; } + @(dummy.#foo(7)) + static get getter() { return; } + @(dummy.#foo(8)) + set setter(x) { } + @(dummy.#foo(9)) + static set setter(x) { } + @(dummy.#foo(10)) + accessor accessor; + @(dummy.#foo(11)) + static accessor accessor; + } + } + } + assertEq(() => '' + log, '0,1,2,3,4,5,6,7,8,9,10,11'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator metadata: class expression.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator metadata: class expression.js new file mode 100644 index 000000000000..2ae6a13e71c7 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator metadata: class expression.js @@ -0,0 +1,68 @@ +(() => { + let counter = 0; + const dec = (_, ctx) => { + ctx.metadata[ctx.name] = counter++; + }; + const Foo = + @dec + class { + @dec + instanceField; + @dec + accessor instanceAccessor; + @dec + instanceMethod() { } + @dec + get instanceGetter() { return; } + @dec + set instanceSetter(_) { } + @dec + static staticField; + @dec + static accessor staticAccessor; + @dec + static staticMethod() { } + @dec + static get staticGetter() { return; } + @dec + static set staticSetter(_) { } + }, Bar = + @dec + class extends Foo { + @dec + #instanceField; + @dec + accessor #instanceAccessor; + @dec + #instanceMethod() { } + @dec + get #instanceGetter() { return; } + @dec + set #instanceSetter(_) { } + @dec + static #staticField; + @dec + static accessor #staticAccessor; + @dec + static #staticMethod() { } + @dec + static get #staticGetter() { return; } + @dec + static set #staticSetter(_) { } + }; + const order = (meta) => '' + [ + meta['staticAccessor'], meta['staticMethod'], meta['staticGetter'], meta['staticSetter'], + meta['#staticAccessor'], meta['#staticMethod'], meta['#staticGetter'], meta['#staticSetter'], + meta['instanceAccessor'], meta['instanceMethod'], meta['instanceGetter'], meta['instanceSetter'], + meta['#instanceAccessor'], meta['#instanceMethod'], meta['#instanceGetter'], meta['#instanceSetter'], + meta['staticField'], meta['#staticField'], + meta['instanceField'], meta['#instanceField'], + meta['Foo'], meta['Bar'], + ]; + const foo = Foo[Symbol.metadata]; + const bar = Bar[Symbol.metadata]; + assertEq(() => order(foo), '0,1,2,3,,,,,4,5,6,7,,,,,8,,9,,10,'); + assertEq(() => Object.getPrototypeOf(foo), null); + assertEq(() => order(bar), '0,1,2,3,11,12,13,14,4,5,6,7,15,16,17,18,8,19,9,20,10,21'); + assertEq(() => Object.getPrototypeOf(bar), foo); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator metadata: class statement.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator metadata: class statement.js new file mode 100644 index 000000000000..a22966c5cc9e --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator metadata: class statement.js @@ -0,0 +1,67 @@ +(() => { + let counter = 0; + const dec = (_, ctx) => { + ctx.metadata[ctx.name] = counter++; + }; + @dec + class Foo { + @dec + instanceField; + @dec + accessor instanceAccessor; + @dec + instanceMethod() { } + @dec + get instanceGetter() { return; } + @dec + set instanceSetter(_) { } + @dec + static staticField; + @dec + static accessor staticAccessor; + @dec + static staticMethod() { } + @dec + static get staticGetter() { return; } + @dec + static set staticSetter(_) { } + } + @dec + class Bar extends Foo { + @dec + #instanceField; + @dec + accessor #instanceAccessor; + @dec + #instanceMethod() { } + @dec + get #instanceGetter() { return; } + @dec + set #instanceSetter(_) { } + @dec + static #staticField; + @dec + static accessor #staticAccessor; + @dec + static #staticMethod() { } + @dec + static get #staticGetter() { return; } + @dec + static set #staticSetter(_) { } + } + const order = (meta) => '' + [ + meta['staticAccessor'], meta['staticMethod'], meta['staticGetter'], meta['staticSetter'], + meta['#staticAccessor'], meta['#staticMethod'], meta['#staticGetter'], meta['#staticSetter'], + meta['instanceAccessor'], meta['instanceMethod'], meta['instanceGetter'], meta['instanceSetter'], + meta['#instanceAccessor'], meta['#instanceMethod'], meta['#instanceGetter'], meta['#instanceSetter'], + meta['staticField'], meta['#staticField'], + meta['instanceField'], meta['#instanceField'], + meta['Foo'], meta['Bar'], + ]; + const foo = Foo[Symbol.metadata]; + const bar = Bar[Symbol.metadata]; + assertEq(() => order(foo), '0,1,2,3,,,,,4,5,6,7,,,,,8,,9,,10,'); + assertEq(() => Object.getPrototypeOf(foo), null); + assertEq(() => order(bar), '0,1,2,3,11,12,13,14,4,5,6,7,15,16,17,18,8,19,9,20,10,21'); + assertEq(() => Object.getPrototypeOf(bar), foo); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (instance field).js new file mode 100644 index 000000000000..19180398e19d --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (instance field).js @@ -0,0 +1,30 @@ +(() => { + const dec = (key) => (value, ctx) => { + assertEq(() => value, undefined); + assertEq(() => ctx.kind, 'field'); + assertEq(() => ctx.name, key); + assertEq(() => ctx.static, false); + assertEq(() => ctx.private, false); + assertEq(() => ctx.access.has({ [key]: false }), true); + assertEq(() => ctx.access.has({ bar: true }), false); + assertEq(() => ctx.access.get({ [key]: 123 }), 123); + assertEq(() => { + const obj = {}; + ctx.access.set(obj, 321); + return obj[key]; + }, 321); + }; + const bar = Symbol('bar'); + const baz = Symbol(); + class Foo { + @dec('foo') + foo = 123; + @dec(bar) + [bar] = 123; + @dec(baz) + [baz] = 123; + } + assertEq(() => new Foo().foo, 123); + assertEq(() => new Foo()[bar], 123); + assertEq(() => new Foo()[baz], 123); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (private instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (private instance field).js new file mode 100644 index 000000000000..38902bb664ae --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (private instance field).js @@ -0,0 +1,28 @@ +(() => { + let lateAsserts; + const dec = (value, ctx) => { + assertEq(() => value, undefined); + assertEq(() => ctx.kind, 'field'); + assertEq(() => ctx.name, '#foo'); + assertEq(() => ctx.static, false); + assertEq(() => ctx.private, true); + lateAsserts = () => { + assertEq(() => ctx.access.has(new Foo), true); + assertEq(() => ctx.access.has({}), false); + assertEq(() => ctx.access.get(new Foo), 123); + assertEq(() => { + const obj = new Foo; + ctx.access.set(obj, 321); + return get$foo(obj); + }, 321); + }; + }; + let get$foo; + class Foo { + @dec + #foo = 123; + static { get$foo = x => x.#foo; } + } + assertEq(() => get$foo(new Foo()), 123); + lateAsserts(); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (private static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (private static field).js new file mode 100644 index 000000000000..62db24be1ad3 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (private static field).js @@ -0,0 +1,27 @@ +(() => { + let lateAsserts; + const dec = (value, ctx) => { + assertEq(() => value, undefined); + assertEq(() => ctx.kind, 'field'); + assertEq(() => ctx.name, '#foo'); + assertEq(() => ctx.static, true); + assertEq(() => ctx.private, true); + lateAsserts = () => { + assertEq(() => ctx.access.has(Foo), true); + assertEq(() => ctx.access.has({}), false); + assertEq(() => ctx.access.get(Foo), 123); + assertEq(() => { + ctx.access.set(Foo, 321); + return get$foo(Foo); + }, 321); + }; + }; + let get$foo; + class Foo { + @dec + static #foo = 123; + static { get$foo = x => x.#foo; } + } + assertEq(() => get$foo(Foo), 123); + lateAsserts(); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (static field).js new file mode 100644 index 000000000000..eb12daaca8e3 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (static field).js @@ -0,0 +1,30 @@ +(() => { + const dec = (key) => (value, ctx) => { + assertEq(() => value, undefined); + assertEq(() => ctx.kind, 'field'); + assertEq(() => ctx.name, key); + assertEq(() => ctx.static, true); + assertEq(() => ctx.private, false); + assertEq(() => ctx.access.has({ [key]: false }), true); + assertEq(() => ctx.access.has({ bar: true }), false); + assertEq(() => ctx.access.get({ [key]: 123 }), 123); + assertEq(() => { + const obj = {}; + ctx.access.set(obj, 321); + return obj[key]; + }, 321); + }; + const bar = Symbol('bar'); + const baz = Symbol(); + class Foo { + @dec('foo') + static foo = 123; + @dec(bar) + static [bar] = 123; + @dec(baz) + static [baz] = 123; + } + assertEq(() => Foo.foo, 123); + assertEq(() => Foo[bar], 123); + assertEq(() => Foo[baz], 123); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (instance field).js new file mode 100644 index 000000000000..3962bb28f154 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (instance field).js @@ -0,0 +1,22 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (value, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + foo; + } + assertEq(() => got, undefined); + const instance = new Foo; + assertEq(() => got.this, instance); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (private instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (private instance field).js new file mode 100644 index 000000000000..9aee827fc87e --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (private instance field).js @@ -0,0 +1,22 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (value, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + #foo; + } + assertEq(() => got, undefined); + const instance = new Foo; + assertEq(() => got.this, instance); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (private static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (private static field).js new file mode 100644 index 000000000000..6c9796fcdd1a --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (private static field).js @@ -0,0 +1,20 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (value, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + static #foo; + } + assertEq(() => got.this, Foo); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (static field).js new file mode 100644 index 000000000000..0c1ba27f49e6 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (static field).js @@ -0,0 +1,20 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (value, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + static foo; + } + assertEq(() => got.this, Foo); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (instance field).js new file mode 100644 index 000000000000..d770f0b71fd3 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (instance field).js @@ -0,0 +1,22 @@ +(() => { + const log = []; + const dec1 = (value, ctx) => { + log.push(2); + return () => log.push(4); + }; + const dec2 = (value, ctx) => { + log.push(1); + return () => log.push(5); + }; + log.push(0); + class Foo { + @dec1 + @dec2 + foo = 123; + } + log.push(3); + var obj = new Foo(); + log.push(6); + assertEq(() => obj.foo, 6); + assertEq(() => log + '', '0,1,2,3,4,5,6'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (private instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (private instance field).js new file mode 100644 index 000000000000..59446c3dbf3b --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (private instance field).js @@ -0,0 +1,24 @@ +(() => { + const log = []; + const dec1 = (value, ctx) => { + log.push(2); + return () => log.push(4); + }; + const dec2 = (value, ctx) => { + log.push(1); + return () => log.push(5); + }; + log.push(0); + let get$foo; + class Foo { + @dec1 + @dec2 + #foo = 123; + static { get$foo = x => x.#foo; } + } + log.push(3); + var obj = new Foo(); + log.push(6); + assertEq(() => get$foo(obj), 6); + assertEq(() => log + '', '0,1,2,3,4,5,6'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (private static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (private static field).js new file mode 100644 index 000000000000..2b1f36ef891d --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (private static field).js @@ -0,0 +1,22 @@ +(() => { + const log = []; + const dec1 = (value, ctx) => { + log.push(2); + return () => log.push(3); + }; + const dec2 = (value, ctx) => { + log.push(1); + return () => log.push(4); + }; + log.push(0); + let get$foo; + class Foo { + @dec1 + @dec2 + static #foo = 123; + static { get$foo = x => x.#foo; } + } + log.push(5); + assertEq(() => get$foo(Foo), 5); + assertEq(() => log + '', '0,1,2,3,4,5'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (static field).js new file mode 100644 index 000000000000..0103d970aeaf --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (static field).js @@ -0,0 +1,20 @@ +(() => { + const log = []; + const dec1 = (value, ctx) => { + log.push(2); + return () => log.push(3); + }; + const dec2 = (value, ctx) => { + log.push(1); + return () => log.push(4); + }; + log.push(0); + class Foo { + @dec1 + @dec2 + static foo = 123; + } + log.push(5); + assertEq(() => Foo.foo, 5); + assertEq(() => log + '', '0,1,2,3,4,5'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (instance field).js new file mode 100644 index 000000000000..936ac4ed5f14 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (instance field).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (value, ctx) => { + return null; + }; + class Foo { + @dec + foo; + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (private instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (private instance field).js new file mode 100644 index 000000000000..52625cdd3bb0 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (private instance field).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (value, ctx) => { + return null; + }; + class Foo { + @dec + #foo; + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (private static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (private static field).js new file mode 100644 index 000000000000..5c1c5ede84d2 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (private static field).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (value, ctx) => { + return null; + }; + class Foo { + @dec + static #foo; + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (static field).js new file mode 100644 index 000000000000..e1d5edca178d --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (static field).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (value, ctx) => { + return null; + }; + class Foo { + @dec + static foo; + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (instance field).js new file mode 100644 index 000000000000..2e16b5f705ca --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (instance field).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (value, ctx) => { + return {}; + }; + class Foo { + @dec + foo; + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (private instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (private instance field).js new file mode 100644 index 000000000000..e201aa0ccc07 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (private instance field).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (value, ctx) => { + return {}; + }; + class Foo { + @dec + #foo; + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (private static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (private static field).js new file mode 100644 index 000000000000..5c5df184878a --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (private static field).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (value, ctx) => { + return {}; + }; + class Foo { + @dec + static #foo; + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (static field).js new file mode 100644 index 000000000000..a3d9e962daeb --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (static field).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (value, ctx) => { + return {}; + }; + class Foo { + @dec + static foo; + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (instance field).js new file mode 100644 index 000000000000..f459f8612455 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (instance field).js @@ -0,0 +1,20 @@ +(() => { + let log = []; + const dec = (value, ctx) => { + return function (x) { + assertEq(() => this instanceof Foo, true); + return log.push('foo' in this, 'bar' in this, x); + }; + }; + class Foo { + @dec + foo = 123; + @dec + bar; + } + assertEq(() => log + '', ''); + var obj = new Foo; + assertEq(() => obj.foo, 3); + assertEq(() => obj.bar, 6); + assertEq(() => log + '', 'false,false,123,true,false,'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (private instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (private instance field).js new file mode 100644 index 000000000000..e97311ccd3ba --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (private instance field).js @@ -0,0 +1,30 @@ +(() => { + let log = []; + const dec = (value, ctx) => { + return function (x) { + assertEq(() => this instanceof Foo, true); + return log.push(has$foo(this), has$bar(this), x); + }; + }; + let has$foo; + let has$bar; + let get$foo; + let get$bar; + class Foo { + @dec + #foo = 123; + @dec + #bar; + static { + has$foo = x => #foo in x; + has$bar = x => #bar in x; + get$foo = x => x.#foo; + get$bar = x => x.#bar; + } + } + assertEq(() => log + '', ''); + var obj = new Foo; + assertEq(() => get$foo(obj), 3); + assertEq(() => get$bar(obj), 6); + assertEq(() => log + '', 'false,false,123,true,false,'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (private static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (private static field).js new file mode 100644 index 000000000000..e124552fcbb8 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (private static field).js @@ -0,0 +1,31 @@ +(() => { + let foo; + let log = []; + const dec = (value, ctx) => { + return function (x) { + assertEq(() => this, foo); + return log.push(has$foo(this), has$bar(this), x); + }; + }; + assertEq(() => log + '', ''); + let has$foo; + let has$bar; + let get$foo; + let get$bar; + class Foo { + static { + foo = Foo; + has$foo = x => #foo in x; + has$bar = x => #bar in x; + get$foo = x => x.#foo; + get$bar = x => x.#bar; + } + @dec + static #foo = 123; + @dec + static #bar; + } + assertEq(() => get$foo(Foo), 3); + assertEq(() => get$bar(Foo), 6); + assertEq(() => log + '', 'false,false,123,true,false,'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (static field).js new file mode 100644 index 000000000000..116e66f4886b --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (static field).js @@ -0,0 +1,23 @@ +(() => { + let foo; + let log = []; + const dec = (value, ctx) => { + return function (x) { + assertEq(() => this, foo); + return log.push('foo' in this, 'bar' in this, x); + }; + }; + assertEq(() => log + '', ''); + class Foo { + static { + foo = Foo; + } + @dec + static foo = 123; + @dec + static bar; + } + assertEq(() => Foo.foo, 3); + assertEq(() => Foo.bar, 6); + assertEq(() => log + '', 'false,false,123,true,false,'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (instance getter).js new file mode 100644 index 000000000000..aa5fd98c355a --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (instance getter).js @@ -0,0 +1,28 @@ +(() => { + const dec = (key, name) => (fn, ctx) => { + assertEq(() => typeof fn, 'function'); + assertEq(() => fn.name, name); + assertEq(() => ctx.kind, 'getter'); + assertEq(() => ctx.name, key); + assertEq(() => ctx.static, false); + assertEq(() => ctx.private, false); + assertEq(() => ctx.access.has({ [key]: false }), true); + assertEq(() => ctx.access.has({ bar: true }), false); + assertEq(() => ctx.access.get({ [key]: 123 }), 123); + assertEq(() => 'set' in ctx.access, false); + }; + const bar = Symbol('bar'); + const baz = Symbol(); + class Foo { + bar = 123; + @dec('foo', 'get foo') + get foo() { return this.bar; } + @dec(bar, 'get [bar]') + get [bar]() { return this.bar; } + @dec(baz, 'get ') + get [baz]() { return this.bar; } + } + assertEq(() => new Foo().foo, 123); + assertEq(() => new Foo()[bar], 123); + assertEq(() => new Foo()[baz], 123); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (private instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (private instance getter).js new file mode 100644 index 000000000000..2698d776470f --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (private instance getter).js @@ -0,0 +1,26 @@ +(() => { + let lateAsserts; + const dec = (fn, ctx) => { + assertEq(() => typeof fn, 'function'); + assertEq(() => fn.name, 'get #foo'); + assertEq(() => ctx.kind, 'getter'); + assertEq(() => ctx.name, '#foo'); + assertEq(() => ctx.static, false); + assertEq(() => ctx.private, true); + lateAsserts = () => { + assertEq(() => ctx.access.has(new Foo), true); + assertEq(() => ctx.access.has({}), false); + assertEq(() => ctx.access.get(new Foo), 123); + assertEq(() => 'set' in ctx.access, false); + }; + }; + let get$foo; + class Foo { + #bar = 123; + @dec + get #foo() { return this.#bar; } + static { get$foo = x => x.#foo; } + } + assertEq(() => get$foo(new Foo), 123); + lateAsserts(); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (private static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (private static getter).js new file mode 100644 index 000000000000..3a94bb4c0994 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (private static getter).js @@ -0,0 +1,26 @@ +(() => { + let lateAsserts; + const dec = (fn, ctx) => { + assertEq(() => typeof fn, 'function'); + assertEq(() => fn.name, 'get #foo'); + assertEq(() => ctx.kind, 'getter'); + assertEq(() => ctx.name, '#foo'); + assertEq(() => ctx.static, true); + assertEq(() => ctx.private, true); + lateAsserts = () => { + assertEq(() => ctx.access.has(Foo), true); + assertEq(() => ctx.access.has({}), false); + assertEq(() => ctx.access.get(Foo), 123); + assertEq(() => 'set' in ctx.access, false); + }; + }; + let get$foo; + class Foo { + static #bar = 123; + @dec + static get #foo() { return this.#bar; } + static { get$foo = x => x.#foo; } + } + assertEq(() => get$foo(Foo), 123); + lateAsserts(); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (static getter).js new file mode 100644 index 000000000000..3d549643496b --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (static getter).js @@ -0,0 +1,28 @@ +(() => { + const dec = (key, name) => (fn, ctx) => { + assertEq(() => typeof fn, 'function'); + assertEq(() => fn.name, name); + assertEq(() => ctx.kind, 'getter'); + assertEq(() => ctx.name, key); + assertEq(() => ctx.static, true); + assertEq(() => ctx.private, false); + assertEq(() => ctx.access.has({ [key]: false }), true); + assertEq(() => ctx.access.has({ bar: true }), false); + assertEq(() => ctx.access.get({ [key]: 123 }), 123); + assertEq(() => 'set' in ctx.access, false); + }; + const bar = Symbol('bar'); + const baz = Symbol(); + class Foo { + static bar = 123; + @dec('foo', 'get foo') + static get foo() { return this.bar; } + @dec(bar, 'get [bar]') + static get [bar]() { return this.bar; } + @dec(baz, 'get ') + static get [baz]() { return this.bar; } + } + assertEq(() => Foo.foo, 123); + assertEq(() => Foo[bar], 123); + assertEq(() => Foo[baz], 123); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (instance getter).js new file mode 100644 index 000000000000..e3e62e6ab18e --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (instance getter).js @@ -0,0 +1,22 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (fn, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + get foo() { return; } + } + assertEq(() => got, undefined); + const instance = new Foo; + assertEq(() => got.this, instance); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (private instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (private instance getter).js new file mode 100644 index 000000000000..4feeb1e326c8 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (private instance getter).js @@ -0,0 +1,22 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (fn, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + get #foo() { return; } + } + assertEq(() => got, undefined); + const instance = new Foo; + assertEq(() => got.this, instance); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (private static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (private static getter).js new file mode 100644 index 000000000000..c774cd00ee5f --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (private static getter).js @@ -0,0 +1,20 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (fn, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + static get #foo() { return; } + } + assertEq(() => got.this, Foo); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (static getter).js new file mode 100644 index 000000000000..2d533496e9d5 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (static getter).js @@ -0,0 +1,20 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (fn, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + static get foo() { return; } + } + assertEq(() => got.this, Foo); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (instance getter).js new file mode 100644 index 000000000000..ef3ff15126da --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (instance getter).js @@ -0,0 +1,32 @@ +(() => { + const log = []; + let bar; + let baz; + const dec1 = (fn, ctx) => { + log.push(2); + bar = function () { + log.push(4); + return fn.call(this); + }; + return bar; + }; + const dec2 = (fn, ctx) => { + log.push(1); + baz = function () { + log.push(5); + return fn.call(this); + }; + return baz; + }; + log.push(0); + class Foo { + @dec1 + @dec2 + get foo() { return log.push(6); } + } + log.push(3); + new Foo().foo; + log.push(7); + assertEq(() => Object.getOwnPropertyDescriptor(Foo.prototype, 'foo').get, bar); + assertEq(() => log + '', '0,1,2,3,4,5,6,7'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (private instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (private instance getter).js new file mode 100644 index 000000000000..ff7c43aa2d63 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (private instance getter).js @@ -0,0 +1,33 @@ +(() => { + const log = []; + let bar; + let baz; + const dec1 = (fn, ctx) => { + log.push(2); + bar = function () { + log.push(4); + return fn.call(this); + }; + return bar; + }; + const dec2 = (fn, ctx) => { + log.push(1); + baz = function () { + log.push(5); + return fn.call(this); + }; + return baz; + }; + log.push(0); + let get$foo; + class Foo { + @dec1 + @dec2 + get #foo() { return log.push(6); } + static { get$foo = x => x.#foo; } + } + log.push(3); + assertEq(() => get$foo(new Foo), 7); + log.push(7); + assertEq(() => log + '', '0,1,2,3,4,5,6,7'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (private static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (private static getter).js new file mode 100644 index 000000000000..861852a6c9f8 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (private static getter).js @@ -0,0 +1,33 @@ +(() => { + const log = []; + let bar; + let baz; + const dec1 = (fn, ctx) => { + log.push(2); + bar = function () { + log.push(4); + return fn.call(this); + }; + return bar; + }; + const dec2 = (fn, ctx) => { + log.push(1); + baz = function () { + log.push(5); + return fn.call(this); + }; + return baz; + }; + log.push(0); + let get$foo; + class Foo { + @dec1 + @dec2 + static get #foo() { return log.push(6); } + static { get$foo = x => x.#foo; } + } + log.push(3); + assertEq(() => get$foo(Foo), 7); + log.push(7); + assertEq(() => log + '', '0,1,2,3,4,5,6,7'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (static getter).js new file mode 100644 index 000000000000..29f0f90f8801 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (static getter).js @@ -0,0 +1,32 @@ +(() => { + const log = []; + let bar; + let baz; + const dec1 = (fn, ctx) => { + log.push(2); + bar = function () { + log.push(4); + return fn.call(this); + }; + return bar; + }; + const dec2 = (fn, ctx) => { + log.push(1); + baz = function () { + log.push(5); + return fn.call(this); + }; + return baz; + }; + log.push(0); + class Foo { + @dec1 + @dec2 + static get foo() { return log.push(6); } + } + log.push(3); + Foo.foo; + log.push(7); + assertEq(() => Object.getOwnPropertyDescriptor(Foo, 'foo').get, bar); + assertEq(() => log + '', '0,1,2,3,4,5,6,7'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (instance getter).js new file mode 100644 index 000000000000..4f2df4d392ef --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (instance getter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return null; + }; + class Foo { + @dec + get foo() { return; } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (private instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (private instance getter).js new file mode 100644 index 000000000000..d1e7b205bc13 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (private instance getter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return null; + }; + class Foo { + @dec + get #foo() { return; } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (private static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (private static getter).js new file mode 100644 index 000000000000..ef2ccb0680c2 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (private static getter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return null; + }; + class Foo { + @dec + static get #foo() { return; } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (static getter).js new file mode 100644 index 000000000000..bca6a2cf9bf3 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (static getter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return null; + }; + class Foo { + @dec + static get foo() { return; } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (instance getter).js new file mode 100644 index 000000000000..8087828e5cf1 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (instance getter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return {}; + }; + class Foo { + @dec + get foo() { return; } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (private instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (private instance getter).js new file mode 100644 index 000000000000..429407be8cbc --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (private instance getter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return {}; + }; + class Foo { + @dec + get #foo() { return; } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (private static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (private static getter).js new file mode 100644 index 000000000000..6956949fa69e --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (private static getter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return {}; + }; + class Foo { + @dec + static get #foo() { return; } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (static getter).js new file mode 100644 index 000000000000..4b8b060d934f --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (static getter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return {}; + }; + class Foo { + @dec + static get foo() { return; } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (instance getter).js new file mode 100644 index 000000000000..247f431364fe --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (instance getter).js @@ -0,0 +1,14 @@ +(() => { + let bar; + const dec = (fn, ctx) => { + bar = function () { return fn.call(this) + 1; }; + return bar; + }; + class Foo { + bar = 123; + @dec + get foo() { return this.bar; } + } + assertEq(() => Object.getOwnPropertyDescriptor(Foo.prototype, 'foo').get, bar); + assertEq(() => new Foo().foo, 124); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (private instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (private instance getter).js new file mode 100644 index 000000000000..a8cc55efb647 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (private instance getter).js @@ -0,0 +1,15 @@ +(() => { + let bar; + const dec = (fn, ctx) => { + bar = function () { return fn.call(this) + 1; }; + return bar; + }; + let get$foo; + class Foo { + #bar = 123; + @dec + get #foo() { return this.#bar; } + static { get$foo = x => x.#foo; } + } + assertEq(() => get$foo(new Foo), 124); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (private static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (private static getter).js new file mode 100644 index 000000000000..9e3902d1eae0 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (private static getter).js @@ -0,0 +1,15 @@ +(() => { + let bar; + const dec = (fn, ctx) => { + bar = function () { return fn.call(this) + 1; }; + return bar; + }; + let get$foo; + class Foo { + static #bar = 123; + @dec + static get #foo() { return this.#bar; } + static { get$foo = x => x.#foo; } + } + assertEq(() => get$foo(Foo), 124); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (static getter).js new file mode 100644 index 000000000000..741b65b6aeb1 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (static getter).js @@ -0,0 +1,14 @@ +(() => { + let bar; + const dec = (fn, ctx) => { + bar = function () { return fn.call(this) + 1; }; + return bar; + }; + class Foo { + static bar = 123; + @dec + static get foo() { return this.bar; } + } + assertEq(() => Object.getOwnPropertyDescriptor(Foo, 'foo').get, bar); + assertEq(() => Foo.foo, 124); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (private members, class expression).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (private members, class expression).js new file mode 100644 index 000000000000..87730184c184 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (private members, class expression).js @@ -0,0 +1,236 @@ +(() => { + const log = []; + // Class decorators + const classDec1 = (cls, ctxClass) => { + log.push('c2'); + if (!assertEq(() => typeof ctxClass.addInitializer, 'function')) + return; + ctxClass.addInitializer(() => log.push('c5')); + ctxClass.addInitializer(() => log.push('c6')); + }; + const classDec2 = (cls, ctxClass) => { + log.push('c1'); + if (!assertEq(() => typeof ctxClass.addInitializer, 'function')) + return; + ctxClass.addInitializer(() => log.push('c3')); + ctxClass.addInitializer(() => log.push('c4')); + }; + // Method decorators + const methodDec1 = (fn, ctxMethod) => { + log.push('m2'); + if (!assertEq(() => typeof ctxMethod.addInitializer, 'function')) + return; + ctxMethod.addInitializer(() => log.push('m5')); + ctxMethod.addInitializer(() => log.push('m6')); + }; + const methodDec2 = (fn, ctxMethod) => { + log.push('m1'); + if (!assertEq(() => typeof ctxMethod.addInitializer, 'function')) + return; + ctxMethod.addInitializer(() => log.push('m3')); + ctxMethod.addInitializer(() => log.push('m4')); + }; + const staticMethodDec1 = (fn, ctxStaticMethod) => { + log.push('M2'); + if (!assertEq(() => typeof ctxStaticMethod.addInitializer, 'function')) + return; + ctxStaticMethod.addInitializer(() => log.push('M5')); + ctxStaticMethod.addInitializer(() => log.push('M6')); + }; + const staticMethodDec2 = (fn, ctxStaticMethod) => { + log.push('M1'); + if (!assertEq(() => typeof ctxStaticMethod.addInitializer, 'function')) + return; + ctxStaticMethod.addInitializer(() => log.push('M3')); + ctxStaticMethod.addInitializer(() => log.push('M4')); + }; + // Field decorators + const fieldDec1 = (value, ctxField) => { + log.push('f2'); + if (!assertEq(() => typeof ctxField.addInitializer, 'function')) + return; + ctxField.addInitializer(() => log.push('f5')); + ctxField.addInitializer(() => log.push('f6')); + return () => { log.push('f7'); }; + }; + const fieldDec2 = (value, ctxField) => { + log.push('f1'); + if (!assertEq(() => typeof ctxField.addInitializer, 'function')) + return; + ctxField.addInitializer(() => log.push('f3')); + ctxField.addInitializer(() => log.push('f4')); + return () => { log.push('f8'); }; + }; + const staticFieldDec1 = (value, ctxStaticField) => { + log.push('F2'); + if (!assertEq(() => typeof ctxStaticField.addInitializer, 'function')) + return; + ctxStaticField.addInitializer(() => log.push('F5')); + ctxStaticField.addInitializer(() => log.push('F6')); + return () => { log.push('F7'); }; + }; + const staticFieldDec2 = (value, ctxStaticField) => { + log.push('F1'); + if (!assertEq(() => typeof ctxStaticField.addInitializer, 'function')) + return; + ctxStaticField.addInitializer(() => log.push('F3')); + ctxStaticField.addInitializer(() => log.push('F4')); + return () => { log.push('F8'); }; + }; + // Getter decorators + const getterDec1 = (fn, ctxGetter) => { + log.push('g2'); + if (!assertEq(() => typeof ctxGetter.addInitializer, 'function')) + return; + ctxGetter.addInitializer(() => log.push('g5')); + ctxGetter.addInitializer(() => log.push('g6')); + }; + const getterDec2 = (fn, ctxGetter) => { + log.push('g1'); + if (!assertEq(() => typeof ctxGetter.addInitializer, 'function')) + return; + ctxGetter.addInitializer(() => log.push('g3')); + ctxGetter.addInitializer(() => log.push('g4')); + }; + const staticGetterDec1 = (fn, ctxStaticGetter) => { + log.push('G2'); + if (!assertEq(() => typeof ctxStaticGetter.addInitializer, 'function')) + return; + ctxStaticGetter.addInitializer(() => log.push('G5')); + ctxStaticGetter.addInitializer(() => log.push('G6')); + }; + const staticGetterDec2 = (fn, ctxStaticGetter) => { + log.push('G1'); + if (!assertEq(() => typeof ctxStaticGetter.addInitializer, 'function')) + return; + ctxStaticGetter.addInitializer(() => log.push('G3')); + ctxStaticGetter.addInitializer(() => log.push('G4')); + }; + // Setter decorators + const setterDec1 = (fn, ctxSetter) => { + log.push('s2'); + if (!assertEq(() => typeof ctxSetter.addInitializer, 'function')) + return; + ctxSetter.addInitializer(() => log.push('s5')); + ctxSetter.addInitializer(() => log.push('s6')); + }; + const setterDec2 = (fn, ctxSetter) => { + log.push('s1'); + if (!assertEq(() => typeof ctxSetter.addInitializer, 'function')) + return; + ctxSetter.addInitializer(() => log.push('s3')); + ctxSetter.addInitializer(() => log.push('s4')); + }; + const staticSetterDec1 = (fn, ctxStaticSetter) => { + log.push('S2'); + if (!assertEq(() => typeof ctxStaticSetter.addInitializer, 'function')) + return; + ctxStaticSetter.addInitializer(() => log.push('S5')); + ctxStaticSetter.addInitializer(() => log.push('S6')); + }; + const staticSetterDec2 = (fn, ctxStaticSetter) => { + log.push('S1'); + if (!assertEq(() => typeof ctxStaticSetter.addInitializer, 'function')) + return; + ctxStaticSetter.addInitializer(() => log.push('S3')); + ctxStaticSetter.addInitializer(() => log.push('S4')); + }; + // Auto-accessor decorators + const accessorDec1 = (target, ctxAccessor) => { + log.push('a2'); + if (!assertEq(() => typeof ctxAccessor.addInitializer, 'function')) + return; + ctxAccessor.addInitializer(() => log.push('a5')); + ctxAccessor.addInitializer(() => log.push('a6')); + return { init() { log.push('a7'); } }; + }; + const accessorDec2 = (target, ctxAccessor) => { + log.push('a1'); + if (!assertEq(() => typeof ctxAccessor.addInitializer, 'function')) + return; + ctxAccessor.addInitializer(() => log.push('a3')); + ctxAccessor.addInitializer(() => log.push('a4')); + return { init() { log.push('a8'); } }; + }; + const staticAccessorDec1 = (target, ctxStaticAccessor) => { + log.push('A2'); + if (!assertEq(() => typeof ctxStaticAccessor.addInitializer, 'function')) + return; + ctxStaticAccessor.addInitializer(() => log.push('A5')); + ctxStaticAccessor.addInitializer(() => log.push('A6')); + return { init() { log.push('A7'); } }; + }; + const staticAccessorDec2 = (target, ctxStaticAccessor) => { + log.push('A1'); + if (!assertEq(() => typeof ctxStaticAccessor.addInitializer, 'function')) + return; + ctxStaticAccessor.addInitializer(() => log.push('A3')); + ctxStaticAccessor.addInitializer(() => log.push('A4')); + return { init() { log.push('A8'); } }; + }; + log.push('start'); + const Foo = + @classDec1 + @classDec2 + class extends (log.push('extends'), Object) { + static { log.push('static:start'); } + constructor() { + log.push('ctor:start'); + super(); + log.push('ctor:end'); + } + @methodDec1 + @methodDec2 + #method() { } + @staticMethodDec1 + @staticMethodDec2 + static #staticMethod() { } + @fieldDec1 + @fieldDec2 + #field; + @staticFieldDec1 + @staticFieldDec2 + static #staticField; + @getterDec1 + @getterDec2 + get #getter() { return; } + @staticGetterDec1 + @staticGetterDec2 + static get #staticGetter() { return; } + @setterDec1 + @setterDec2 + set #setter(x) { } + @staticSetterDec1 + @staticSetterDec2 + static set #staticSetter(x) { } + @accessorDec1 + @accessorDec2 + accessor #accessor; + @staticAccessorDec1 + @staticAccessorDec2 + static accessor #staticAccessor; + static { log.push('static:end'); } + }; + log.push('after'); + new Foo; + log.push('end'); + assertEq(() => log + '', 'start,extends,' + + 'M1,M2,G1,G2,S1,S2,A1,A2,' + // For each element e of staticElements if e.[[Kind]] is not field + 'm1,m2,g1,g2,s1,s2,a1,a2,' + // For each element e of instanceElements if e.[[Kind]] is not field + 'F1,F2,' + // For each element e of staticElements if e.[[Kind]] is field + 'f1,f2,' + // For each element e of instanceElements if e.[[Kind]] is field + 'c1,c2,' + // ApplyDecoratorsToClassDefinition + 'M3,M4,M5,M6,G3,G4,G5,G6,S3,S4,S5,S6,' + // For each element initializer of staticMethodExtraInitializers + 'static:start,' + // For each element elementRecord of staticElements + 'F7,F8,F3,F4,F5,F6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'A7,A8,A3,A4,A5,A6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'static:end,' + // For each element elementRecord of staticElements + 'c3,c4,c5,c6,' + // For each element initializer of classExtraInitializers + 'after,' + + 'ctor:start,' + + 'm3,m4,m5,m6,g3,g4,g5,g6,s3,s4,s5,s6,' + // For each element initializer of constructor.[[Initializers]] (a.k.a. instanceMethodExtraInitializers) + 'f7,f8,f3,f4,f5,f6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'a7,a8,a3,a4,a5,a6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'ctor:end,' + + 'end'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (private members, class statement).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (private members, class statement).js new file mode 100644 index 000000000000..c891fcd8c42c --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (private members, class statement).js @@ -0,0 +1,235 @@ +(() => { + const log = []; + // Class decorators + const classDec1 = (cls, ctxClass) => { + log.push('c2'); + if (!assertEq(() => typeof ctxClass.addInitializer, 'function')) + return; + ctxClass.addInitializer(() => log.push('c5')); + ctxClass.addInitializer(() => log.push('c6')); + }; + const classDec2 = (cls, ctxClass) => { + log.push('c1'); + if (!assertEq(() => typeof ctxClass.addInitializer, 'function')) + return; + ctxClass.addInitializer(() => log.push('c3')); + ctxClass.addInitializer(() => log.push('c4')); + }; + // Method decorators + const methodDec1 = (fn, ctxMethod) => { + log.push('m2'); + if (!assertEq(() => typeof ctxMethod.addInitializer, 'function')) + return; + ctxMethod.addInitializer(() => log.push('m5')); + ctxMethod.addInitializer(() => log.push('m6')); + }; + const methodDec2 = (fn, ctxMethod) => { + log.push('m1'); + if (!assertEq(() => typeof ctxMethod.addInitializer, 'function')) + return; + ctxMethod.addInitializer(() => log.push('m3')); + ctxMethod.addInitializer(() => log.push('m4')); + }; + const staticMethodDec1 = (fn, ctxStaticMethod) => { + log.push('M2'); + if (!assertEq(() => typeof ctxStaticMethod.addInitializer, 'function')) + return; + ctxStaticMethod.addInitializer(() => log.push('M5')); + ctxStaticMethod.addInitializer(() => log.push('M6')); + }; + const staticMethodDec2 = (fn, ctxStaticMethod) => { + log.push('M1'); + if (!assertEq(() => typeof ctxStaticMethod.addInitializer, 'function')) + return; + ctxStaticMethod.addInitializer(() => log.push('M3')); + ctxStaticMethod.addInitializer(() => log.push('M4')); + }; + // Field decorators + const fieldDec1 = (value, ctxField) => { + log.push('f2'); + if (!assertEq(() => typeof ctxField.addInitializer, 'function')) + return; + ctxField.addInitializer(() => log.push('f5')); + ctxField.addInitializer(() => log.push('f6')); + return () => { log.push('f7'); }; + }; + const fieldDec2 = (value, ctxField) => { + log.push('f1'); + if (!assertEq(() => typeof ctxField.addInitializer, 'function')) + return; + ctxField.addInitializer(() => log.push('f3')); + ctxField.addInitializer(() => log.push('f4')); + return () => { log.push('f8'); }; + }; + const staticFieldDec1 = (value, ctxStaticField) => { + log.push('F2'); + if (!assertEq(() => typeof ctxStaticField.addInitializer, 'function')) + return; + ctxStaticField.addInitializer(() => log.push('F5')); + ctxStaticField.addInitializer(() => log.push('F6')); + return () => { log.push('F7'); }; + }; + const staticFieldDec2 = (value, ctxStaticField) => { + log.push('F1'); + if (!assertEq(() => typeof ctxStaticField.addInitializer, 'function')) + return; + ctxStaticField.addInitializer(() => log.push('F3')); + ctxStaticField.addInitializer(() => log.push('F4')); + return () => { log.push('F8'); }; + }; + // Getter decorators + const getterDec1 = (fn, ctxGetter) => { + log.push('g2'); + if (!assertEq(() => typeof ctxGetter.addInitializer, 'function')) + return; + ctxGetter.addInitializer(() => log.push('g5')); + ctxGetter.addInitializer(() => log.push('g6')); + }; + const getterDec2 = (fn, ctxGetter) => { + log.push('g1'); + if (!assertEq(() => typeof ctxGetter.addInitializer, 'function')) + return; + ctxGetter.addInitializer(() => log.push('g3')); + ctxGetter.addInitializer(() => log.push('g4')); + }; + const staticGetterDec1 = (fn, ctxStaticGetter) => { + log.push('G2'); + if (!assertEq(() => typeof ctxStaticGetter.addInitializer, 'function')) + return; + ctxStaticGetter.addInitializer(() => log.push('G5')); + ctxStaticGetter.addInitializer(() => log.push('G6')); + }; + const staticGetterDec2 = (fn, ctxStaticGetter) => { + log.push('G1'); + if (!assertEq(() => typeof ctxStaticGetter.addInitializer, 'function')) + return; + ctxStaticGetter.addInitializer(() => log.push('G3')); + ctxStaticGetter.addInitializer(() => log.push('G4')); + }; + // Setter decorators + const setterDec1 = (fn, ctxSetter) => { + log.push('s2'); + if (!assertEq(() => typeof ctxSetter.addInitializer, 'function')) + return; + ctxSetter.addInitializer(() => log.push('s5')); + ctxSetter.addInitializer(() => log.push('s6')); + }; + const setterDec2 = (fn, ctxSetter) => { + log.push('s1'); + if (!assertEq(() => typeof ctxSetter.addInitializer, 'function')) + return; + ctxSetter.addInitializer(() => log.push('s3')); + ctxSetter.addInitializer(() => log.push('s4')); + }; + const staticSetterDec1 = (fn, ctxStaticSetter) => { + log.push('S2'); + if (!assertEq(() => typeof ctxStaticSetter.addInitializer, 'function')) + return; + ctxStaticSetter.addInitializer(() => log.push('S5')); + ctxStaticSetter.addInitializer(() => log.push('S6')); + }; + const staticSetterDec2 = (fn, ctxStaticSetter) => { + log.push('S1'); + if (!assertEq(() => typeof ctxStaticSetter.addInitializer, 'function')) + return; + ctxStaticSetter.addInitializer(() => log.push('S3')); + ctxStaticSetter.addInitializer(() => log.push('S4')); + }; + // Auto-accessor decorators + const accessorDec1 = (target, ctxAccessor) => { + log.push('a2'); + if (!assertEq(() => typeof ctxAccessor.addInitializer, 'function')) + return; + ctxAccessor.addInitializer(() => log.push('a5')); + ctxAccessor.addInitializer(() => log.push('a6')); + return { init() { log.push('a7'); } }; + }; + const accessorDec2 = (target, ctxAccessor) => { + log.push('a1'); + if (!assertEq(() => typeof ctxAccessor.addInitializer, 'function')) + return; + ctxAccessor.addInitializer(() => log.push('a3')); + ctxAccessor.addInitializer(() => log.push('a4')); + return { init() { log.push('a8'); } }; + }; + const staticAccessorDec1 = (target, ctxStaticAccessor) => { + log.push('A2'); + if (!assertEq(() => typeof ctxStaticAccessor.addInitializer, 'function')) + return; + ctxStaticAccessor.addInitializer(() => log.push('A5')); + ctxStaticAccessor.addInitializer(() => log.push('A6')); + return { init() { log.push('A7'); } }; + }; + const staticAccessorDec2 = (target, ctxStaticAccessor) => { + log.push('A1'); + if (!assertEq(() => typeof ctxStaticAccessor.addInitializer, 'function')) + return; + ctxStaticAccessor.addInitializer(() => log.push('A3')); + ctxStaticAccessor.addInitializer(() => log.push('A4')); + return { init() { log.push('A8'); } }; + }; + log.push('start'); + @classDec1 + @classDec2 + class Foo extends (log.push('extends'), Object) { + static { log.push('static:start'); } + constructor() { + log.push('ctor:start'); + super(); + log.push('ctor:end'); + } + @methodDec1 + @methodDec2 + #method() { } + @staticMethodDec1 + @staticMethodDec2 + static #staticMethod() { } + @fieldDec1 + @fieldDec2 + #field; + @staticFieldDec1 + @staticFieldDec2 + static #staticField; + @getterDec1 + @getterDec2 + get #getter() { return; } + @staticGetterDec1 + @staticGetterDec2 + static get #staticGetter() { return; } + @setterDec1 + @setterDec2 + set #setter(x) { } + @staticSetterDec1 + @staticSetterDec2 + static set #staticSetter(x) { } + @accessorDec1 + @accessorDec2 + accessor #accessor; + @staticAccessorDec1 + @staticAccessorDec2 + static accessor #staticAccessor; + static { log.push('static:end'); } + } + log.push('after'); + new Foo; + log.push('end'); + assertEq(() => log + '', 'start,extends,' + + 'M1,M2,G1,G2,S1,S2,A1,A2,' + // For each element e of staticElements if e.[[Kind]] is not field + 'm1,m2,g1,g2,s1,s2,a1,a2,' + // For each element e of instanceElements if e.[[Kind]] is not field + 'F1,F2,' + // For each element e of staticElements if e.[[Kind]] is field + 'f1,f2,' + // For each element e of instanceElements if e.[[Kind]] is field + 'c1,c2,' + // ApplyDecoratorsToClassDefinition + 'M3,M4,M5,M6,G3,G4,G5,G6,S3,S4,S5,S6,' + // For each element initializer of staticMethodExtraInitializers + 'static:start,' + // For each element elementRecord of staticElements + 'F7,F8,F3,F4,F5,F6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'A7,A8,A3,A4,A5,A6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'static:end,' + // For each element elementRecord of staticElements + 'c3,c4,c5,c6,' + // For each element initializer of classExtraInitializers + 'after,' + + 'ctor:start,' + + 'm3,m4,m5,m6,g3,g4,g5,g6,s3,s4,s5,s6,' + // For each element initializer of constructor.[[Initializers]] (a.k.a. instanceMethodExtraInitializers) + 'f7,f8,f3,f4,f5,f6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'a7,a8,a3,a4,a5,a6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'ctor:end,' + + 'end'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (public members, class expression).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (public members, class expression).js new file mode 100644 index 000000000000..135cfe102869 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (public members, class expression).js @@ -0,0 +1,236 @@ +(() => { + const log = []; + // Class decorators + const classDec1 = (cls, ctxClass) => { + log.push('c2'); + if (!assertEq(() => typeof ctxClass.addInitializer, 'function')) + return; + ctxClass.addInitializer(() => log.push('c5')); + ctxClass.addInitializer(() => log.push('c6')); + }; + const classDec2 = (cls, ctxClass) => { + log.push('c1'); + if (!assertEq(() => typeof ctxClass.addInitializer, 'function')) + return; + ctxClass.addInitializer(() => log.push('c3')); + ctxClass.addInitializer(() => log.push('c4')); + }; + // Method decorators + const methodDec1 = (fn, ctxMethod) => { + log.push('m2'); + if (!assertEq(() => typeof ctxMethod.addInitializer, 'function')) + return; + ctxMethod.addInitializer(() => log.push('m5')); + ctxMethod.addInitializer(() => log.push('m6')); + }; + const methodDec2 = (fn, ctxMethod) => { + log.push('m1'); + if (!assertEq(() => typeof ctxMethod.addInitializer, 'function')) + return; + ctxMethod.addInitializer(() => log.push('m3')); + ctxMethod.addInitializer(() => log.push('m4')); + }; + const staticMethodDec1 = (fn, ctxStaticMethod) => { + log.push('M2'); + if (!assertEq(() => typeof ctxStaticMethod.addInitializer, 'function')) + return; + ctxStaticMethod.addInitializer(() => log.push('M5')); + ctxStaticMethod.addInitializer(() => log.push('M6')); + }; + const staticMethodDec2 = (fn, ctxStaticMethod) => { + log.push('M1'); + if (!assertEq(() => typeof ctxStaticMethod.addInitializer, 'function')) + return; + ctxStaticMethod.addInitializer(() => log.push('M3')); + ctxStaticMethod.addInitializer(() => log.push('M4')); + }; + // Field decorators + const fieldDec1 = (value, ctxField) => { + log.push('f2'); + if (!assertEq(() => typeof ctxField.addInitializer, 'function')) + return; + ctxField.addInitializer(() => log.push('f5')); + ctxField.addInitializer(() => log.push('f6')); + return () => { log.push('f7'); }; + }; + const fieldDec2 = (value, ctxField) => { + log.push('f1'); + if (!assertEq(() => typeof ctxField.addInitializer, 'function')) + return; + ctxField.addInitializer(() => log.push('f3')); + ctxField.addInitializer(() => log.push('f4')); + return () => { log.push('f8'); }; + }; + const staticFieldDec1 = (value, ctxStaticField) => { + log.push('F2'); + if (!assertEq(() => typeof ctxStaticField.addInitializer, 'function')) + return; + ctxStaticField.addInitializer(() => log.push('F5')); + ctxStaticField.addInitializer(() => log.push('F6')); + return () => { log.push('F7'); }; + }; + const staticFieldDec2 = (value, ctxStaticField) => { + log.push('F1'); + if (!assertEq(() => typeof ctxStaticField.addInitializer, 'function')) + return; + ctxStaticField.addInitializer(() => log.push('F3')); + ctxStaticField.addInitializer(() => log.push('F4')); + return () => { log.push('F8'); }; + }; + // Getter decorators + const getterDec1 = (fn, ctxGetter) => { + log.push('g2'); + if (!assertEq(() => typeof ctxGetter.addInitializer, 'function')) + return; + ctxGetter.addInitializer(() => log.push('g5')); + ctxGetter.addInitializer(() => log.push('g6')); + }; + const getterDec2 = (fn, ctxGetter) => { + log.push('g1'); + if (!assertEq(() => typeof ctxGetter.addInitializer, 'function')) + return; + ctxGetter.addInitializer(() => log.push('g3')); + ctxGetter.addInitializer(() => log.push('g4')); + }; + const staticGetterDec1 = (fn, ctxStaticGetter) => { + log.push('G2'); + if (!assertEq(() => typeof ctxStaticGetter.addInitializer, 'function')) + return; + ctxStaticGetter.addInitializer(() => log.push('G5')); + ctxStaticGetter.addInitializer(() => log.push('G6')); + }; + const staticGetterDec2 = (fn, ctxStaticGetter) => { + log.push('G1'); + if (!assertEq(() => typeof ctxStaticGetter.addInitializer, 'function')) + return; + ctxStaticGetter.addInitializer(() => log.push('G3')); + ctxStaticGetter.addInitializer(() => log.push('G4')); + }; + // Setter decorators + const setterDec1 = (fn, ctxSetter) => { + log.push('s2'); + if (!assertEq(() => typeof ctxSetter.addInitializer, 'function')) + return; + ctxSetter.addInitializer(() => log.push('s5')); + ctxSetter.addInitializer(() => log.push('s6')); + }; + const setterDec2 = (fn, ctxSetter) => { + log.push('s1'); + if (!assertEq(() => typeof ctxSetter.addInitializer, 'function')) + return; + ctxSetter.addInitializer(() => log.push('s3')); + ctxSetter.addInitializer(() => log.push('s4')); + }; + const staticSetterDec1 = (fn, ctxStaticSetter) => { + log.push('S2'); + if (!assertEq(() => typeof ctxStaticSetter.addInitializer, 'function')) + return; + ctxStaticSetter.addInitializer(() => log.push('S5')); + ctxStaticSetter.addInitializer(() => log.push('S6')); + }; + const staticSetterDec2 = (fn, ctxStaticSetter) => { + log.push('S1'); + if (!assertEq(() => typeof ctxStaticSetter.addInitializer, 'function')) + return; + ctxStaticSetter.addInitializer(() => log.push('S3')); + ctxStaticSetter.addInitializer(() => log.push('S4')); + }; + // Auto-accessor decorators + const accessorDec1 = (target, ctxAccessor) => { + log.push('a2'); + if (!assertEq(() => typeof ctxAccessor.addInitializer, 'function')) + return; + ctxAccessor.addInitializer(() => log.push('a5')); + ctxAccessor.addInitializer(() => log.push('a6')); + return { init() { log.push('a7'); } }; + }; + const accessorDec2 = (target, ctxAccessor) => { + log.push('a1'); + if (!assertEq(() => typeof ctxAccessor.addInitializer, 'function')) + return; + ctxAccessor.addInitializer(() => log.push('a3')); + ctxAccessor.addInitializer(() => log.push('a4')); + return { init() { log.push('a8'); } }; + }; + const staticAccessorDec1 = (target, ctxStaticAccessor) => { + log.push('A2'); + if (!assertEq(() => typeof ctxStaticAccessor.addInitializer, 'function')) + return; + ctxStaticAccessor.addInitializer(() => log.push('A5')); + ctxStaticAccessor.addInitializer(() => log.push('A6')); + return { init() { log.push('A7'); } }; + }; + const staticAccessorDec2 = (target, ctxStaticAccessor) => { + log.push('A1'); + if (!assertEq(() => typeof ctxStaticAccessor.addInitializer, 'function')) + return; + ctxStaticAccessor.addInitializer(() => log.push('A3')); + ctxStaticAccessor.addInitializer(() => log.push('A4')); + return { init() { log.push('A8'); } }; + }; + log.push('start'); + const Foo = + @classDec1 + @classDec2 + class extends (log.push('extends'), Object) { + static { log.push('static:start'); } + constructor() { + log.push('ctor:start'); + super(); + log.push('ctor:end'); + } + @methodDec1 + @methodDec2 + method() { } + @staticMethodDec1 + @staticMethodDec2 + static method() { } + @fieldDec1 + @fieldDec2 + field; + @staticFieldDec1 + @staticFieldDec2 + static field; + @getterDec1 + @getterDec2 + get getter() { return; } + @staticGetterDec1 + @staticGetterDec2 + static get getter() { return; } + @setterDec1 + @setterDec2 + set setter(x) { } + @staticSetterDec1 + @staticSetterDec2 + static set setter(x) { } + @accessorDec1 + @accessorDec2 + accessor accessor; + @staticAccessorDec1 + @staticAccessorDec2 + static accessor accessor; + static { log.push('static:end'); } + }; + log.push('after'); + new Foo; + log.push('end'); + assertEq(() => log + '', 'start,extends,' + + 'M1,M2,G1,G2,S1,S2,A1,A2,' + // For each element e of staticElements if e.[[Kind]] is not field + 'm1,m2,g1,g2,s1,s2,a1,a2,' + // For each element e of instanceElements if e.[[Kind]] is not field + 'F1,F2,' + // For each element e of staticElements if e.[[Kind]] is field + 'f1,f2,' + // For each element e of instanceElements if e.[[Kind]] is field + 'c1,c2,' + // ApplyDecoratorsToClassDefinition + 'M3,M4,M5,M6,G3,G4,G5,G6,S3,S4,S5,S6,' + // For each element initializer of staticMethodExtraInitializers + 'static:start,' + // For each element elementRecord of staticElements + 'F7,F8,F3,F4,F5,F6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'A7,A8,A3,A4,A5,A6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'static:end,' + // For each element elementRecord of staticElements + 'c3,c4,c5,c6,' + // For each element initializer of classExtraInitializers + 'after,' + + 'ctor:start,' + + 'm3,m4,m5,m6,g3,g4,g5,g6,s3,s4,s5,s6,' + // For each element initializer of constructor.[[Initializers]] (a.k.a. instanceMethodExtraInitializers) + 'f7,f8,f3,f4,f5,f6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'a7,a8,a3,a4,a5,a6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'ctor:end,' + + 'end'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (public members, class statement).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (public members, class statement).js new file mode 100644 index 000000000000..88accb1ed924 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (public members, class statement).js @@ -0,0 +1,235 @@ +(() => { + const log = []; + // Class decorators + const classDec1 = (cls, ctxClass) => { + log.push('c2'); + if (!assertEq(() => typeof ctxClass.addInitializer, 'function')) + return; + ctxClass.addInitializer(() => log.push('c5')); + ctxClass.addInitializer(() => log.push('c6')); + }; + const classDec2 = (cls, ctxClass) => { + log.push('c1'); + if (!assertEq(() => typeof ctxClass.addInitializer, 'function')) + return; + ctxClass.addInitializer(() => log.push('c3')); + ctxClass.addInitializer(() => log.push('c4')); + }; + // Method decorators + const methodDec1 = (fn, ctxMethod) => { + log.push('m2'); + if (!assertEq(() => typeof ctxMethod.addInitializer, 'function')) + return; + ctxMethod.addInitializer(() => log.push('m5')); + ctxMethod.addInitializer(() => log.push('m6')); + }; + const methodDec2 = (fn, ctxMethod) => { + log.push('m1'); + if (!assertEq(() => typeof ctxMethod.addInitializer, 'function')) + return; + ctxMethod.addInitializer(() => log.push('m3')); + ctxMethod.addInitializer(() => log.push('m4')); + }; + const staticMethodDec1 = (fn, ctxStaticMethod) => { + log.push('M2'); + if (!assertEq(() => typeof ctxStaticMethod.addInitializer, 'function')) + return; + ctxStaticMethod.addInitializer(() => log.push('M5')); + ctxStaticMethod.addInitializer(() => log.push('M6')); + }; + const staticMethodDec2 = (fn, ctxStaticMethod) => { + log.push('M1'); + if (!assertEq(() => typeof ctxStaticMethod.addInitializer, 'function')) + return; + ctxStaticMethod.addInitializer(() => log.push('M3')); + ctxStaticMethod.addInitializer(() => log.push('M4')); + }; + // Field decorators + const fieldDec1 = (value, ctxField) => { + log.push('f2'); + if (!assertEq(() => typeof ctxField.addInitializer, 'function')) + return; + ctxField.addInitializer(() => log.push('f5')); + ctxField.addInitializer(() => log.push('f6')); + return () => { log.push('f7'); }; + }; + const fieldDec2 = (value, ctxField) => { + log.push('f1'); + if (!assertEq(() => typeof ctxField.addInitializer, 'function')) + return; + ctxField.addInitializer(() => log.push('f3')); + ctxField.addInitializer(() => log.push('f4')); + return () => { log.push('f8'); }; + }; + const staticFieldDec1 = (value, ctxStaticField) => { + log.push('F2'); + if (!assertEq(() => typeof ctxStaticField.addInitializer, 'function')) + return; + ctxStaticField.addInitializer(() => log.push('F5')); + ctxStaticField.addInitializer(() => log.push('F6')); + return () => { log.push('F7'); }; + }; + const staticFieldDec2 = (value, ctxStaticField) => { + log.push('F1'); + if (!assertEq(() => typeof ctxStaticField.addInitializer, 'function')) + return; + ctxStaticField.addInitializer(() => log.push('F3')); + ctxStaticField.addInitializer(() => log.push('F4')); + return () => { log.push('F8'); }; + }; + // Getter decorators + const getterDec1 = (fn, ctxGetter) => { + log.push('g2'); + if (!assertEq(() => typeof ctxGetter.addInitializer, 'function')) + return; + ctxGetter.addInitializer(() => log.push('g5')); + ctxGetter.addInitializer(() => log.push('g6')); + }; + const getterDec2 = (fn, ctxGetter) => { + log.push('g1'); + if (!assertEq(() => typeof ctxGetter.addInitializer, 'function')) + return; + ctxGetter.addInitializer(() => log.push('g3')); + ctxGetter.addInitializer(() => log.push('g4')); + }; + const staticGetterDec1 = (fn, ctxStaticGetter) => { + log.push('G2'); + if (!assertEq(() => typeof ctxStaticGetter.addInitializer, 'function')) + return; + ctxStaticGetter.addInitializer(() => log.push('G5')); + ctxStaticGetter.addInitializer(() => log.push('G6')); + }; + const staticGetterDec2 = (fn, ctxStaticGetter) => { + log.push('G1'); + if (!assertEq(() => typeof ctxStaticGetter.addInitializer, 'function')) + return; + ctxStaticGetter.addInitializer(() => log.push('G3')); + ctxStaticGetter.addInitializer(() => log.push('G4')); + }; + // Setter decorators + const setterDec1 = (fn, ctxSetter) => { + log.push('s2'); + if (!assertEq(() => typeof ctxSetter.addInitializer, 'function')) + return; + ctxSetter.addInitializer(() => log.push('s5')); + ctxSetter.addInitializer(() => log.push('s6')); + }; + const setterDec2 = (fn, ctxSetter) => { + log.push('s1'); + if (!assertEq(() => typeof ctxSetter.addInitializer, 'function')) + return; + ctxSetter.addInitializer(() => log.push('s3')); + ctxSetter.addInitializer(() => log.push('s4')); + }; + const staticSetterDec1 = (fn, ctxStaticSetter) => { + log.push('S2'); + if (!assertEq(() => typeof ctxStaticSetter.addInitializer, 'function')) + return; + ctxStaticSetter.addInitializer(() => log.push('S5')); + ctxStaticSetter.addInitializer(() => log.push('S6')); + }; + const staticSetterDec2 = (fn, ctxStaticSetter) => { + log.push('S1'); + if (!assertEq(() => typeof ctxStaticSetter.addInitializer, 'function')) + return; + ctxStaticSetter.addInitializer(() => log.push('S3')); + ctxStaticSetter.addInitializer(() => log.push('S4')); + }; + // Auto-accessor decorators + const accessorDec1 = (target, ctxAccessor) => { + log.push('a2'); + if (!assertEq(() => typeof ctxAccessor.addInitializer, 'function')) + return; + ctxAccessor.addInitializer(() => log.push('a5')); + ctxAccessor.addInitializer(() => log.push('a6')); + return { init() { log.push('a7'); } }; + }; + const accessorDec2 = (target, ctxAccessor) => { + log.push('a1'); + if (!assertEq(() => typeof ctxAccessor.addInitializer, 'function')) + return; + ctxAccessor.addInitializer(() => log.push('a3')); + ctxAccessor.addInitializer(() => log.push('a4')); + return { init() { log.push('a8'); } }; + }; + const staticAccessorDec1 = (target, ctxStaticAccessor) => { + log.push('A2'); + if (!assertEq(() => typeof ctxStaticAccessor.addInitializer, 'function')) + return; + ctxStaticAccessor.addInitializer(() => log.push('A5')); + ctxStaticAccessor.addInitializer(() => log.push('A6')); + return { init() { log.push('A7'); } }; + }; + const staticAccessorDec2 = (target, ctxStaticAccessor) => { + log.push('A1'); + if (!assertEq(() => typeof ctxStaticAccessor.addInitializer, 'function')) + return; + ctxStaticAccessor.addInitializer(() => log.push('A3')); + ctxStaticAccessor.addInitializer(() => log.push('A4')); + return { init() { log.push('A8'); } }; + }; + log.push('start'); + @classDec1 + @classDec2 + class Foo extends (log.push('extends'), Object) { + static { log.push('static:start'); } + constructor() { + log.push('ctor:start'); + super(); + log.push('ctor:end'); + } + @methodDec1 + @methodDec2 + method() { } + @staticMethodDec1 + @staticMethodDec2 + static method() { } + @fieldDec1 + @fieldDec2 + field; + @staticFieldDec1 + @staticFieldDec2 + static field; + @getterDec1 + @getterDec2 + get getter() { return; } + @staticGetterDec1 + @staticGetterDec2 + static get getter() { return; } + @setterDec1 + @setterDec2 + set setter(x) { } + @staticSetterDec1 + @staticSetterDec2 + static set setter(x) { } + @accessorDec1 + @accessorDec2 + accessor accessor; + @staticAccessorDec1 + @staticAccessorDec2 + static accessor accessor; + static { log.push('static:end'); } + } + log.push('after'); + new Foo; + log.push('end'); + assertEq(() => log + '', 'start,extends,' + + 'M1,M2,G1,G2,S1,S2,A1,A2,' + // For each element e of staticElements if e.[[Kind]] is not field + 'm1,m2,g1,g2,s1,s2,a1,a2,' + // For each element e of instanceElements if e.[[Kind]] is not field + 'F1,F2,' + // For each element e of staticElements if e.[[Kind]] is field + 'f1,f2,' + // For each element e of instanceElements if e.[[Kind]] is field + 'c1,c2,' + // ApplyDecoratorsToClassDefinition + 'M3,M4,M5,M6,G3,G4,G5,G6,S3,S4,S5,S6,' + // For each element initializer of staticMethodExtraInitializers + 'static:start,' + // For each element elementRecord of staticElements + 'F7,F8,F3,F4,F5,F6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'A7,A8,A3,A4,A5,A6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'static:end,' + // For each element elementRecord of staticElements + 'c3,c4,c5,c6,' + // For each element initializer of classExtraInitializers + 'after,' + + 'ctor:start,' + + 'm3,m4,m5,m6,g3,g4,g5,g6,s3,s4,s5,s6,' + // For each element initializer of constructor.[[Initializers]] (a.k.a. instanceMethodExtraInitializers) + 'f7,f8,f3,f4,f5,f6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'a7,a8,a3,a4,a5,a6,' + // InitializeFieldOrAccessor + For each element initializer of elementRecord.[[ExtraInitializers]] + 'ctor:end,' + + 'end'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (instance method).js new file mode 100644 index 000000000000..5daa36860b8b --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (instance method).js @@ -0,0 +1,29 @@ +(() => { + const old = {}; + const dec = (key, name) => (fn, ctx) => { + assertEq(() => typeof fn, 'function'); + assertEq(() => fn.name, name); + assertEq(() => ctx.kind, 'method'); + assertEq(() => ctx.name, key); + assertEq(() => ctx.static, false); + assertEq(() => ctx.private, false); + assertEq(() => ctx.access.has({ [key]: false }), true); + assertEq(() => ctx.access.has({ bar: true }), false); + assertEq(() => ctx.access.get({ [key]: 123 }), 123); + assertEq(() => 'set' in ctx.access, false); + old[key] = fn; + }; + const bar = Symbol('bar'); + const baz = Symbol(); + class Foo { + @dec('foo', 'foo') + foo() { } + @dec(bar, '[bar]') + [bar]() { } + @dec(baz, '') + [baz]() { } + } + assertEq(() => Foo.prototype.foo, old['foo']); + assertEq(() => Foo.prototype[bar], old[bar]); + assertEq(() => Foo.prototype[baz], old[baz]); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (private instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (private instance method).js new file mode 100644 index 000000000000..3c89e36ef183 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (private instance method).js @@ -0,0 +1,27 @@ +(() => { + let old; + let lateAsserts; + const dec = (fn, ctx) => { + assertEq(() => typeof fn, 'function'); + assertEq(() => fn.name, '#foo'); + assertEq(() => ctx.kind, 'method'); + assertEq(() => ctx.name, '#foo'); + assertEq(() => ctx.static, false); + assertEq(() => ctx.private, true); + lateAsserts = () => { + assertEq(() => ctx.access.has(new Foo), true); + assertEq(() => ctx.access.has({}), false); + assertEq(() => ctx.access.get(new Foo), $foo); + assertEq(() => 'set' in ctx.access, false); + }; + old = fn; + }; + let $foo; + class Foo { + @dec + #foo() { } + static { $foo = new Foo().#foo; } + } + assertEq(() => $foo, old); + lateAsserts(); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (private static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (private static method).js new file mode 100644 index 000000000000..5abd9a75defe --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (private static method).js @@ -0,0 +1,27 @@ +(() => { + let old; + let lateAsserts; + const dec = (fn, ctx) => { + assertEq(() => typeof fn, 'function'); + assertEq(() => fn.name, '#foo'); + assertEq(() => ctx.kind, 'method'); + assertEq(() => ctx.name, '#foo'); + assertEq(() => ctx.static, true); + assertEq(() => ctx.private, true); + lateAsserts = () => { + assertEq(() => ctx.access.has(Foo), true); + assertEq(() => ctx.access.has({}), false); + assertEq(() => ctx.access.get(Foo), $foo); + assertEq(() => 'set' in ctx.access, false); + }; + old = fn; + }; + let $foo; + class Foo { + @dec + static #foo() { } + static { $foo = this.#foo; } + } + assertEq(() => $foo, old); + lateAsserts(); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (static method).js new file mode 100644 index 000000000000..95b7c2f36f73 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (static method).js @@ -0,0 +1,29 @@ +(() => { + const old = {}; + const dec = (key, name) => (fn, ctx) => { + assertEq(() => typeof fn, 'function'); + assertEq(() => fn.name, name); + assertEq(() => ctx.kind, 'method'); + assertEq(() => ctx.name, key); + assertEq(() => ctx.static, true); + assertEq(() => ctx.private, false); + assertEq(() => ctx.access.has({ [key]: false }), true); + assertEq(() => ctx.access.has({ bar: true }), false); + assertEq(() => ctx.access.get({ [key]: 123 }), 123); + assertEq(() => 'set' in ctx.access, false); + old[key] = fn; + }; + const bar = Symbol('bar'); + const baz = Symbol(); + class Foo { + @dec('foo', 'foo') + static foo() { } + @dec(bar, '[bar]') + static [bar]() { } + @dec(baz, '') + static [baz]() { } + } + assertEq(() => Foo.foo, old['foo']); + assertEq(() => Foo[bar], old[bar]); + assertEq(() => Foo[baz], old[baz]); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (instance method).js new file mode 100644 index 000000000000..cad027fd884f --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (instance method).js @@ -0,0 +1,22 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (fn, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + foo() { } + } + assertEq(() => got, undefined); + const instance = new Foo; + assertEq(() => got.this, instance); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (private instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (private instance method).js new file mode 100644 index 000000000000..c26eb8afe709 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (private instance method).js @@ -0,0 +1,22 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (fn, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + #foo() { } + } + assertEq(() => got, undefined); + const instance = new Foo; + assertEq(() => got.this, instance); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (private static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (private static method).js new file mode 100644 index 000000000000..1b79f6e2ca5b --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (private static method).js @@ -0,0 +1,20 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (fn, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + static #foo() { } + } + assertEq(() => got.this, Foo); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (static method).js new file mode 100644 index 000000000000..998c3d3adb2b --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (static method).js @@ -0,0 +1,20 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (fn, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + static foo() { } + } + assertEq(() => got.this, Foo); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (instance method).js new file mode 100644 index 000000000000..723a10fd3548 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (instance method).js @@ -0,0 +1,32 @@ +(() => { + const log = []; + let bar; + let baz; + const dec1 = (fn, ctx) => { + log.push(2); + bar = function () { + log.push(4); + return fn.call(this); + }; + return bar; + }; + const dec2 = (fn, ctx) => { + log.push(1); + baz = function () { + log.push(5); + return fn.call(this); + }; + return baz; + }; + log.push(0); + class Foo { + @dec1 + @dec2 + foo() { return log.push(6); } + } + log.push(3); + new Foo().foo(); + log.push(7); + assertEq(() => Foo.prototype.foo, bar); + assertEq(() => log + '', '0,1,2,3,4,5,6,7'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (private instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (private instance method).js new file mode 100644 index 000000000000..d62410295ab8 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (private instance method).js @@ -0,0 +1,34 @@ +(() => { + const log = []; + let bar; + let baz; + const dec1 = (fn, ctx) => { + log.push(2); + bar = function () { + log.push(4); + return fn.call(this); + }; + return bar; + }; + const dec2 = (fn, ctx) => { + log.push(1); + baz = function () { + log.push(5); + return fn.call(this); + }; + return baz; + }; + log.push(0); + let $foo; + class Foo { + @dec1 + @dec2 + #foo() { return log.push(6); } + static { $foo = new Foo().#foo; } + } + log.push(3); + $foo.call(new Foo); + log.push(7); + assertEq(() => $foo, bar); + assertEq(() => log + '', '0,1,2,3,4,5,6,7'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (private static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (private static method).js new file mode 100644 index 000000000000..3046c8de1183 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (private static method).js @@ -0,0 +1,34 @@ +(() => { + const log = []; + let bar; + let baz; + const dec1 = (fn, ctx) => { + log.push(2); + bar = function () { + log.push(4); + return fn.call(this); + }; + return bar; + }; + const dec2 = (fn, ctx) => { + log.push(1); + baz = function () { + log.push(5); + return fn.call(this); + }; + return baz; + }; + log.push(0); + let $foo; + class Foo { + @dec1 + @dec2 + static #foo() { return log.push(6); } + static { $foo = Foo.#foo; } + } + log.push(3); + $foo.call(Foo); + log.push(7); + assertEq(() => $foo, bar); + assertEq(() => log + '', '0,1,2,3,4,5,6,7'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (static method).js new file mode 100644 index 000000000000..9615f22ec855 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (static method).js @@ -0,0 +1,32 @@ +(() => { + const log = []; + let bar; + let baz; + const dec1 = (fn, ctx) => { + log.push(2); + bar = function () { + log.push(4); + return fn.call(this); + }; + return bar; + }; + const dec2 = (fn, ctx) => { + log.push(1); + baz = function () { + log.push(5); + return fn.call(this); + }; + return baz; + }; + log.push(0); + class Foo { + @dec1 + @dec2 + static foo() { return log.push(6); } + } + log.push(3); + Foo.foo(); + log.push(7); + assertEq(() => Foo.foo, bar); + assertEq(() => log + '', '0,1,2,3,4,5,6,7'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (instance method).js new file mode 100644 index 000000000000..8df78c540b55 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (instance method).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return null; + }; + class Foo { + @dec + foo() { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (private instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (private instance method).js new file mode 100644 index 000000000000..5b5485941826 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (private instance method).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return null; + }; + class Foo { + @dec + #foo() { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (private static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (private static method).js new file mode 100644 index 000000000000..e17a71812c96 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (private static method).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return null; + }; + class Foo { + @dec + static #foo() { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (static method).js new file mode 100644 index 000000000000..fd167a434618 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (static method).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return null; + }; + class Foo { + @dec + static foo() { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (instance method).js new file mode 100644 index 000000000000..79cf75792c6f --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (instance method).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return {}; + }; + class Foo { + @dec + foo() { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (private instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (private instance method).js new file mode 100644 index 000000000000..493561fcf948 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (private instance method).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return {}; + }; + class Foo { + @dec + #foo() { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (private static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (private static method).js new file mode 100644 index 000000000000..bb39747f749b --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (private static method).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return {}; + }; + class Foo { + @dec + static #foo() { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (static method).js new file mode 100644 index 000000000000..1d7b9f7cfc95 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (static method).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return {}; + }; + class Foo { + @dec + static foo() { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (instance method).js new file mode 100644 index 000000000000..6ab35d1b6a3b --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (instance method).js @@ -0,0 +1,14 @@ +(() => { + let bar; + const dec = (fn, ctx) => { + bar = function () { return fn.call(this) + 1; }; + return bar; + }; + class Foo { + bar = 123; + @dec + foo() { return this.bar; } + } + assertEq(() => Foo.prototype.foo, bar); + assertEq(() => new Foo().foo(), 124); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (private instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (private instance method).js new file mode 100644 index 000000000000..c41328cec199 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (private instance method).js @@ -0,0 +1,16 @@ +(() => { + let bar; + const dec = (fn, ctx) => { + bar = function () { return fn.call(this) + 1; }; + return bar; + }; + let $foo; + class Foo { + bar = 123; + @dec + #foo() { return this.bar; } + static { $foo = new Foo().#foo; } + } + assertEq(() => $foo, bar); + assertEq(() => bar.call(new Foo), 124); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (private static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (private static method).js new file mode 100644 index 000000000000..fade7670f17d --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (private static method).js @@ -0,0 +1,16 @@ +(() => { + let bar; + const dec = (fn, ctx) => { + bar = function () { return fn.call(this) + 1; }; + return bar; + }; + let $foo; + class Foo { + static bar = 123; + @dec + static #foo() { return this.bar; } + static { $foo = this.#foo; } + } + assertEq(() => $foo, bar); + assertEq(() => bar.call(Foo), 124); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (static method).js new file mode 100644 index 000000000000..c0b3d9148fa2 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (static method).js @@ -0,0 +1,14 @@ +(() => { + let bar; + const dec = (fn, ctx) => { + bar = function () { return fn.call(this) + 1; }; + return bar; + }; + class Foo { + static bar = 123; + @dec + static foo() { return this.bar; } + } + assertEq(() => Foo.foo, bar); + assertEq(() => Foo.foo(), 124); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (instance setter).js new file mode 100644 index 000000000000..c1d788a83fd9 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (instance setter).js @@ -0,0 +1,35 @@ +(() => { + const dec = (key, name) => (fn, ctx) => { + assertEq(() => typeof fn, 'function'); + assertEq(() => fn.name, name); + assertEq(() => ctx.kind, 'setter'); + assertEq(() => ctx.name, key); + assertEq(() => ctx.static, false); + assertEq(() => ctx.private, false); + assertEq(() => ctx.access.has({ [key]: false }), true); + assertEq(() => ctx.access.has({ bar: true }), false); + assertEq(() => 'get' in ctx.access, false); + const obj = {}; + ctx.access.set(obj, 123); + assertEq(() => obj[key], 123); + assertEq(() => 'bar' in obj, false); + }; + const bar = Symbol('bar'); + const baz = Symbol(); + class Foo { + bar = 0; + @dec('foo', 'set foo') + set foo(x) { this.bar = x; } + @dec(bar, 'set [bar]') + set [bar](x) { this.bar = x; } + @dec(baz, 'set ') + set [baz](x) { this.bar = x; } + } + var obj = new Foo; + obj.foo = 321; + assertEq(() => obj.bar, 321); + obj[bar] = 4321; + assertEq(() => obj.bar, 4321); + obj[baz] = 54321; + assertEq(() => obj.bar, 54321); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (private instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (private instance setter).js new file mode 100644 index 000000000000..6d969a09ccf2 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (private instance setter).js @@ -0,0 +1,32 @@ +(() => { + let lateAsserts; + const dec = (fn, ctx) => { + assertEq(() => typeof fn, 'function'); + assertEq(() => fn.name, 'set #foo'); + assertEq(() => ctx.kind, 'setter'); + assertEq(() => ctx.name, '#foo'); + assertEq(() => ctx.static, false); + assertEq(() => ctx.private, true); + lateAsserts = () => { + assertEq(() => ctx.access.has(new Foo), true); + assertEq(() => ctx.access.has({}), false); + assertEq(() => 'get' in ctx.access, false); + assertEq(() => { + const obj = new Foo; + ctx.access.set(obj, 123); + return obj.bar; + }, 123); + }; + }; + let set$foo; + class Foo { + bar = 0; + @dec + set #foo(x) { this.bar = x; } + static { set$foo = (x, y) => { x.#foo = y; }; } + } + lateAsserts(); + var obj = new Foo; + assertEq(() => set$foo(obj, 321), undefined); + assertEq(() => obj.bar, 321); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (private static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (private static setter).js new file mode 100644 index 000000000000..073e64408f6e --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (private static setter).js @@ -0,0 +1,30 @@ +(() => { + let lateAsserts; + const dec = (fn, ctx) => { + assertEq(() => typeof fn, 'function'); + assertEq(() => fn.name, 'set #foo'); + assertEq(() => ctx.kind, 'setter'); + assertEq(() => ctx.name, '#foo'); + assertEq(() => ctx.static, true); + assertEq(() => ctx.private, true); + lateAsserts = () => { + assertEq(() => ctx.access.has(Foo), true); + assertEq(() => ctx.access.has({}), false); + assertEq(() => 'get' in ctx.access, false); + assertEq(() => { + ctx.access.set(Foo, 123); + return Foo.bar; + }, 123); + }; + }; + let set$foo; + class Foo { + static bar = 0; + @dec + static set #foo(x) { this.bar = x; } + static { set$foo = (x, y) => { x.#foo = y; }; } + } + lateAsserts(); + assertEq(() => set$foo(Foo, 321), undefined); + assertEq(() => Foo.bar, 321); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (static setter).js new file mode 100644 index 000000000000..b186952b1d30 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (static setter).js @@ -0,0 +1,34 @@ +(() => { + const dec = (key, name) => (fn, ctx) => { + assertEq(() => typeof fn, 'function'); + assertEq(() => fn.name, name); + assertEq(() => ctx.kind, 'setter'); + assertEq(() => ctx.name, key); + assertEq(() => ctx.static, true); + assertEq(() => ctx.private, false); + assertEq(() => ctx.access.has({ [key]: false }), true); + assertEq(() => ctx.access.has({ bar: true }), false); + assertEq(() => 'get' in ctx.access, false); + const obj = {}; + ctx.access.set(obj, 123); + assertEq(() => obj[key], 123); + assertEq(() => 'bar' in obj, false); + }; + const bar = Symbol('bar'); + const baz = Symbol(); + class Foo { + static bar = 0; + @dec('foo', 'set foo') + static set foo(x) { this.bar = x; } + @dec(bar, 'set [bar]') + static set [bar](x) { this.bar = x; } + @dec(baz, 'set ') + static set [baz](x) { this.bar = x; } + } + Foo.foo = 321; + assertEq(() => Foo.bar, 321); + Foo[bar] = 4321; + assertEq(() => Foo.bar, 4321); + Foo[baz] = 54321; + assertEq(() => Foo.bar, 54321); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (instance setter).js new file mode 100644 index 000000000000..eb9cca570fd0 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (instance setter).js @@ -0,0 +1,22 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (fn, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + set foo(x) { } + } + assertEq(() => got, undefined); + const instance = new Foo; + assertEq(() => got.this, instance); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (private instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (private instance setter).js new file mode 100644 index 000000000000..92c670840e72 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (private instance setter).js @@ -0,0 +1,22 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (fn, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + set #foo(x) { } + } + assertEq(() => got, undefined); + const instance = new Foo; + assertEq(() => got.this, instance); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (private static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (private static setter).js new file mode 100644 index 000000000000..dbb0e2356a8b --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (private static setter).js @@ -0,0 +1,20 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (fn, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + static set #foo(x) { } + } + assertEq(() => got.this, Foo); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (static setter).js new file mode 100644 index 000000000000..ce1bdde646f6 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (static setter).js @@ -0,0 +1,20 @@ +(() => { + let oldAddInitializer; + let got; + const dec = (fn, ctx) => { + ctx.addInitializer(function (...args) { + got = { this: this, args }; + }); + if (oldAddInitializer) + assertThrows(() => oldAddInitializer(() => { }), TypeError); + assertThrows(() => ctx.addInitializer({}), TypeError); + oldAddInitializer = ctx.addInitializer; + }; + class Foo { + @dec + @dec + static set foo(x) { } + } + assertEq(() => got.this, Foo); + assertEq(() => got.args.length, 0); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (instance setter).js new file mode 100644 index 000000000000..2b757eeb680b --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (instance setter).js @@ -0,0 +1,32 @@ +(() => { + const log = []; + let bar; + let baz; + const dec1 = (fn, ctx) => { + log.push(2); + bar = function (x) { + log.push(4); + fn.call(this, x); + }; + return bar; + }; + const dec2 = (fn, ctx) => { + log.push(1); + baz = function (x) { + log.push(5); + fn.call(this, x); + }; + return baz; + }; + log.push(0); + class Foo { + @dec1 + @dec2 + set foo(x) { log.push(6); } + } + log.push(3); + new Foo().foo = 123; + log.push(7); + assertEq(() => Object.getOwnPropertyDescriptor(Foo.prototype, 'foo').set, bar); + assertEq(() => log + '', '0,1,2,3,4,5,6,7'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (private instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (private instance setter).js new file mode 100644 index 000000000000..3f4e3e80faa4 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (private instance setter).js @@ -0,0 +1,33 @@ +(() => { + const log = []; + let bar; + let baz; + const dec1 = (fn, ctx) => { + log.push(2); + bar = function (x) { + log.push(4); + fn.call(this, x); + }; + return bar; + }; + const dec2 = (fn, ctx) => { + log.push(1); + baz = function (x) { + log.push(5); + fn.call(this, x); + }; + return baz; + }; + log.push(0); + let set$foo; + class Foo { + @dec1 + @dec2 + set #foo(x) { log.push(6); } + static { set$foo = (x, y) => { x.#foo = y; }; } + } + log.push(3); + assertEq(() => set$foo(new Foo, 123), undefined); + log.push(7); + assertEq(() => log + '', '0,1,2,3,4,5,6,7'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (private static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (private static setter).js new file mode 100644 index 000000000000..aad1f43d1cfb --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (private static setter).js @@ -0,0 +1,33 @@ +(() => { + const log = []; + let bar; + let baz; + const dec1 = (fn, ctx) => { + log.push(2); + bar = function (x) { + log.push(4); + fn.call(this, x); + }; + return bar; + }; + const dec2 = (fn, ctx) => { + log.push(1); + baz = function (x) { + log.push(5); + fn.call(this, x); + }; + return baz; + }; + log.push(0); + let set$foo; + class Foo { + @dec1 + @dec2 + static set #foo(x) { log.push(6); } + static { set$foo = (x, y) => { x.#foo = y; }; } + } + log.push(3); + assertEq(() => set$foo(Foo, 123), undefined); + log.push(7); + assertEq(() => log + '', '0,1,2,3,4,5,6,7'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (static setter).js new file mode 100644 index 000000000000..92894352759b --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (static setter).js @@ -0,0 +1,32 @@ +(() => { + const log = []; + let bar; + let baz; + const dec1 = (fn, ctx) => { + log.push(2); + bar = function (x) { + log.push(4); + fn.call(this, x); + }; + return bar; + }; + const dec2 = (fn, ctx) => { + log.push(1); + baz = function (x) { + log.push(5); + fn.call(this, x); + }; + return baz; + }; + log.push(0); + class Foo { + @dec1 + @dec2 + static set foo(x) { log.push(6); } + } + log.push(3); + Foo.foo = 123; + log.push(7); + assertEq(() => Object.getOwnPropertyDescriptor(Foo, 'foo').set, bar); + assertEq(() => log + '', '0,1,2,3,4,5,6,7'); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (instance setter).js new file mode 100644 index 000000000000..05ead7aa91a6 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (instance setter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return null; + }; + class Foo { + @dec + set foo(x) { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (private instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (private instance setter).js new file mode 100644 index 000000000000..52ee36e7e89b --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (private instance setter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return null; + }; + class Foo { + @dec + set #foo(x) { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (private static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (private static setter).js new file mode 100644 index 000000000000..f317e6b81c12 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (private static setter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return null; + }; + class Foo { + @dec + static set #foo(x) { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (static setter).js new file mode 100644 index 000000000000..adfc4d9b1a53 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (static setter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return null; + }; + class Foo { + @dec + static set foo(x) { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (instance setter).js new file mode 100644 index 000000000000..4473707dc361 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (instance setter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return {}; + }; + class Foo { + @dec + set foo(x) { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (private instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (private instance setter).js new file mode 100644 index 000000000000..e2cefde534d7 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (private instance setter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return {}; + }; + class Foo { + @dec + set #foo(x) { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (private static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (private static setter).js new file mode 100644 index 000000000000..708de4bc0374 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (private static setter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return {}; + }; + class Foo { + @dec + static set #foo(x) { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (static setter).js new file mode 100644 index 000000000000..169349f88e5b --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (static setter).js @@ -0,0 +1,11 @@ +(() => { + assertThrows(() => { + const dec = (fn, ctx) => { + return {}; + }; + class Foo { + @dec + static set foo(x) { } + } + }, TypeError); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (instance setter).js new file mode 100644 index 000000000000..5ee4dd9722a2 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (instance setter).js @@ -0,0 +1,16 @@ +(() => { + let bar; + const dec = (fn, ctx) => { + bar = function (x) { fn.call(this, x + 1); }; + return bar; + }; + class Foo { + bar = 123; + @dec + set foo(x) { this.bar = x; } + } + assertEq(() => Object.getOwnPropertyDescriptor(Foo.prototype, 'foo').set, bar); + var obj = new Foo; + obj.foo = 321; + assertEq(() => obj.bar, 322); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (private instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (private instance setter).js new file mode 100644 index 000000000000..37e8890b79bb --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (private instance setter).js @@ -0,0 +1,17 @@ +(() => { + let bar; + const dec = (fn, ctx) => { + bar = function (x) { fn.call(this, x + 1); }; + return bar; + }; + let set$foo; + class Foo { + bar = 123; + @dec + set #foo(x) { this.bar = x; } + static { set$foo = (x, y) => { x.#foo = y; }; } + } + var obj = new Foo; + assertEq(() => set$foo(obj, 321), undefined); + assertEq(() => obj.bar, 322); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (private static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (private static setter).js new file mode 100644 index 000000000000..6e1d3e2e5a6c --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (private static setter).js @@ -0,0 +1,16 @@ +(() => { + let bar; + const dec = (fn, ctx) => { + bar = function (x) { fn.call(this, x + 1); }; + return bar; + }; + let set$foo; + class Foo { + static bar = 123; + @dec + static set #foo(x) { this.bar = x; } + static { set$foo = (x, y) => { x.#foo = y; }; } + } + assertEq(() => set$foo(Foo, 321), undefined); + assertEq(() => Foo.bar, 322); +})(); diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (static setter).js new file mode 100644 index 000000000000..a253493c78f9 --- /dev/null +++ b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (static setter).js @@ -0,0 +1,15 @@ +(() => { + let bar; + const dec = (fn, ctx) => { + bar = function (x) { fn.call(this, x + 1); }; + return bar; + }; + class Foo { + static bar = 123; + @dec + static set foo(x) { this.bar = x; } + } + assertEq(() => Object.getOwnPropertyDescriptor(Foo, 'foo').set, bar); + Foo.foo = 321; + assertEq(() => Foo.bar, 322); +})(); From 14b94bf9e444437481807d977c7b1af7e13bffb8 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, 1 Jul 2024 17:18:28 +0900 Subject: [PATCH 2/6] Rename --- .../scripts/split-decorator-tests.mjs | 2 +- ...> Auto-accessor decorators: Basic instance auto-accessor.js} | 0 ...ccessor decorators: Basic private instance auto-accessor.js} | 0 ...-accessor decorators: Basic private static auto-accessor.js} | 0 ... => Auto-accessor decorators: Basic static auto-accessor.js} | 0 ...sor decorators: Extra initializer instance auto-accessor.js} | 0 ...rators: Extra initializer private instance auto-accessor.js} | 0 ...corators: Extra initializer private static auto-accessor.js} | 0 ...essor decorators: Extra initializer static auto-accessor.js} | 0 ...-accessor decorators: Return null instance auto-accessor.js} | 0 ...r decorators: Return null private instance auto-accessor.js} | 0 ...sor decorators: Return null private static auto-accessor.js} | 0 ...to-accessor decorators: Return null static auto-accessor.js} | 0 ...=> Auto-accessor decorators: Shim instance auto-accessor.js} | 0 ...accessor decorators: Shim private instance auto-accessor.js} | 0 ...o-accessor decorators: Shim private static auto-accessor.js} | 0 ...s => Auto-accessor decorators: Shim static auto-accessor.js} | 0 .../Decorator list evaluation: \"await\" class expression.js" | 0 .../Decorator list evaluation: \"await\" class statement.js" | 0 .../Decorator list evaluation: \"this\" class expression.js" | 0 .../Decorator list evaluation: \"this\" class statement.js" | 0 ...ecorator list evaluation: Class binding class expression.js} | 0 ...Decorator list evaluation: Class binding class statement.js} | 0 ...corator list evaluation: Computed names class expression.js} | 0 ...ecorator list evaluation: Computed names class statement.js} | 0 ...tor list evaluation: Inner private name class expression.js} | 0 ...ator list evaluation: Inner private name class statement.js} | 0 ...tor list evaluation: Outer private name class expression.js} | 0 ...ator list evaluation: Outer private name class statement.js} | 0 ...ance field).js => Field decorators: Basic instance field.js} | 0 ...ld).js => Field decorators: Basic private instance field.js} | 0 ...ield).js => Field decorators: Basic private static field.js} | 0 ...static field).js => Field decorators: Basic static field.js} | 0 ...js => Field decorators: Extra initializer instance field.js} | 0 ...eld decorators: Extra initializer private instance field.js} | 0 ...Field decorators: Extra initializer private static field.js} | 0 ...).js => Field decorators: Extra initializer static field.js} | 0 ...ance field).js => Field decorators: Order instance field.js} | 0 ...ld).js => Field decorators: Order private instance field.js} | 0 ...ield).js => Field decorators: Order private static field.js} | 0 ...static field).js => Field decorators: Order static field.js} | 0 ...ield).js => Field decorators: Return null instance field.js} | 0 ... => Field decorators: Return null private instance field.js} | 0 ...js => Field decorators: Return null private static field.js} | 0 ... field).js => Field decorators: Return null static field.js} | 0 ...ld).js => Field decorators: Return object instance field.js} | 0 ...> Field decorators: Return object private instance field.js} | 0 ... => Field decorators: Return object private static field.js} | 0 ...ield).js => Field decorators: Return object static field.js} | 0 ...tance field).js => Field decorators: Shim instance field.js} | 0 ...eld).js => Field decorators: Shim private instance field.js} | 0 ...field).js => Field decorators: Shim private static field.js} | 0 ...(static field).js => Field decorators: Shim static field.js} | 0 ...e getter).js => Getter decorators: Basic instance getter.js} | 0 ...).js => Getter decorators: Basic private instance getter.js} | 0 ...er).js => Getter decorators: Basic private static getter.js} | 0 ...tic getter).js => Getter decorators: Basic static getter.js} | 0 ... => Getter decorators: Extra initializer instance getter.js} | 0 ...er decorators: Extra initializer private instance getter.js} | 0 ...tter decorators: Extra initializer private static getter.js} | 0 ...js => Getter decorators: Extra initializer static getter.js} | 0 ...e getter).js => Getter decorators: Order instance getter.js} | 0 ...).js => Getter decorators: Order private instance getter.js} | 0 ...er).js => Getter decorators: Order private static getter.js} | 0 ...tic getter).js => Getter decorators: Order static getter.js} | 0 ...er).js => Getter decorators: Return null instance getter.js} | 0 ...> Getter decorators: Return null private instance getter.js} | 0 ... => Getter decorators: Return null private static getter.js} | 0 ...tter).js => Getter decorators: Return null static getter.js} | 0 ...).js => Getter decorators: Return object instance getter.js} | 0 ...Getter decorators: Return object private instance getter.js} | 0 ...> Getter decorators: Return object private static getter.js} | 0 ...er).js => Getter decorators: Return object static getter.js} | 0 ...ce getter).js => Getter decorators: Shim instance getter.js} | 0 ...r).js => Getter decorators: Shim private instance getter.js} | 0 ...ter).js => Getter decorators: Shim private static getter.js} | 0 ...atic getter).js => Getter decorators: Shim static getter.js} | 0 ...s => Initializer order private members, class expression.js} | 0 ...js => Initializer order private members, class statement.js} | 0 ...js => Initializer order public members, class expression.js} | 0 ....js => Initializer order public members, class statement.js} | 0 ...e method).js => Method decorators: Basic instance method.js} | 0 ...).js => Method decorators: Basic private instance method.js} | 0 ...od).js => Method decorators: Basic private static method.js} | 0 ...tic method).js => Method decorators: Basic static method.js} | 0 ... => Method decorators: Extra initializer instance method.js} | 0 ...od decorators: Extra initializer private instance method.js} | 0 ...thod decorators: Extra initializer private static method.js} | 0 ...js => Method decorators: Extra initializer static method.js} | 0 ...e method).js => Method decorators: Order instance method.js} | 0 ...).js => Method decorators: Order private instance method.js} | 0 ...od).js => Method decorators: Order private static method.js} | 0 ...tic method).js => Method decorators: Order static method.js} | 0 ...od).js => Method decorators: Return null instance method.js} | 0 ...> Method decorators: Return null private instance method.js} | 0 ... => Method decorators: Return null private static method.js} | 0 ...thod).js => Method decorators: Return null static method.js} | 0 ...).js => Method decorators: Return object instance method.js} | 0 ...Method decorators: Return object private instance method.js} | 0 ...> Method decorators: Return object private static method.js} | 0 ...od).js => Method decorators: Return object static method.js} | 0 ...ce method).js => Method decorators: Shim instance method.js} | 0 ...d).js => Method decorators: Shim private instance method.js} | 0 ...hod).js => Method decorators: Shim private static method.js} | 0 ...atic method).js => Method decorators: Shim static method.js} | 0 ...e setter).js => Setter decorators: Basic instance setter.js} | 0 ...).js => Setter decorators: Basic private instance setter.js} | 0 ...er).js => Setter decorators: Basic private static setter.js} | 0 ...tic setter).js => Setter decorators: Basic static setter.js} | 0 ... => Setter decorators: Extra initializer instance setter.js} | 0 ...er decorators: Extra initializer private instance setter.js} | 0 ...tter decorators: Extra initializer private static setter.js} | 0 ...js => Setter decorators: Extra initializer static setter.js} | 0 ...e setter).js => Setter decorators: Order instance setter.js} | 0 ...).js => Setter decorators: Order private instance setter.js} | 0 ...er).js => Setter decorators: Order private static setter.js} | 0 ...tic setter).js => Setter decorators: Order static setter.js} | 0 ...er).js => Setter decorators: Return null instance setter.js} | 0 ...> Setter decorators: Return null private instance setter.js} | 0 ... => Setter decorators: Return null private static setter.js} | 0 ...tter).js => Setter decorators: Return null static setter.js} | 0 ...).js => Setter decorators: Return object instance setter.js} | 0 ...Setter decorators: Return object private instance setter.js} | 0 ...> Setter decorators: Return object private static setter.js} | 0 ...er).js => Setter decorators: Return object static setter.js} | 0 ...ce setter).js => Setter decorators: Shim instance setter.js} | 0 ...r).js => Setter decorators: Shim private instance setter.js} | 0 ...ter).js => Setter decorators: Shim private static setter.js} | 0 ...atic setter).js => Setter decorators: Shim static setter.js} | 0 129 files changed, 1 insertion(+), 1 deletion(-) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Basic (instance auto-accessor).js => Auto-accessor decorators: Basic instance auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Basic (private instance auto-accessor).js => Auto-accessor decorators: Basic private instance auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Basic (private static auto-accessor).js => Auto-accessor decorators: Basic private static auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Basic (static auto-accessor).js => Auto-accessor decorators: Basic static auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Extra initializer (instance auto-accessor).js => Auto-accessor decorators: Extra initializer instance auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Extra initializer (private instance auto-accessor).js => Auto-accessor decorators: Extra initializer private instance auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Extra initializer (private static auto-accessor).js => Auto-accessor decorators: Extra initializer private static auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Extra initializer (static auto-accessor).js => Auto-accessor decorators: Extra initializer static auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Return null (instance auto-accessor).js => Auto-accessor decorators: Return null instance auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Return null (private instance auto-accessor).js => Auto-accessor decorators: Return null private instance auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Return null (private static auto-accessor).js => Auto-accessor decorators: Return null private static auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Return null (static auto-accessor).js => Auto-accessor decorators: Return null static auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Shim (instance auto-accessor).js => Auto-accessor decorators: Shim instance auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Shim (private instance auto-accessor).js => Auto-accessor decorators: Shim private instance auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Shim (private static auto-accessor).js => Auto-accessor decorators: Shim private static auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Shim (static auto-accessor).js => Auto-accessor decorators: Shim static auto-accessor.js} (100%) rename "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" (class expression).js" => "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" class expression.js" (100%) rename "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" (class statement).js" => "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" class statement.js" (100%) rename "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" (class expression).js" => "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" class expression.js" (100%) rename "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" (class statement).js" => "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" class statement.js" (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Class binding (class expression).js => Decorator list evaluation: Class binding class expression.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Class binding (class statement).js => Decorator list evaluation: Class binding class statement.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Computed names (class expression).js => Decorator list evaluation: Computed names class expression.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Computed names (class statement).js => Decorator list evaluation: Computed names class statement.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Inner private name (class expression).js => Decorator list evaluation: Inner private name class expression.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Inner private name (class statement).js => Decorator list evaluation: Inner private name class statement.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Outer private name (class expression).js => Decorator list evaluation: Outer private name class expression.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Outer private name (class statement).js => Decorator list evaluation: Outer private name class statement.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Basic (instance field).js => Field decorators: Basic instance field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Basic (private instance field).js => Field decorators: Basic private instance field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Basic (private static field).js => Field decorators: Basic private static field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Basic (static field).js => Field decorators: Basic static field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Extra initializer (instance field).js => Field decorators: Extra initializer instance field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Extra initializer (private instance field).js => Field decorators: Extra initializer private instance field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Extra initializer (private static field).js => Field decorators: Extra initializer private static field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Extra initializer (static field).js => Field decorators: Extra initializer static field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Order (instance field).js => Field decorators: Order instance field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Order (private instance field).js => Field decorators: Order private instance field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Order (private static field).js => Field decorators: Order private static field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Order (static field).js => Field decorators: Order static field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return null (instance field).js => Field decorators: Return null instance field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return null (private instance field).js => Field decorators: Return null private instance field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return null (private static field).js => Field decorators: Return null private static field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return null (static field).js => Field decorators: Return null static field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return object (instance field).js => Field decorators: Return object instance field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return object (private instance field).js => Field decorators: Return object private instance field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return object (private static field).js => Field decorators: Return object private static field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return object (static field).js => Field decorators: Return object static field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Shim (instance field).js => Field decorators: Shim instance field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Shim (private instance field).js => Field decorators: Shim private instance field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Shim (private static field).js => Field decorators: Shim private static field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Shim (static field).js => Field decorators: Shim static field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Basic (instance getter).js => Getter decorators: Basic instance getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Basic (private instance getter).js => Getter decorators: Basic private instance getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Basic (private static getter).js => Getter decorators: Basic private static getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Basic (static getter).js => Getter decorators: Basic static getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Extra initializer (instance getter).js => Getter decorators: Extra initializer instance getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Extra initializer (private instance getter).js => Getter decorators: Extra initializer private instance getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Extra initializer (private static getter).js => Getter decorators: Extra initializer private static getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Extra initializer (static getter).js => Getter decorators: Extra initializer static getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Order (instance getter).js => Getter decorators: Order instance getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Order (private instance getter).js => Getter decorators: Order private instance getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Order (private static getter).js => Getter decorators: Order private static getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Order (static getter).js => Getter decorators: Order static getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return null (instance getter).js => Getter decorators: Return null instance getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return null (private instance getter).js => Getter decorators: Return null private instance getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return null (private static getter).js => Getter decorators: Return null private static getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return null (static getter).js => Getter decorators: Return null static getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return object (instance getter).js => Getter decorators: Return object instance getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return object (private instance getter).js => Getter decorators: Return object private instance getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return object (private static getter).js => Getter decorators: Return object private static getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return object (static getter).js => Getter decorators: Return object static getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Shim (instance getter).js => Getter decorators: Shim instance getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Shim (private instance getter).js => Getter decorators: Shim private instance getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Shim (private static getter).js => Getter decorators: Shim private static getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Shim (static getter).js => Getter decorators: Shim static getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Initializer order (private members, class expression).js => Initializer order private members, class expression.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Initializer order (private members, class statement).js => Initializer order private members, class statement.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Initializer order (public members, class expression).js => Initializer order public members, class expression.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Initializer order (public members, class statement).js => Initializer order public members, class statement.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Basic (instance method).js => Method decorators: Basic instance method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Basic (private instance method).js => Method decorators: Basic private instance method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Basic (private static method).js => Method decorators: Basic private static method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Basic (static method).js => Method decorators: Basic static method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Extra initializer (instance method).js => Method decorators: Extra initializer instance method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Extra initializer (private instance method).js => Method decorators: Extra initializer private instance method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Extra initializer (private static method).js => Method decorators: Extra initializer private static method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Extra initializer (static method).js => Method decorators: Extra initializer static method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Order (instance method).js => Method decorators: Order instance method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Order (private instance method).js => Method decorators: Order private instance method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Order (private static method).js => Method decorators: Order private static method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Order (static method).js => Method decorators: Order static method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return null (instance method).js => Method decorators: Return null instance method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return null (private instance method).js => Method decorators: Return null private instance method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return null (private static method).js => Method decorators: Return null private static method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return null (static method).js => Method decorators: Return null static method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return object (instance method).js => Method decorators: Return object instance method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return object (private instance method).js => Method decorators: Return object private instance method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return object (private static method).js => Method decorators: Return object private static method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return object (static method).js => Method decorators: Return object static method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Shim (instance method).js => Method decorators: Shim instance method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Shim (private instance method).js => Method decorators: Shim private instance method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Shim (private static method).js => Method decorators: Shim private static method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Shim (static method).js => Method decorators: Shim static method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Basic (instance setter).js => Setter decorators: Basic instance setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Basic (private instance setter).js => Setter decorators: Basic private instance setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Basic (private static setter).js => Setter decorators: Basic private static setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Basic (static setter).js => Setter decorators: Basic static setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Extra initializer (instance setter).js => Setter decorators: Extra initializer instance setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Extra initializer (private instance setter).js => Setter decorators: Extra initializer private instance setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Extra initializer (private static setter).js => Setter decorators: Extra initializer private static setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Extra initializer (static setter).js => Setter decorators: Extra initializer static setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Order (instance setter).js => Setter decorators: Order instance setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Order (private instance setter).js => Setter decorators: Order private instance setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Order (private static setter).js => Setter decorators: Order private static setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Order (static setter).js => Setter decorators: Order static setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return null (instance setter).js => Setter decorators: Return null instance setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return null (private instance setter).js => Setter decorators: Return null private instance setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return null (private static setter).js => Setter decorators: Return null private static setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return null (static setter).js => Setter decorators: Return null static setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return object (instance setter).js => Setter decorators: Return object instance setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return object (private instance setter).js => Setter decorators: Return object private instance setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return object (private static setter).js => Setter decorators: Return object private static setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return object (static setter).js => Setter decorators: Return object static setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Shim (instance setter).js => Setter decorators: Shim instance setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Shim (private instance setter).js => Setter decorators: Shim private instance setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Shim (private static setter).js => Setter decorators: Shim private static setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Shim (static setter).js => Setter decorators: Shim static setter.js} (100%) diff --git a/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs b/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs index 09318d745800..77c19e02cfa9 100644 --- a/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs +++ b/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs @@ -31,7 +31,7 @@ for (const property of properties) { let name = property.name.getText(mainFile) const value = property.initializer.getText(mainFile) - name = name.replace(/'/g, '') + name = name.replace(/['\(\)]+/g, '') // console.log('name', name) // console.log('value', value) diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic instance auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (instance auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic instance auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (private instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic private instance auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (private instance auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic private instance auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (private static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic private static auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (private static auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic private static auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic static auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic (static auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic static auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer instance auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (instance auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer instance auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (private instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer private instance auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (private instance auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer private instance auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (private static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer private static auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (private static auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer private static auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer static auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer (static auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer static auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null instance auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (instance auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null instance auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (private instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null private instance auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (private instance auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null private instance auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (private static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null private static auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (private static auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null private static auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null static auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null (static auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null static auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim instance auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (instance auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim instance auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (private instance auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim private instance auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (private instance auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim private instance auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (private static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim private static auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (private static auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim private static auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (static auto-accessor).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim static auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim (static auto-accessor).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim static auto-accessor.js diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" (class expression).js" "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" class expression.js" similarity index 100% rename from "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" (class expression).js" rename to "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" class expression.js" diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" (class statement).js" "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" class statement.js" similarity index 100% rename from "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" (class statement).js" rename to "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" class statement.js" diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" (class expression).js" "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" class expression.js" similarity index 100% rename from "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" (class expression).js" rename to "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" class expression.js" diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" (class statement).js" "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" class statement.js" similarity index 100% rename from "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" (class statement).js" rename to "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" class statement.js" diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding (class expression).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding class expression.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding (class expression).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding class expression.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding (class statement).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding class statement.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding (class statement).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding class statement.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names (class expression).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names class expression.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names (class expression).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names class expression.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names (class statement).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names class statement.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names (class statement).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names class statement.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name (class expression).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name class expression.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name (class expression).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name class expression.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name (class statement).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name class statement.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name (class statement).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name class statement.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name (class expression).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name class expression.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name (class expression).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name class expression.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name (class statement).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name class statement.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name (class statement).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name class statement.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic instance field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (instance field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic instance field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (private instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic private instance field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (private instance field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic private instance field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (private static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic private static field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (private static field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic private static field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic static field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic (static field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic static field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer instance field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (instance field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer instance field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (private instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer private instance field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (private instance field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer private instance field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (private static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer private static field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (private static field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer private static field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer static field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer (static field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer static field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order instance field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (instance field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order instance field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (private instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order private instance field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (private instance field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order private instance field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (private static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order private static field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (private static field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order private static field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order static field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order (static field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order static field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null instance field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (instance field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null instance field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (private instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null private instance field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (private instance field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null private instance field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (private static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null private static field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (private static field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null private static field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null static field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null (static field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null static field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object instance field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (instance field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object instance field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (private instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object private instance field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (private instance field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object private instance field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (private static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object private static field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (private static field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object private static field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object static field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object (static field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object static field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim instance field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (instance field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim instance field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (private instance field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim private instance field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (private instance field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim private instance field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (private static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim private static field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (private static field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim private static field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (static field).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim static field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim (static field).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim static field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic instance getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (instance getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic instance getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (private instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic private instance getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (private instance getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic private instance getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (private static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic private static getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (private static getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic private static getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic static getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic (static getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic static getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer instance getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (instance getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer instance getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (private instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer private instance getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (private instance getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer private instance getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (private static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer private static getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (private static getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer private static getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer static getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer (static getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer static getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order instance getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (instance getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order instance getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (private instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order private instance getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (private instance getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order private instance getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (private static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order private static getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (private static getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order private static getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order static getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order (static getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order static getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null instance getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (instance getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null instance getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (private instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null private instance getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (private instance getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null private instance getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (private static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null private static getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (private static getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null private static getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null static getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null (static getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null static getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object instance getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (instance getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object instance getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (private instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object private instance getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (private instance getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object private instance getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (private static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object private static getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (private static getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object private static getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object static getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object (static getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object static getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim instance getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (instance getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim instance getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (private instance getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim private instance getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (private instance getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim private instance getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (private static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim private static getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (private static getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim private static getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (static getter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim static getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim (static getter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim static getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (private members, class expression).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order private members, class expression.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (private members, class expression).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order private members, class expression.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (private members, class statement).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order private members, class statement.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (private members, class statement).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order private members, class statement.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (public members, class expression).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order public members, class expression.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (public members, class expression).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order public members, class expression.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (public members, class statement).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order public members, class statement.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order (public members, class statement).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order public members, class statement.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic instance method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (instance method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic instance method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (private instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic private instance method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (private instance method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic private instance method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (private static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic private static method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (private static method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic private static method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic static method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic (static method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic static method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer instance method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (instance method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer instance method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (private instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer private instance method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (private instance method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer private instance method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (private static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer private static method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (private static method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer private static method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer static method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer (static method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer static method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order instance method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (instance method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order instance method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (private instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order private instance method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (private instance method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order private instance method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (private static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order private static method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (private static method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order private static method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order static method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order (static method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order static method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null instance method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (instance method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null instance method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (private instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null private instance method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (private instance method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null private instance method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (private static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null private static method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (private static method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null private static method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null static method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null (static method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null static method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object instance method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (instance method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object instance method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (private instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object private instance method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (private instance method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object private instance method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (private static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object private static method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (private static method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object private static method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object static method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object (static method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object static method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim instance method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (instance method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim instance method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (private instance method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim private instance method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (private instance method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim private instance method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (private static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim private static method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (private static method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim private static method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (static method).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim static method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim (static method).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim static method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic instance setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (instance setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic instance setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (private instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic private instance setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (private instance setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic private instance setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (private static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic private static setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (private static setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic private static setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic static setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic (static setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic static setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer instance setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (instance setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer instance setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (private instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer private instance setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (private instance setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer private instance setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (private static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer private static setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (private static setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer private static setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer static setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer (static setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer static setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order instance setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (instance setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order instance setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (private instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order private instance setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (private instance setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order private instance setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (private static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order private static setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (private static setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order private static setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order static setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order (static setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order static setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null instance setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (instance setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null instance setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (private instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null private instance setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (private instance setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null private instance setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (private static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null private static setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (private static setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null private static setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null static setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null (static setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null static setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object instance setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (instance setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object instance setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (private instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object private instance setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (private instance setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object private instance setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (private static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object private static setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (private static setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object private static setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object static setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object (static setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object static setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim instance setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (instance setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim instance setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (private instance setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim private instance setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (private instance setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim private instance setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (private static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim private static setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (private static setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim private static setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (static setter).js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim static setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim (static setter).js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim static setter.js From 6fc4fd8777534d644a56bd7242990edcb835c826 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, 1 Jul 2024 17:38:48 +0900 Subject: [PATCH 3/6] Rename --- .../scripts/split-decorator-tests.mjs | 2 +- ...=> Auto-accessor-decorators-Basic-instance-auto-accessor.js} | 0 ...accessor-decorators-Basic-private-instance-auto-accessor.js} | 0 ...o-accessor-decorators-Basic-private-static-auto-accessor.js} | 0 ...s => Auto-accessor-decorators-Basic-static-auto-accessor.js} | 0 ...ssor-decorators-Extra-initializer-instance-auto-accessor.js} | 0 ...orators-Extra-initializer-private-instance-auto-accessor.js} | 0 ...ecorators-Extra-initializer-private-static-auto-accessor.js} | 0 ...cessor-decorators-Extra-initializer-static-auto-accessor.js} | 0 ...o-accessor-decorators-Return-null-instance-auto-accessor.js} | 0 ...or-decorators-Return-null-private-instance-auto-accessor.js} | 0 ...ssor-decorators-Return-null-private-static-auto-accessor.js} | 0 ...uto-accessor-decorators-Return-null-static-auto-accessor.js} | 0 ... => Auto-accessor-decorators-Shim-instance-auto-accessor.js} | 0 ...-accessor-decorators-Shim-private-instance-auto-accessor.js} | 0 ...to-accessor-decorators-Shim-private-static-auto-accessor.js} | 0 ...js => Auto-accessor-decorators-Shim-static-auto-accessor.js} | 0 ...nymous.js => Class-decorators-Basic-expression-Anonymous.js} | 0 ...ng.js => Class-decorators-Basic-expression-Array-binding.js} | 0 ...ass-decorators-Basic-expression-Assignment-array-binding.js} | 0 ...Class-decorators-Basic-expression-Assignment-initializer.js} | 0 ...ss-decorators-Basic-expression-Assignment-object-binding.js} | 0 ...tors-Basic-expression-Instance-auto-accessor-initializer.js} | 0 ...s-decorators-Basic-expression-Instance-field-initializer.js} | 0 ...g.js => Class-decorators-Basic-expression-Object-binding.js} | 0 ...e.js => Class-decorators-Basic-expression-Property-value.js} | 0 ...rators-Basic-expression-Static-auto-accessor-initializer.js} | 0 ...ass-decorators-Basic-expression-Static-field-initializer.js} | 0 ...> Class-decorators-Basic-expression-Variable-initializer.js} | 0 ...: Basic statement.js => Class-decorators-Basic-statement.js} | 0 ...tra initializer.js => Class-decorators-Extra-initializer.js} | 0 .../{Class decorators: Order.js => Class-decorators-Order.js} | 0 ...corators: Return null.js => Class-decorators-Return-null.js} | 0 ...tors: Return object.js => Class-decorators-Return-object.js} | 0 .../Decorator-list-evaluation-\"await\"-class-expression.js" | 0 .../Decorator-list-evaluation-\"await\"-class-statement.js" | 0 .../Decorator-list-evaluation-\"this\"-class-expression.js" | 0 .../Decorator-list-evaluation-\"this\"-class-statement.js" | 0 ...Decorator-list-evaluation-Class-binding-class-expression.js} | 0 ... Decorator-list-evaluation-Class-binding-class-statement.js} | 0 ...ecorator-list-evaluation-Computed-names-class-expression.js} | 0 ...Decorator-list-evaluation-Computed-names-class-statement.js} | 0 ...ator-list-evaluation-Inner-private-name-class-expression.js} | 0 ...rator-list-evaluation-Inner-private-name-class-statement.js} | 0 ...ator-list-evaluation-Outer-private-name-class-expression.js} | 0 ...rator-list-evaluation-Outer-private-name-class-statement.js} | 0 ...ass expression.js => Decorator-metadata-class-expression.js} | 0 ...class statement.js => Decorator-metadata-class-statement.js} | 0 ...stance field.js => Field-decorators-Basic-instance-field.js} | 0 ...ield.js => Field-decorators-Basic-private-instance-field.js} | 0 ... field.js => Field-decorators-Basic-private-static-field.js} | 0 ...c static field.js => Field-decorators-Basic-static-field.js} | 0 ....js => Field-decorators-Extra-initializer-instance-field.js} | 0 ...ield-decorators-Extra-initializer-private-instance-field.js} | 0 ... Field-decorators-Extra-initializer-private-static-field.js} | 0 ...ld.js => Field-decorators-Extra-initializer-static-field.js} | 0 ...stance field.js => Field-decorators-Order-instance-field.js} | 0 ...ield.js => Field-decorators-Order-private-instance-field.js} | 0 ... field.js => Field-decorators-Order-private-static-field.js} | 0 ...r static field.js => Field-decorators-Order-static-field.js} | 0 ... field.js => Field-decorators-Return-null-instance-field.js} | 0 ...s => Field-decorators-Return-null-private-instance-field.js} | 0 ....js => Field-decorators-Return-null-private-static-field.js} | 0 ...ic field.js => Field-decorators-Return-null-static-field.js} | 0 ...ield.js => Field-decorators-Return-object-instance-field.js} | 0 ...=> Field-decorators-Return-object-private-instance-field.js} | 0 ...s => Field-decorators-Return-object-private-static-field.js} | 0 ... field.js => Field-decorators-Return-object-static-field.js} | 0 ...nstance field.js => Field-decorators-Shim-instance-field.js} | 0 ...field.js => Field-decorators-Shim-private-instance-field.js} | 0 ...c field.js => Field-decorators-Shim-private-static-field.js} | 0 ...im static field.js => Field-decorators-Shim-static-field.js} | 0 ...nce getter.js => Getter-decorators-Basic-instance-getter.js} | 0 ...er.js => Getter-decorators-Basic-private-instance-getter.js} | 0 ...tter.js => Getter-decorators-Basic-private-static-getter.js} | 0 ...tatic getter.js => Getter-decorators-Basic-static-getter.js} | 0 ...s => Getter-decorators-Extra-initializer-instance-getter.js} | 0 ...ter-decorators-Extra-initializer-private-instance-getter.js} | 0 ...etter-decorators-Extra-initializer-private-static-getter.js} | 0 ....js => Getter-decorators-Extra-initializer-static-getter.js} | 0 ...nce getter.js => Getter-decorators-Order-instance-getter.js} | 0 ...er.js => Getter-decorators-Order-private-instance-getter.js} | 0 ...tter.js => Getter-decorators-Order-private-static-getter.js} | 0 ...tatic getter.js => Getter-decorators-Order-static-getter.js} | 0 ...tter.js => Getter-decorators-Return-null-instance-getter.js} | 0 ...=> Getter-decorators-Return-null-private-instance-getter.js} | 0 ...s => Getter-decorators-Return-null-private-static-getter.js} | 0 ...getter.js => Getter-decorators-Return-null-static-getter.js} | 0 ...er.js => Getter-decorators-Return-object-instance-getter.js} | 0 ... Getter-decorators-Return-object-private-instance-getter.js} | 0 ...=> Getter-decorators-Return-object-private-static-getter.js} | 0 ...tter.js => Getter-decorators-Return-object-static-getter.js} | 0 ...ance getter.js => Getter-decorators-Shim-instance-getter.js} | 0 ...ter.js => Getter-decorators-Shim-private-instance-getter.js} | 0 ...etter.js => Getter-decorators-Shim-private-static-getter.js} | 0 ...static getter.js => Getter-decorators-Shim-static-getter.js} | 0 ...s => Initializer-order-private-members,-class-expression.js} | 0 ...js => Initializer-order-private-members,-class-statement.js} | 0 ...js => Initializer-order-public-members,-class-expression.js} | 0 ....js => Initializer-order-public-members,-class-statement.js} | 0 ...nce method.js => Method-decorators-Basic-instance-method.js} | 0 ...od.js => Method-decorators-Basic-private-instance-method.js} | 0 ...thod.js => Method-decorators-Basic-private-static-method.js} | 0 ...tatic method.js => Method-decorators-Basic-static-method.js} | 0 ...s => Method-decorators-Extra-initializer-instance-method.js} | 0 ...hod-decorators-Extra-initializer-private-instance-method.js} | 0 ...ethod-decorators-Extra-initializer-private-static-method.js} | 0 ....js => Method-decorators-Extra-initializer-static-method.js} | 0 ...nce method.js => Method-decorators-Order-instance-method.js} | 0 ...od.js => Method-decorators-Order-private-instance-method.js} | 0 ...thod.js => Method-decorators-Order-private-static-method.js} | 0 ...tatic method.js => Method-decorators-Order-static-method.js} | 0 ...thod.js => Method-decorators-Return-null-instance-method.js} | 0 ...=> Method-decorators-Return-null-private-instance-method.js} | 0 ...s => Method-decorators-Return-null-private-static-method.js} | 0 ...method.js => Method-decorators-Return-null-static-method.js} | 0 ...od.js => Method-decorators-Return-object-instance-method.js} | 0 ... Method-decorators-Return-object-private-instance-method.js} | 0 ...=> Method-decorators-Return-object-private-static-method.js} | 0 ...thod.js => Method-decorators-Return-object-static-method.js} | 0 ...ance method.js => Method-decorators-Shim-instance-method.js} | 0 ...hod.js => Method-decorators-Shim-private-instance-method.js} | 0 ...ethod.js => Method-decorators-Shim-private-static-method.js} | 0 ...static method.js => Method-decorators-Shim-static-method.js} | 0 ...nce setter.js => Setter-decorators-Basic-instance-setter.js} | 0 ...er.js => Setter-decorators-Basic-private-instance-setter.js} | 0 ...tter.js => Setter-decorators-Basic-private-static-setter.js} | 0 ...tatic setter.js => Setter-decorators-Basic-static-setter.js} | 0 ...s => Setter-decorators-Extra-initializer-instance-setter.js} | 0 ...ter-decorators-Extra-initializer-private-instance-setter.js} | 0 ...etter-decorators-Extra-initializer-private-static-setter.js} | 0 ....js => Setter-decorators-Extra-initializer-static-setter.js} | 0 ...nce setter.js => Setter-decorators-Order-instance-setter.js} | 0 ...er.js => Setter-decorators-Order-private-instance-setter.js} | 0 ...tter.js => Setter-decorators-Order-private-static-setter.js} | 0 ...tatic setter.js => Setter-decorators-Order-static-setter.js} | 0 ...tter.js => Setter-decorators-Return-null-instance-setter.js} | 0 ...=> Setter-decorators-Return-null-private-instance-setter.js} | 0 ...s => Setter-decorators-Return-null-private-static-setter.js} | 0 ...setter.js => Setter-decorators-Return-null-static-setter.js} | 0 ...er.js => Setter-decorators-Return-object-instance-setter.js} | 0 ... Setter-decorators-Return-object-private-instance-setter.js} | 0 ...=> Setter-decorators-Return-object-private-static-setter.js} | 0 ...tter.js => Setter-decorators-Return-object-static-setter.js} | 0 ...ance setter.js => Setter-decorators-Shim-instance-setter.js} | 0 ...ter.js => Setter-decorators-Shim-private-instance-setter.js} | 0 ...etter.js => Setter-decorators-Shim-private-static-setter.js} | 0 ...static setter.js => Setter-decorators-Shim-static-setter.js} | 0 148 files changed, 1 insertion(+), 1 deletion(-) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Basic instance auto-accessor.js => Auto-accessor-decorators-Basic-instance-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Basic private instance auto-accessor.js => Auto-accessor-decorators-Basic-private-instance-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Basic private static auto-accessor.js => Auto-accessor-decorators-Basic-private-static-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Basic static auto-accessor.js => Auto-accessor-decorators-Basic-static-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Extra initializer instance auto-accessor.js => Auto-accessor-decorators-Extra-initializer-instance-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Extra initializer private instance auto-accessor.js => Auto-accessor-decorators-Extra-initializer-private-instance-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Extra initializer private static auto-accessor.js => Auto-accessor-decorators-Extra-initializer-private-static-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Extra initializer static auto-accessor.js => Auto-accessor-decorators-Extra-initializer-static-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Return null instance auto-accessor.js => Auto-accessor-decorators-Return-null-instance-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Return null private instance auto-accessor.js => Auto-accessor-decorators-Return-null-private-instance-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Return null private static auto-accessor.js => Auto-accessor-decorators-Return-null-private-static-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Return null static auto-accessor.js => Auto-accessor-decorators-Return-null-static-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Shim instance auto-accessor.js => Auto-accessor-decorators-Shim-instance-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Shim private instance auto-accessor.js => Auto-accessor-decorators-Shim-private-instance-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Shim private static auto-accessor.js => Auto-accessor-decorators-Shim-private-static-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Auto-accessor decorators: Shim static auto-accessor.js => Auto-accessor-decorators-Shim-static-auto-accessor.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Basic expression: Anonymous.js => Class-decorators-Basic-expression-Anonymous.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Basic expression: Array binding.js => Class-decorators-Basic-expression-Array-binding.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Basic expression: Assignment array binding.js => Class-decorators-Basic-expression-Assignment-array-binding.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Basic expression: Assignment initializer.js => Class-decorators-Basic-expression-Assignment-initializer.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Basic expression: Assignment object binding.js => Class-decorators-Basic-expression-Assignment-object-binding.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Basic expression: Instance auto-accessor initializer.js => Class-decorators-Basic-expression-Instance-auto-accessor-initializer.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Basic expression: Instance field initializer.js => Class-decorators-Basic-expression-Instance-field-initializer.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Basic expression: Object binding.js => Class-decorators-Basic-expression-Object-binding.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Basic expression: Property value.js => Class-decorators-Basic-expression-Property-value.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Basic expression: Static auto-accessor initializer.js => Class-decorators-Basic-expression-Static-auto-accessor-initializer.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Basic expression: Static field initializer.js => Class-decorators-Basic-expression-Static-field-initializer.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Basic expression: Variable initializer.js => Class-decorators-Basic-expression-Variable-initializer.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Basic statement.js => Class-decorators-Basic-statement.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Extra initializer.js => Class-decorators-Extra-initializer.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Order.js => Class-decorators-Order.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Return null.js => Class-decorators-Return-null.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Class decorators: Return object.js => Class-decorators-Return-object.js} (100%) rename "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" class expression.js" => "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"await\"-class-expression.js" (100%) rename "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" class statement.js" => "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"await\"-class-statement.js" (100%) rename "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" class expression.js" => "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"this\"-class-expression.js" (100%) rename "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" class statement.js" => "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"this\"-class-statement.js" (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Class binding class expression.js => Decorator-list-evaluation-Class-binding-class-expression.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Class binding class statement.js => Decorator-list-evaluation-Class-binding-class-statement.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Computed names class expression.js => Decorator-list-evaluation-Computed-names-class-expression.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Computed names class statement.js => Decorator-list-evaluation-Computed-names-class-statement.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Inner private name class expression.js => Decorator-list-evaluation-Inner-private-name-class-expression.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Inner private name class statement.js => Decorator-list-evaluation-Inner-private-name-class-statement.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Outer private name class expression.js => Decorator-list-evaluation-Outer-private-name-class-expression.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator list evaluation: Outer private name class statement.js => Decorator-list-evaluation-Outer-private-name-class-statement.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator metadata: class expression.js => Decorator-metadata-class-expression.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Decorator metadata: class statement.js => Decorator-metadata-class-statement.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Basic instance field.js => Field-decorators-Basic-instance-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Basic private instance field.js => Field-decorators-Basic-private-instance-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Basic private static field.js => Field-decorators-Basic-private-static-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Basic static field.js => Field-decorators-Basic-static-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Extra initializer instance field.js => Field-decorators-Extra-initializer-instance-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Extra initializer private instance field.js => Field-decorators-Extra-initializer-private-instance-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Extra initializer private static field.js => Field-decorators-Extra-initializer-private-static-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Extra initializer static field.js => Field-decorators-Extra-initializer-static-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Order instance field.js => Field-decorators-Order-instance-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Order private instance field.js => Field-decorators-Order-private-instance-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Order private static field.js => Field-decorators-Order-private-static-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Order static field.js => Field-decorators-Order-static-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return null instance field.js => Field-decorators-Return-null-instance-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return null private instance field.js => Field-decorators-Return-null-private-instance-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return null private static field.js => Field-decorators-Return-null-private-static-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return null static field.js => Field-decorators-Return-null-static-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return object instance field.js => Field-decorators-Return-object-instance-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return object private instance field.js => Field-decorators-Return-object-private-instance-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return object private static field.js => Field-decorators-Return-object-private-static-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Return object static field.js => Field-decorators-Return-object-static-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Shim instance field.js => Field-decorators-Shim-instance-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Shim private instance field.js => Field-decorators-Shim-private-instance-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Shim private static field.js => Field-decorators-Shim-private-static-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Field decorators: Shim static field.js => Field-decorators-Shim-static-field.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Basic instance getter.js => Getter-decorators-Basic-instance-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Basic private instance getter.js => Getter-decorators-Basic-private-instance-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Basic private static getter.js => Getter-decorators-Basic-private-static-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Basic static getter.js => Getter-decorators-Basic-static-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Extra initializer instance getter.js => Getter-decorators-Extra-initializer-instance-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Extra initializer private instance getter.js => Getter-decorators-Extra-initializer-private-instance-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Extra initializer private static getter.js => Getter-decorators-Extra-initializer-private-static-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Extra initializer static getter.js => Getter-decorators-Extra-initializer-static-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Order instance getter.js => Getter-decorators-Order-instance-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Order private instance getter.js => Getter-decorators-Order-private-instance-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Order private static getter.js => Getter-decorators-Order-private-static-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Order static getter.js => Getter-decorators-Order-static-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return null instance getter.js => Getter-decorators-Return-null-instance-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return null private instance getter.js => Getter-decorators-Return-null-private-instance-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return null private static getter.js => Getter-decorators-Return-null-private-static-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return null static getter.js => Getter-decorators-Return-null-static-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return object instance getter.js => Getter-decorators-Return-object-instance-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return object private instance getter.js => Getter-decorators-Return-object-private-instance-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return object private static getter.js => Getter-decorators-Return-object-private-static-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Return object static getter.js => Getter-decorators-Return-object-static-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Shim instance getter.js => Getter-decorators-Shim-instance-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Shim private instance getter.js => Getter-decorators-Shim-private-instance-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Shim private static getter.js => Getter-decorators-Shim-private-static-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Getter decorators: Shim static getter.js => Getter-decorators-Shim-static-getter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Initializer order private members, class expression.js => Initializer-order-private-members,-class-expression.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Initializer order private members, class statement.js => Initializer-order-private-members,-class-statement.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Initializer order public members, class expression.js => Initializer-order-public-members,-class-expression.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Initializer order public members, class statement.js => Initializer-order-public-members,-class-statement.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Basic instance method.js => Method-decorators-Basic-instance-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Basic private instance method.js => Method-decorators-Basic-private-instance-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Basic private static method.js => Method-decorators-Basic-private-static-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Basic static method.js => Method-decorators-Basic-static-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Extra initializer instance method.js => Method-decorators-Extra-initializer-instance-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Extra initializer private instance method.js => Method-decorators-Extra-initializer-private-instance-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Extra initializer private static method.js => Method-decorators-Extra-initializer-private-static-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Extra initializer static method.js => Method-decorators-Extra-initializer-static-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Order instance method.js => Method-decorators-Order-instance-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Order private instance method.js => Method-decorators-Order-private-instance-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Order private static method.js => Method-decorators-Order-private-static-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Order static method.js => Method-decorators-Order-static-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return null instance method.js => Method-decorators-Return-null-instance-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return null private instance method.js => Method-decorators-Return-null-private-instance-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return null private static method.js => Method-decorators-Return-null-private-static-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return null static method.js => Method-decorators-Return-null-static-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return object instance method.js => Method-decorators-Return-object-instance-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return object private instance method.js => Method-decorators-Return-object-private-instance-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return object private static method.js => Method-decorators-Return-object-private-static-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Return object static method.js => Method-decorators-Return-object-static-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Shim instance method.js => Method-decorators-Shim-instance-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Shim private instance method.js => Method-decorators-Shim-private-instance-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Shim private static method.js => Method-decorators-Shim-private-static-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Method decorators: Shim static method.js => Method-decorators-Shim-static-method.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Basic instance setter.js => Setter-decorators-Basic-instance-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Basic private instance setter.js => Setter-decorators-Basic-private-instance-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Basic private static setter.js => Setter-decorators-Basic-private-static-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Basic static setter.js => Setter-decorators-Basic-static-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Extra initializer instance setter.js => Setter-decorators-Extra-initializer-instance-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Extra initializer private instance setter.js => Setter-decorators-Extra-initializer-private-instance-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Extra initializer private static setter.js => Setter-decorators-Extra-initializer-private-static-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Extra initializer static setter.js => Setter-decorators-Extra-initializer-static-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Order instance setter.js => Setter-decorators-Order-instance-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Order private instance setter.js => Setter-decorators-Order-private-instance-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Order private static setter.js => Setter-decorators-Order-private-static-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Order static setter.js => Setter-decorators-Order-static-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return null instance setter.js => Setter-decorators-Return-null-instance-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return null private instance setter.js => Setter-decorators-Return-null-private-instance-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return null private static setter.js => Setter-decorators-Return-null-private-static-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return null static setter.js => Setter-decorators-Return-null-static-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return object instance setter.js => Setter-decorators-Return-object-instance-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return object private instance setter.js => Setter-decorators-Return-object-private-instance-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return object private static setter.js => Setter-decorators-Return-object-private-static-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Return object static setter.js => Setter-decorators-Return-object-static-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Shim instance setter.js => Setter-decorators-Shim-instance-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Shim private instance setter.js => Setter-decorators-Shim-private-instance-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Shim private static setter.js => Setter-decorators-Shim-private-static-setter.js} (100%) rename crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/{Setter decorators: Shim static setter.js => Setter-decorators-Shim-static-setter.js} (100%) diff --git a/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs b/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs index 77c19e02cfa9..fc6a92bfe55b 100644 --- a/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs +++ b/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs @@ -31,7 +31,7 @@ for (const property of properties) { let name = property.name.getText(mainFile) const value = property.initializer.getText(mainFile) - name = name.replace(/['\(\)]+/g, '') + name = name.replace(/['\(\)]+/g, '').replace(/[\: ]+/g, '-') // console.log('name', name) // console.log('value', value) diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic instance auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Basic-instance-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic instance auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Basic-instance-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic private instance auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Basic-private-instance-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic private instance auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Basic-private-instance-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic private static auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Basic-private-static-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic private static auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Basic-private-static-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic static auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Basic-static-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Basic static auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Basic-static-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer instance auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Extra-initializer-instance-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer instance auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Extra-initializer-instance-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer private instance auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Extra-initializer-private-instance-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer private instance auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Extra-initializer-private-instance-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer private static auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Extra-initializer-private-static-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer private static auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Extra-initializer-private-static-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer static auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Extra-initializer-static-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Extra initializer static auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Extra-initializer-static-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null instance auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Return-null-instance-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null instance auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Return-null-instance-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null private instance auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Return-null-private-instance-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null private instance auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Return-null-private-instance-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null private static auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Return-null-private-static-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null private static auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Return-null-private-static-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null static auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Return-null-static-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Return null static auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Return-null-static-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim instance auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Shim-instance-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim instance auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Shim-instance-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim private instance auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Shim-private-instance-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim private instance auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Shim-private-instance-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim private static auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Shim-private-static-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim private static auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Shim-private-static-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim static auto-accessor.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Shim-static-auto-accessor.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor decorators: Shim static auto-accessor.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Auto-accessor-decorators-Shim-static-auto-accessor.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Anonymous.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Anonymous.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Anonymous.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Anonymous.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Array binding.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Array-binding.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Array binding.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Array-binding.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment array binding.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Assignment-array-binding.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment array binding.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Assignment-array-binding.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment initializer.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Assignment-initializer.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment initializer.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Assignment-initializer.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment object binding.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Assignment-object-binding.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Assignment object binding.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Assignment-object-binding.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Instance auto-accessor initializer.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Instance-auto-accessor-initializer.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Instance auto-accessor initializer.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Instance-auto-accessor-initializer.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Instance field initializer.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Instance-field-initializer.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Instance field initializer.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Instance-field-initializer.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Object binding.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Object-binding.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Object binding.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Object-binding.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Property value.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Property-value.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Property value.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Property-value.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Static auto-accessor initializer.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Static-auto-accessor-initializer.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Static auto-accessor initializer.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Static-auto-accessor-initializer.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Static field initializer.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Static-field-initializer.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Static field initializer.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Static-field-initializer.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Variable initializer.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Variable-initializer.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic expression: Variable initializer.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-expression-Variable-initializer.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic statement.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-statement.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Basic statement.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Basic-statement.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Extra initializer.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Extra-initializer.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Extra initializer.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Extra-initializer.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Order.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Order.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Order.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Order.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Return null.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Return-null.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Return null.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Return-null.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Return object.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Return-object.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class decorators: Return object.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Class-decorators-Return-object.js diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" class expression.js" "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"await\"-class-expression.js" similarity index 100% rename from "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" class expression.js" rename to "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"await\"-class-expression.js" diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" class statement.js" "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"await\"-class-statement.js" similarity index 100% rename from "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"await\" class statement.js" rename to "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"await\"-class-statement.js" diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" class expression.js" "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"this\"-class-expression.js" similarity index 100% rename from "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" class expression.js" rename to "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"this\"-class-expression.js" diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" class statement.js" "b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"this\"-class-statement.js" similarity index 100% rename from "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: \"this\" class statement.js" rename to "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"this\"-class-statement.js" diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding class expression.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Class-binding-class-expression.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding class expression.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Class-binding-class-expression.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding class statement.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Class-binding-class-statement.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Class binding class statement.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Class-binding-class-statement.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names class expression.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Computed-names-class-expression.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names class expression.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Computed-names-class-expression.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names class statement.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Computed-names-class-statement.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Computed names class statement.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Computed-names-class-statement.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name class expression.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Inner-private-name-class-expression.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name class expression.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Inner-private-name-class-expression.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name class statement.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Inner-private-name-class-statement.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Inner private name class statement.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Inner-private-name-class-statement.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name class expression.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Outer-private-name-class-expression.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name class expression.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Outer-private-name-class-expression.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name class statement.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Outer-private-name-class-statement.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator list evaluation: Outer private name class statement.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-Outer-private-name-class-statement.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator metadata: class expression.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-metadata-class-expression.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator metadata: class expression.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-metadata-class-expression.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator metadata: class statement.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-metadata-class-statement.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator metadata: class statement.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-metadata-class-statement.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic instance field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Basic-instance-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic instance field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Basic-instance-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic private instance field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Basic-private-instance-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic private instance field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Basic-private-instance-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic private static field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Basic-private-static-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic private static field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Basic-private-static-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic static field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Basic-static-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Basic static field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Basic-static-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer instance field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Extra-initializer-instance-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer instance field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Extra-initializer-instance-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer private instance field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Extra-initializer-private-instance-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer private instance field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Extra-initializer-private-instance-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer private static field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Extra-initializer-private-static-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer private static field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Extra-initializer-private-static-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer static field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Extra-initializer-static-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Extra initializer static field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Extra-initializer-static-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order instance field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Order-instance-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order instance field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Order-instance-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order private instance field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Order-private-instance-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order private instance field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Order-private-instance-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order private static field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Order-private-static-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order private static field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Order-private-static-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order static field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Order-static-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Order static field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Order-static-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null instance field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-null-instance-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null instance field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-null-instance-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null private instance field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-null-private-instance-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null private instance field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-null-private-instance-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null private static field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-null-private-static-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null private static field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-null-private-static-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null static field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-null-static-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return null static field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-null-static-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object instance field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-object-instance-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object instance field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-object-instance-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object private instance field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-object-private-instance-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object private instance field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-object-private-instance-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object private static field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-object-private-static-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object private static field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-object-private-static-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object static field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-object-static-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Return object static field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Return-object-static-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim instance field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Shim-instance-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim instance field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Shim-instance-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim private instance field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Shim-private-instance-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim private instance field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Shim-private-instance-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim private static field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Shim-private-static-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim private static field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Shim-private-static-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim static field.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Shim-static-field.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field decorators: Shim static field.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Field-decorators-Shim-static-field.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic instance getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Basic-instance-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic instance getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Basic-instance-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic private instance getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Basic-private-instance-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic private instance getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Basic-private-instance-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic private static getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Basic-private-static-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic private static getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Basic-private-static-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic static getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Basic-static-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Basic static getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Basic-static-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer instance getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Extra-initializer-instance-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer instance getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Extra-initializer-instance-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer private instance getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Extra-initializer-private-instance-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer private instance getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Extra-initializer-private-instance-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer private static getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Extra-initializer-private-static-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer private static getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Extra-initializer-private-static-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer static getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Extra-initializer-static-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Extra initializer static getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Extra-initializer-static-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order instance getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Order-instance-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order instance getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Order-instance-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order private instance getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Order-private-instance-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order private instance getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Order-private-instance-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order private static getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Order-private-static-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order private static getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Order-private-static-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order static getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Order-static-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Order static getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Order-static-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null instance getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-null-instance-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null instance getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-null-instance-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null private instance getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-null-private-instance-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null private instance getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-null-private-instance-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null private static getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-null-private-static-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null private static getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-null-private-static-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null static getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-null-static-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return null static getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-null-static-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object instance getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-object-instance-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object instance getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-object-instance-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object private instance getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-object-private-instance-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object private instance getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-object-private-instance-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object private static getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-object-private-static-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object private static getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-object-private-static-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object static getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-object-static-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Return object static getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Return-object-static-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim instance getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Shim-instance-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim instance getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Shim-instance-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim private instance getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Shim-private-instance-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim private instance getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Shim-private-instance-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim private static getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Shim-private-static-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim private static getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Shim-private-static-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim static getter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Shim-static-getter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter decorators: Shim static getter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Getter-decorators-Shim-static-getter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order private members, class expression.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer-order-private-members,-class-expression.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order private members, class expression.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer-order-private-members,-class-expression.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order private members, class statement.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer-order-private-members,-class-statement.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order private members, class statement.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer-order-private-members,-class-statement.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order public members, class expression.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer-order-public-members,-class-expression.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order public members, class expression.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer-order-public-members,-class-expression.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order public members, class statement.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer-order-public-members,-class-statement.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer order public members, class statement.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Initializer-order-public-members,-class-statement.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic instance method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Basic-instance-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic instance method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Basic-instance-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic private instance method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Basic-private-instance-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic private instance method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Basic-private-instance-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic private static method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Basic-private-static-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic private static method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Basic-private-static-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic static method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Basic-static-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Basic static method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Basic-static-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer instance method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Extra-initializer-instance-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer instance method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Extra-initializer-instance-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer private instance method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Extra-initializer-private-instance-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer private instance method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Extra-initializer-private-instance-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer private static method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Extra-initializer-private-static-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer private static method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Extra-initializer-private-static-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer static method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Extra-initializer-static-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Extra initializer static method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Extra-initializer-static-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order instance method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Order-instance-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order instance method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Order-instance-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order private instance method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Order-private-instance-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order private instance method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Order-private-instance-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order private static method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Order-private-static-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order private static method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Order-private-static-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order static method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Order-static-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Order static method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Order-static-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null instance method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-null-instance-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null instance method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-null-instance-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null private instance method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-null-private-instance-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null private instance method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-null-private-instance-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null private static method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-null-private-static-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null private static method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-null-private-static-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null static method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-null-static-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return null static method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-null-static-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object instance method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-object-instance-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object instance method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-object-instance-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object private instance method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-object-private-instance-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object private instance method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-object-private-instance-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object private static method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-object-private-static-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object private static method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-object-private-static-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object static method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-object-static-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Return object static method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Return-object-static-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim instance method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Shim-instance-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim instance method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Shim-instance-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim private instance method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Shim-private-instance-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim private instance method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Shim-private-instance-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim private static method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Shim-private-static-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim private static method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Shim-private-static-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim static method.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Shim-static-method.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method decorators: Shim static method.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Method-decorators-Shim-static-method.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic instance setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Basic-instance-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic instance setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Basic-instance-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic private instance setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Basic-private-instance-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic private instance setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Basic-private-instance-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic private static setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Basic-private-static-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic private static setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Basic-private-static-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic static setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Basic-static-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Basic static setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Basic-static-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer instance setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Extra-initializer-instance-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer instance setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Extra-initializer-instance-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer private instance setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Extra-initializer-private-instance-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer private instance setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Extra-initializer-private-instance-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer private static setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Extra-initializer-private-static-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer private static setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Extra-initializer-private-static-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer static setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Extra-initializer-static-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Extra initializer static setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Extra-initializer-static-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order instance setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Order-instance-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order instance setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Order-instance-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order private instance setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Order-private-instance-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order private instance setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Order-private-instance-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order private static setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Order-private-static-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order private static setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Order-private-static-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order static setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Order-static-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Order static setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Order-static-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null instance setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-null-instance-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null instance setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-null-instance-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null private instance setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-null-private-instance-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null private instance setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-null-private-instance-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null private static setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-null-private-static-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null private static setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-null-private-static-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null static setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-null-static-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return null static setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-null-static-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object instance setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-object-instance-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object instance setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-object-instance-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object private instance setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-object-private-instance-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object private instance setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-object-private-instance-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object private static setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-object-private-static-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object private static setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-object-private-static-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object static setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-object-static-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Return object static setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Return-object-static-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim instance setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Shim-instance-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim instance setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Shim-instance-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim private instance setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Shim-private-instance-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim private instance setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Shim-private-instance-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim private static setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Shim-private-static-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim private static setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Shim-private-static-setter.js diff --git a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim static setter.js b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Shim-static-setter.js similarity index 100% rename from crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter decorators: Shim static setter.js rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Setter-decorators-Shim-static-setter.js From aff34277049d986237c8b94ee68cf3bfd447f1e7 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, 1 Jul 2024 17:39:14 +0900 Subject: [PATCH 4/6] rmdir before --- .../scripts/split-decorator-tests.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs b/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs index fc6a92bfe55b..14c9cf6e7492 100644 --- a/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs +++ b/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs @@ -25,6 +25,7 @@ const testVarDecl = testVarStmt.declarationList.declarations[0] const properties = testVarDecl.initializer.properties // console.log('properties', properties) +fs.rmdirSync(`tests/decorator-evanw-split`, { recursive: true }); fs.mkdirSync(`tests/decorator-evanw-split`, { recursive: true }); for (const property of properties) { From 4fb36cb0edb7ef7c568606a828787fb85ae9b122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 2 Jul 2024 09:12:11 +0900 Subject: [PATCH 5/6] Rename --- .../scripts/split-decorator-tests.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs b/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs index 14c9cf6e7492..94f0b20d0e69 100644 --- a/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs +++ b/crates/swc_ecma_transforms_proposal/scripts/split-decorator-tests.mjs @@ -32,7 +32,7 @@ for (const property of properties) { let name = property.name.getText(mainFile) const value = property.initializer.getText(mainFile) - name = name.replace(/['\(\)]+/g, '').replace(/[\: ]+/g, '-') + name = name.replace(/['\(\)"']+/g, '').replace(/[\:; ]+/g, '-') // console.log('name', name) // console.log('value', value) From 8d236dda8622551f3313f4a6154e94f5a53297fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 2 Jul 2024 09:12:20 +0900 Subject: [PATCH 6/6] Rename --- .../Decorator-list-evaluation-await-class-expression.js | 0 .../Decorator-list-evaluation-await-class-statement.js | 0 .../Decorator-list-evaluation-this-class-expression.js | 0 .../Decorator-list-evaluation-this-class-statement.js | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"await\"-class-expression.js" => crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-await-class-expression.js (100%) rename "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"await\"-class-statement.js" => crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-await-class-statement.js (100%) rename "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"this\"-class-expression.js" => crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-this-class-expression.js (100%) rename "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"this\"-class-statement.js" => crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-this-class-statement.js (100%) diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"await\"-class-expression.js" b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-await-class-expression.js similarity index 100% rename from "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"await\"-class-expression.js" rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-await-class-expression.js diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"await\"-class-statement.js" b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-await-class-statement.js similarity index 100% rename from "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"await\"-class-statement.js" rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-await-class-statement.js diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"this\"-class-expression.js" b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-this-class-expression.js similarity index 100% rename from "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"this\"-class-expression.js" rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-this-class-expression.js diff --git "a/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"this\"-class-statement.js" b/crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-this-class-statement.js similarity index 100% rename from "crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-\"this\"-class-statement.js" rename to crates/swc_ecma_transforms_proposal/tests/decorator-evanw-split/Decorator-list-evaluation-this-class-statement.js