From 59b7dbf73bb29a98d52beb8dcc4c03b1d0ec8fe2 Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Wed, 18 Dec 2024 18:59:45 +0000 Subject: [PATCH] test(transformer/class-properties): failing test for `super.prop` as assignment target --- .../snapshots/oxc.snap.md | 7 +++++-- .../static-super-assignment-target/input.js | 21 +++++++++++++++++++ .../static-super-assignment-target/output.js | 11 ++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-assignment-target/input.js create mode 100644 tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-assignment-target/output.js diff --git a/tasks/transform_conformance/snapshots/oxc.snap.md b/tasks/transform_conformance/snapshots/oxc.snap.md index 3dd1e4728187a..a0c97595264cf 100644 --- a/tasks/transform_conformance/snapshots/oxc.snap.md +++ b/tasks/transform_conformance/snapshots/oxc.snap.md @@ -1,6 +1,6 @@ commit: 54a8389f -Passed: 114/129 +Passed: 114/130 # All Passed: * babel-plugin-transform-class-static-block @@ -16,7 +16,10 @@ Passed: 114/129 * regexp -# babel-plugin-transform-class-properties (15/18) +# babel-plugin-transform-class-properties (15/19) +* static-super-assignment-target/input.js +x Output mismatch + * static-super-tagged-template/input.js x Output mismatch diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-assignment-target/input.js b/tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-assignment-target/input.js new file mode 100644 index 0000000000000..b9ab66cba3061 --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-assignment-target/input.js @@ -0,0 +1,21 @@ +let bound = "A"; + +class Outer { + static prop = () => { + [super.prop] = []; + [super[bound]] = []; + [super[unbound]] = []; + + [...super.prop] = []; + [...super[bound]] = []; + [...super[unbound]] = []; + + ({x: super.prop} = {}); + ({x: super[bound]} = {}); + ({x: super[unbound]} = {}); + + ({...super.prop} = {}); + ({...super[bound]} = {}); + ({...super[unbound]} = {}); + }; +} diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-assignment-target/output.js b/tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-assignment-target/output.js new file mode 100644 index 0000000000000..d339cd5d92fc8 --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/static-super-assignment-target/output.js @@ -0,0 +1,11 @@ +// We don't know what correct output for this should be. +// +// Babel doesn't support this, but ESBuild does. +// +// We'd need to add a new helper function to support this. + +class Outer {} + +babelHelpers.defineProperty(Outer, "prop", () => { + // ????? +});