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

[static private] Unify loose handling of static and instance props #8614

Merged
merged 1 commit into from Sep 4, 2018

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Sep 3, 2018

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

Follow up to #8205

Since both static and instance private props are defined a non-configurable non-enumerable properties on their target, thay can be handled in the same way.

This PR also removes a possible conflict between private and public static properties, by using the classPrivateFieldLooseKey helper to generate the key (instead of "_" + name). e.g.

class Foo {
  static #bar = 1;
  static _bar = 2;
}

cc @rricard @jridgewell

@nicolo-ribaudo nicolo-ribaudo added PR: Bug Fix 🐛 A type of pull request used for our changelog categories Spec: Class Fields labels Sep 3, 2018
@babel-bot
Copy link
Collaborator

babel-bot commented Sep 3, 2018

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

@babel-bot
Copy link
Collaborator

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

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: Bug Fix 🐛 A type of pull request used for our changelog categories Spec: Class Fields
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants