diff --git a/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties-unnamed-default-export/input.ts b/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties-unnamed-default-export/input.ts index bd8090122d78c..4ad4043e2fcdb 100644 --- a/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties-unnamed-default-export/input.ts +++ b/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties-unnamed-default-export/input.ts @@ -1,7 +1,7 @@ @dec export default class { - #prop = 0; + prop = 0; meth() { - return this.#prop; + return this.prop; } } diff --git a/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties-unnamed-default-export/options.json b/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties-unnamed-default-export/options.json new file mode 100644 index 0000000000000..eb42f848066b3 --- /dev/null +++ b/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties-unnamed-default-export/options.json @@ -0,0 +1,6 @@ +{ + "plugins": [ + "transform-legacy-decorator", + "transform-class-properties" + ] +} diff --git a/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties-unnamed-default-export/output.js b/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties-unnamed-default-export/output.js index 0c780ec95805f..f9abd3cbd3048 100644 --- a/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties-unnamed-default-export/output.js +++ b/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties-unnamed-default-export/output.js @@ -1,7 +1,9 @@ let _default = class { - #prop = 0; + constructor() { + babelHelpers.defineProperty(this, "prop", 0); + } meth() { - return this.#prop; + return this.prop; } }; _default = babelHelpers.decorate([dec], _default); diff --git a/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties/input.ts b/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties/input.ts index 2c27879776113..16f17f6ff67da 100644 --- a/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties/input.ts +++ b/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties/input.ts @@ -1,23 +1,23 @@ @dec class C { - #prop = 0; + prop = 0; meth() { - return this.#prop; + return this.prop; } } @dec export class D { - #prop = 0; + prop = 0; meth() { - return this.#prop; + return this.prop; } } @dec export default class E { - #prop = 0; + prop = 0; meth() { - return this.#prop; + return this.prop; } } diff --git a/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties/options.json b/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties/options.json new file mode 100644 index 0000000000000..eb42f848066b3 --- /dev/null +++ b/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties/options.json @@ -0,0 +1,6 @@ +{ + "plugins": [ + "transform-legacy-decorator", + "transform-class-properties" + ] +} diff --git a/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties/output.js b/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties/output.js index ba8fef817aa6e..97957629f7ee3 100644 --- a/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties/output.js +++ b/tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/with-class-private-properties/output.js @@ -1,25 +1,31 @@ let C = class C { - #prop = 0; + constructor() { + babelHelpers.defineProperty(this, "prop", 0); + } meth() { - return this.#prop; + return this.prop; } }; C = babelHelpers.decorate([dec], C); let D = class D { - #prop = 0; + constructor() { + babelHelpers.defineProperty(this, "prop", 0); + } meth() { - return this.#prop; + return this.prop; } }; D = babelHelpers.decorate([dec], D); - export { D }; + let E = class E { - #prop = 0; + constructor() { + babelHelpers.defineProperty(this, "prop", 0); + } meth() { - return this.#prop; + return this.prop; } }; E = babelHelpers.decorate([dec], E); -export default E; +export default E; \ No newline at end of file