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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make getter/setter names consistent with js_name #4273

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

RunDevelopment
Copy link
Contributor

This is the fix I was talking about in #4270. Please merge #4270, so the effects of this PR become obvious in git diff.

Changes:

  • The names of getter/setters in now derived from the name of the underlying function, just like it is for everything else. This makes the function the single source of truth for the name of an exported function/method/getter/setter and prevents them from getting out of sync in the future. All AST structures have been adjusted to reflect this change.
  • If a name is specified via both getter and js_name, getter will be chosen. This reflects the old behavior of exported getters. (Also applies to setter.)
  • Imported static getters now don't ignore the name defined getter. This is a breaking change, since it potentially changes the import name. (Also applies to setter.)

This PR resolves TODO 2 from #4230.

@RunDevelopment
Copy link
Contributor Author

Interesting errors. The good news is that everything around getters and setters seems to be well-tested. I'll fix them over the coming days.

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

Successfully merging this pull request may close these issues.

1 participant