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

class private methods and properties: should not allow spaces between # and identifier #8756

Merged
merged 1 commit into from
Oct 3, 2018

Conversation

macabeus
Copy link
Contributor

Following babel/proposals#12 (comment), we should not allow spaces between # and identifier.
But, since we currently allow it, this fix is a breaking change.

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

@babel-bot
Copy link
Collaborator

babel-bot commented Sep 23, 2018

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

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not going to work well with the pipeline proposal, since it uses a # which can be followed by a space.
Maybe we can move the whitespace check to the parser method which parser private names?

@macabeus
Copy link
Contributor Author

@nicolo-ribaudo I made a rebase with a new commit fixing the problem that you said. Thank you.

Since the spaces are skipped at tokenizer, then the identifier doesn't have the spaces, I need to use others informations at node to check it.

@loganfsmyth
Copy link
Member

@nicolo-ribaudo Do you have a link for that?

@macabeus
Copy link
Contributor Author

@loganfsmyth @nicolo-ribaudo Thank you. I made a new rebase following your suggestion, using this.state.pos before next() and this.state.start after it.

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@nicolo-ribaudo nicolo-ribaudo added pkg: parser Spec: Class Fields PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Oct 1, 2018
@loganfsmyth loganfsmyth merged commit 850bc1d into babel:master Oct 3, 2018
@loganfsmyth
Copy link
Member

Thanks!

@hzoo
Copy link
Member

hzoo commented Oct 3, 2018

awesome work @macabeus!

@macabeus macabeus deleted the should-not-allow-spaces branch October 8, 2018 02:46
@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 pkg: parser 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.

Parser allows spaces between # and identifier
6 participants