diff --git a/tasks/transform_conformance/snapshots/oxc_exec.snap.md b/tasks/transform_conformance/snapshots/oxc_exec.snap.md index 1c3b4e2a74fc8..5503ec83fc7f7 100644 --- a/tasks/transform_conformance/snapshots/oxc_exec.snap.md +++ b/tasks/transform_conformance/snapshots/oxc_exec.snap.md @@ -1,8 +1,5 @@ commit: 54a8389f node: v22.12.0 -filter: fixtures/oxc -include: **/*.{test,spec}.?(c|m)[jt]s?(x) -exclude: **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**, **/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*, "" -No test files found, exiting with code 1 +Passed: 1 of 1 (100.00%) diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/this-in-computed-key/exec.js b/tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/this-in-computed-key/exec.js new file mode 100644 index 0000000000000..c04fae047aa6d --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/this-in-computed-key/exec.js @@ -0,0 +1,22 @@ +function createClassDeclaration() { + class C { + [this] = 1; + [this + 'bar'] = 2; + } + return C; +} + +function createClassExpression() { + return class { + [this] = 3; + [this + 'bar'] = 4; + }; +} + +const C = createClassDeclaration.call("foo"); +expect(new C().foo).toBe(1); +expect(new C().foobar).toBe(2); + +const D = createClassExpression.call("foo"); +expect(new D().foo).toBe(3); +expect(new D().foobar).toBe(4);