Skip to content

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

Merged
nicolo-ribaudo merged 1 commit intobabel:masterfrom
nicolo-ribaudo:unify-private-loose
Sep 4, 2018
Merged

[static private] Unify loose handling of static and instance props#8614
nicolo-ribaudo merged 1 commit intobabel:masterfrom
nicolo-ribaudo:unify-private-loose

Conversation

@nicolo-ribaudo
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator

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

@nicolo-ribaudo nicolo-ribaudo merged commit d4e23b5 into babel:master Sep 4, 2018
@nicolo-ribaudo nicolo-ribaudo deleted the unify-private-loose branch September 4, 2018 06:10
@nicolo-ribaudo nicolo-ribaudo mentioned this pull request Sep 5, 2018
5 tasks
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 4, 2019
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.

3 participants