-
Notifications
You must be signed in to change notification settings - Fork 479
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 coverage for Private methods and accessors #1343
Comments
I'm working on a test plan with @mkubilayk @Neuroboy23 @jbhoosreddy @tim-mc @cameron-mcateer @molisani @rricard from Bloomberg ; we plan to collaborate on the private methods/accessors tests. |
A test plan--if you have other ideas, please post them further down on the thread:
|
Thanks @littledan for the test plan. I'll start of with Early Errors > Grammar to familiarize myself with working on test262. |
I'll also give it a try this week. Taking Early errors > Duplicate private names. |
test: Add private generator method tests (#1343)
private method async generators, generators, async function, tests landed |
…sreddy/test262 into jbhoosreddy-private-methods-delete-error * 'private-methods-delete-error' of git://github.com/jbhoosreddy/test262: revisions fixes test: Early error private methods delete (tc39#1343)
…lete-error test: Early error private methods delete (#1343)
I updated the top comment with a Checklist I'm still working on - it's being pretty tricky to verify everything covered. That list follows parts identified directly in the specs texts (also considering the private fields spec text). I haven't had the time to cross match with items from the other list. |
|
Great progress, @jbhoosreddy |
I'm trying a good effort to connect these dots to effort text. It would be nice if this could be done in any checklist as well. Otherwise it's complex enough to understand how coverage affects the proposed specs text. Examples:
This can connected to the abstractions for PrivateFieldSet, etc. There is a list above with this information.
set is undefined, it's also in the PrivateFieldSet
nice one, but we can link this to the fact "#foo" is a valid property name, and not a reference to a private field.
I believe we already have this covered. It's also in the fact private names are stored differently. We should explain why, not just tell. |
(by "effort text", you meant "spec text", right?) Those associations LGTM. Are there any lines in the test plan that are not clear to you, where the spec text describes their behavior? I'd be happy to clarify.
Where do you suggest that we write this documentation? FYI I just landed a large editorial change to private methods in tc39/proposal-private-methods#52 . |
It's impossible we organize our work the same way. I'm trying to share my way to map things to spec text. Without it, everything is really hard for me to connect to spec text without any reference. The clarification I need - as mentioned in the other message - would be finding a way to map these to the spec. If that's impossible, I'll need extra time to connect everything because I would need to map everything you are providing in two different forms. I'm fine doing either way, but of course I prefer it faster. |
just a quick mapping to the spec (no specific way to map) would do the trick. The spec is the documentation, right? |
@leobalter, @mkubilayk and I were trying to get back at the test plan. Have a few questions around:
We think these tests are done:
cc @littledan |
I believe this is simply getting at, if you have a module with an undefined private name in it (e.g., the module body is simply |
#2188 is covering "Private methods don't show up in..." |
I'm adding here also current plan to support static public/private fields and static private methods.
|
Would like to look into this. |
Should we test? cc @leobalter
https://github.com/tc39/test262/pull/2289/files#diff-42f5a24ed6ec02a54fc62434aa5defa6R41 with function constructor |
I'm removing |
Can this be closed due to complete test coverage? |
I believe we have a reasonable coverage at this point and everything else should be considered edgy cases we are yet to identify as missing coverage. We should close these for now and work with follow ups on demand, if any. |
Already on Stage 3
Ref: https://tc39.github.io/proposal-private-methods/
MemberExpression.PrivateName
CallExpression.PrivateName
#
is a token, it can't be escapedClassBody : 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.PropertyDefinition : MethodDefinition
- It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty. * PropertyDefinitionClassElementName : PrivateName ;
It is a Syntax Error if StringValue of PrivateName is "#constructor".UnaryExpression : delete UnaryExpression
It is a Syntax Error if the UnaryExpression is contained in strict mode code and the derived UnaryExpression is PrimaryExpression:IdentifierReference , MemberExpression:MemberExpression.PrivateName , or CallExpression:CallExpression.PrivateName .ScriptBody : StatementList
It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List as an argument is false unless the source code is eval code that is being processed by a direct eval.ModuleBody : ModuleItemList
It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List as an argument is false.(Adding cases to check if SyntaxError is thrown if AllPrivateIdentifiersValid returns false. #2301)29. Let privateNames be an empty List.
30. If AllPrivateNamesValid of body with the argument privateNames is false, throw a SyntaxError exception.
31. If AllPrivateNamesValid of parameters with the argument privateNames is false, throw a SyntaxError exception.
Method Descriptor (can't be observed directly)ClassElementName in MethodDefinitionAccessor get/set methodsGeneratorMethodAsyncMethodAsyncGeneratorMethodCoalesce private accessorsFrom tests and/or the other list
The text was updated successfully, but these errors were encountered: