Skip to content

added check to disallow super.private variable access and test case added#10472

Merged
nicolo-ribaudo merged 7 commits intobabel:masterfrom
vivek12345:disallow-super-private-access
Sep 20, 2019
Merged

added check to disallow super.private variable access and test case added#10472
nicolo-ribaudo merged 7 commits intobabel:masterfrom
vivek12345:disallow-super-private-access

Conversation

@vivek12345
Copy link
Copy Markdown
Contributor

@vivek12345 vivek12345 commented Sep 20, 2019

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

@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Sep 20, 2019

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

Copy link
Copy Markdown
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.

Travis CI is failing, but for a good reason. We test @babel/parser with Test262 (the official ECMAScript tests) and with the official flow tests.

Since we aren't 100% spec compliant yet, we have a whitelist file of tests which are allowed to fail.
This PR made some tests which were previously failing pass, so they should be removed from the whitelist.

You can run make bootstrap-flow and make bootstrap-test262 to download the test suites, and make test-flow-update-whitelist and make test-test262-update-whitelist to update them.

) {
this.raise(
startPos,
"super is not allowed to be called on a private identifier of a class",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well, in this case super is not being called (it's not super(#x)).
What about Private fields can't be accessed on super?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes that message makes more sense. I will make the changes accordingly and also update the tests. Thank you

@vivek12345
Copy link
Copy Markdown
Contributor Author

@nicolo-ribaudo when I am doing

make test-test262-update-whitelist

I get the following error:

Error: Unsupported version of Test262: '4.0.0'

Any help here?

@nicolo-ribaudo
Copy link
Copy Markdown
Member

Could you try running yarn upgrade test262-stream?

@vivek12345
Copy link
Copy Markdown
Contributor Author

That did the trick. Thank you 👍

Copy link
Copy Markdown
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.

Thanks!

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Dec 21, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 21, 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: Spec Compliance 👓 A type of pull request used for our changelog categories Spec: Class Fields Spec: Private Methods

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[parser] Disallow private properties access on super

4 participants