From 3bae741bb4c4a6b7c56da79d0093c2a052de6edb Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Sun, 8 Dec 2024 15:52:27 +0000 Subject: [PATCH] test(transformer/class-properties): override test output for `_super` in class constructor (#7726) Our output for this test differs from Babel, because we handle `super()` in class constructors differently, but our output is valid. --- .../test/fixtures/private/super-expression/output.js | 11 +++++++++++ tasks/transform_conformance/snapshots/babel.snap.md | 7 ++----- 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 tasks/transform_conformance/overrides/babel-plugin-transform-class-properties/test/fixtures/private/super-expression/output.js diff --git a/tasks/transform_conformance/overrides/babel-plugin-transform-class-properties/test/fixtures/private/super-expression/output.js b/tasks/transform_conformance/overrides/babel-plugin-transform-class-properties/test/fixtures/private/super-expression/output.js new file mode 100644 index 000000000..470037b46 --- /dev/null +++ b/tasks/transform_conformance/overrides/babel-plugin-transform-class-properties/test/fixtures/private/super-expression/output.js @@ -0,0 +1,11 @@ +var _bar = /*#__PURE__*/new WeakMap(); +class Foo extends Bar { + constructor() { + var _super = (..._args) => ( + super(..._args), + babelHelpers.classPrivateFieldInitSpec(this, _bar, "foo"), + this + ); + foo(_super()); + } +} diff --git a/tasks/transform_conformance/snapshots/babel.snap.md b/tasks/transform_conformance/snapshots/babel.snap.md index 826b997bf..6c5f08e0c 100644 --- a/tasks/transform_conformance/snapshots/babel.snap.md +++ b/tasks/transform_conformance/snapshots/babel.snap.md @@ -1,6 +1,6 @@ commit: 54a8389f -Passed: 439/846 +Passed: 440/846 # All Passed: * babel-plugin-transform-class-static-block @@ -276,7 +276,7 @@ x Output mismatch x Output mismatch -# babel-plugin-transform-class-properties (112/264) +# babel-plugin-transform-class-properties (113/264) * assumption-constantSuper/complex-super-class/input.js x Output mismatch @@ -591,9 +591,6 @@ Scope parent mismatch: after transform: ScopeId(2): Some(ScopeId(1)) rebuilt : ScopeId(2): Some(ScopeId(0)) -* private/super-expression/input.js -x Output mismatch - * private-loose/assignment/input.js x Output mismatch