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

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

Merged
merged 7 commits into from Sep 20, 2019

Conversation

vivek12345
Copy link
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
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
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
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
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
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
Member

Could you try running yarn upgrade test262-stream?

@vivek12345
Copy link
Contributor Author

That did the trick. Thank you 👍

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.

Thanks!

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