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

Add tests for duplicate private methods (early-error) #2308

Merged
merged 5 commits into from
Aug 29, 2019

Conversation

qmma70
Copy link
Contributor

@qmma70 qmma70 commented Aug 20, 2019

This PR is for #1343

Static Semantics: Early Errors
ClassBody : ClassElementList - It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.

We are currently missing test coverage for async functions, generators and async generators. This PR adds coverage for those.

@qmma70
Copy link
Contributor Author

qmma70 commented Aug 20, 2019

@jbhoosreddy @caiolima

Copy link
Contributor

@caiolima caiolima left a comment

Choose a reason for hiding this comment

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

LGTM. I just left some nit comments.

/*---
desc: It's a SyntaxError if a class contains a private async generator and a private field with the same name
info: |
Static Semantics: Early Errors
Copy link
Contributor

Choose a reason for hiding this comment

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

This is very nit picking, but we use 2-space indentation.

/*---
desc: It's a SyntaxError if a class contains a private async function and a private field with the same name
info: |
Static Semantics: Early Errors
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

/*---
desc: It's a SyntaxError if a class contains a private generator and a private field with the same name
info: |
Static Semantics: Early Errors
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Member

@leobalter leobalter left a comment

Choose a reason for hiding this comment

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

just a minor fix and this should be good to ship

ClassBody : ClassElementList
It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
template: syntax/invalid
features: [class-methods-private]
Copy link
Member

Choose a reason for hiding this comment

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

please fix the features used.

Here you have at least class-methods-private, class-fields-private, async-iteration

ClassBody : ClassElementList
It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
template: syntax/invalid
features: [class-methods-private]
Copy link
Member

Choose a reason for hiding this comment

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

class-methods-private, class-fields-private, async-functions

ClassBody : ClassElementList
It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
template: syntax/invalid
features: [class-methods-private]
Copy link
Member

Choose a reason for hiding this comment

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

class-methods-private, class-fields-private, generators

@qmma70
Copy link
Contributor Author

qmma70 commented Aug 28, 2019

@leobalter Thanks for pointing those out. Fixed.

ClassBody : ClassElementList
It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
template: syntax/invalid
features: [class-methods-private class-fields-private async-iteration]
Copy link
Member

Choose a reason for hiding this comment

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

features must be comma separated

@leobalter leobalter merged commit 4071037 into tc39:master Aug 29, 2019
@qmma70 qmma70 deleted the privatemeth_dup branch August 29, 2019 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants