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

Reuse the readOnlyError helper for private methods #12792

Merged

Conversation

nicolo-ribaudo
Copy link
Member

Q                       A
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

While reviewing #12707, I noticed that classPrivateMethodSet is basically the same as readOnlyError except that it doesn't say exactly what cannot be reassigned.

The readOnlyError helper will throw something like "#foo" is read-only", which is also more correct when reassigning a private getter (since it's not technically a method). Also, we avoid injecting two different helpers in the generated bundle.

This PR also removes classPrivateMethodSet for Babel 8.

@nicolo-ribaudo nicolo-ribaudo added the PR: Polish 💅 A type of pull request used for our changelog categories label Feb 11, 2021
@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/40316/

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b435598:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Polish 💅 A type of pull request used for our changelog categories Spec: Private Methods
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants