From 204f7531d78f7ad497e51cc347c0df3377b956de Mon Sep 17 00:00:00 2001 From: Dunqing Date: Tue, 17 Dec 2024 21:36:25 +0800 Subject: [PATCH] test(transformer/class-properties): add static super tagged expression test --- tasks/transform_conformance/snapshots/oxc.snap.md | 4 ++-- .../test/fixtures/static-super-tagged/input.js | 6 ++++++ .../test/fixtures/static-super-tagged/output.js | 10 ++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-tagged/input.js create mode 100644 tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-tagged/output.js diff --git a/tasks/transform_conformance/snapshots/oxc.snap.md b/tasks/transform_conformance/snapshots/oxc.snap.md index 19612c36acd99c..b44ec0405f484f 100644 --- a/tasks/transform_conformance/snapshots/oxc.snap.md +++ b/tasks/transform_conformance/snapshots/oxc.snap.md @@ -1,6 +1,6 @@ commit: 54a8389f -Passed: 111/125 +Passed: 112/126 # All Passed: * babel-plugin-transform-class-static-block @@ -16,7 +16,7 @@ Passed: 111/125 * regexp -# babel-plugin-transform-class-properties (12/14) +# babel-plugin-transform-class-properties (13/15) * typescript/optional-call/input.ts Symbol reference IDs mismatch for "X": after transform: SymbolId(0): [ReferenceId(0), ReferenceId(2), ReferenceId(6), ReferenceId(11), ReferenceId(16)] diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-tagged/input.js b/tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-tagged/input.js new file mode 100644 index 00000000000000..848e9b28ccb82b --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-tagged/input.js @@ -0,0 +1,6 @@ +class Outer { + A = () => {}; + static B = () => { + super.A``; + }; +} diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-tagged/output.js b/tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-tagged/output.js new file mode 100644 index 00000000000000..a6ca800241a17c --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-tagged/output.js @@ -0,0 +1,10 @@ +var _Outer; +class Outer { + constructor() { + babelHelpers.defineProperty(this, "A", () => {}); + } +} +_Outer = Outer; +babelHelpers.defineProperty(Outer, "B", () => { + babelHelpers.superPropGet(_Outer, "A", _Outer)``; +}); \ No newline at end of file