Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Auto-accessors should use this rather than the class name #16478

Open
1 task
nicolo-ribaudo opened this issue May 5, 2024 · 2 comments
Open
1 task

Comments

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented May 5, 2024

馃捇

  • Would you like to work on a fix?

How are you using Babel?

/

Input code

(from @evanw) https://babeljs.io/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=3.6&spec=false&loose=false&code_lz=DYUwLgBAggUAxsAhgZ2RAQhA3gXxjAAQAoBrCAXgD4IioKISAaDAShfiVQgGFsYIIyMIjABLOBERw4IVAHsAThAAe9AIww8MFMhAKwtCAEJy5VttR6DvU2fTsYAekcQAantEAzAJ4QwACxE_fxAIAFtwfzkAEzQQADtokGiIAFcABwg5eOgAOggAFX9RNBKnFwAjEDhEVN0IACIodPTgbwARasURRWQoRM7PUXiQAFlImIaIBVT45HKIKs9FUKaWts64brBegrluTmRB4dExbIbci119IgByZVuIYegHZzcPH2CggNCIgJi0NloBAavFbpAqmldCkdgtdJAfoIdgpEABzUJAxDxXyIBQVU4ohS-OQVABW1TA8GyQggSWQEjMAHkyRTcuiwIyAO7xAAKCjk6SsHVkcAUonSyNozHut3YWzmkBJpPouCuViK_M5yCIRBYFGodLgbPAuRqwGARCVbDV-g1ci1Or1VFpIty8NNiHNlrJzHiqXN1oW7jFnwC3xCSO66IgCSSKQyWRy6HyAGVBXAvOJPW0Fg1RogSCAoKkdlBpLJkIoAOLgMB6KZhAuyRrKKbAORyMjAUSF3PslS67DTcCpBQ5AIlXIAYiEUdCOCmFRLwQSuYAkvFTqJPaIAF4gABiohAwGijIUZZk8gUU05xTg_mms3mbwafNEADcRIfj6eoNFoimGY5kkTw6yUXNmlaYUthRZFkD2A4dGOTczniBpmErRoZ2RNEQAaBYSkkADkj8OQMCeBUQEQFI5E8PIbTAO0HUHZ0oFyZR2B0dV_E1bVWOodjVDMP0A3wN5gy8XwwwRCM_iiWJE2BUFFlCOpSM5U5_AWRFZxRaMgWTRjHX1F16WNMAPS9ewKFMCA1HYQ03RNM0LXQZgACYuMsG4BLMo12SstynTsrz8E8WY4DQyQfIMU49SwfgnnoogjHikFqTkUBcnbVEiAAAwPRBRGAUcQAALggAASLBThwfL2C0CL4ii0RMVi5jtXSxKBDAIkh1OQccBBEQHyHBQRzHCA8AEeVK2y3KCoAUWUdM6xSGq6rI4JNQazQYCAA&debug=false&forceAllTransforms=false&modules=false&shippedProposals=false&circleciRepo=&evaluate=true&fileSize=false&timeTravel=false&sourceType=script&lineWrap=true&presets=&prettier=false&targets=Node-0.10&version=7.24.5&externalPlugins=%40babel%2Fplugin-proposal-decorators%407.24.1&assumptions=%7B%7D

Configuration file name

No response

Configuration

Decorators plugin

Current and expected behavior

Babel generates

    static get x() {
      return _C.#A;
    }
    static set x(v) {
      _C.#A = v;
    }

but it should generatr

    static get x() {
      return this.#A;
    }
    static set x(v) {
      this.#A = v;
    }

Environment

/

Possible solution

No response

Additional context

tc39/proposal-decorators#529

@nicolo-ribaudo
Copy link
Member Author

Or maybe it's a bug in the proposal: tc39/proposal-decorators#529 (comment)

@JLHwung
Copy link
Contributor

JLHwung commented May 9, 2024

Babel used to output this, the current behaviour was introduced in the 2023-05 version for the normative updates in Mar 2023.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants