Closed
Description
Already on Stage 3
Ref: https://tc39.github.io/proposal-private-methods/
- Syntax
- ClassElementName in MethodDefinition
- Accessor get/set methods
- GeneratorMethod
- AsyncMethod
- AsyncGeneratorMethod
- Static Forms (needs https://tc39.github.io/proposal-static-class-features/)
-
MemberExpression.PrivateName
-
CallExpression.PrivateName
-
#
is a token, it can't be escaped
- 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.- Missing duplicates checks for generators, async functions, and async generators. (Add tests for duplicate private methods (early-error) #2308)
-
PropertyDefinition : MethodDefinition
- It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty. * PropertyDefinition -
ClassElementName : 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)
-
- Runtime Semantics: CreateDynamicFunction (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.
- Runtime Semantics: EvalDeclarationInstantiation
- Also check the AllPrivateNamesValid (Adding cases to check if SyntaxError is thrown if AllPrivateIdentifiersValid returns false. #2301)
- include outer environment reference (Added private static accessor cases with direct eval access #2305 and others)
- Runtime Semantics: ClassElementEvaluation
-
Method Descriptor (can't be observed directly)-
ClassElementName in MethodDefinition -
Accessor get/set methods -
GeneratorMethod -
AsyncMethod -
AsyncGeneratorMethod
-
-
Coalesce private accessors
-
- PrivateFieldGet
- Return abrupt completion from calling accessor method
- If getter is undefined, throw a TypeError exception. (Adding tests to verify cases on PrivateFieldSet and PrivateFieldGet #2229)
- PrivateFieldSet
- TypeError for non writable data desc properties
- TypeError for undefined setter (Adding tests to verify cases on PrivateFieldSet and PrivateFieldGet #2229)
- Return abrupt completion from calling accessor method
- method name (name: Adding tests to verify if '.name' of static members are configured properly #2293)
- method length
- [[HasOwnProperty]] / [[GetOwnProperty]] does not find private names (Verify that private methods and accessors aren't visible to [[GetOwnProperty]] and [[HasProperty]]. #2188)
- not found on Object.getOwnPropertyDescriptor
- hasOwnProperty
- Proxies
- ...
From tests and/or the other list
- Methods that can be named "#prototype"
- Valid identifier names
- No space permitted between # and name