diff --git a/spec.html b/spec.html index 7f53fd9..191761b 100644 --- a/spec.html +++ b/spec.html @@ -190,7 +190,7 @@

Static Semantics: Early Errors

The last rule means that expressions such as `delete (((foo)))` produce early errors because of recursive application of the first rule.

- Private fields may not be deleted in any case. There are only ever private names defined inside class bodies. Inside of a class body, code will be in strict mode, and the above rule applies. Outside of a class body, there will be no private names defined, so the below rule will apply. + Private fields may not be deleted in any case. There are only ever private names defined inside class bodies. Inside of a class body, code will be in strict mode, and the above rule applies. Outside of a class body, there will be no private names defined, so the below rule will apply. Script : ScriptBody? @@ -207,7 +207,7 @@

Static Semantics: Early Errors

- References to PrivateNames which are not lexically present cause an early error. + References to PrivateNames which are not lexically present cause an early error.

Static Semantics: AllPrivateNamesValid

AllPrivateNamesValid is an abstract operation which takes _names_ as an argument. @@ -230,7 +230,7 @@

Static Semantics: AllPrivateNamesValid

For all other grammatical productions, recurse on subexpressions/substatements, passing in the _names_ of the caller. If all pieces return *true*, then return *true*. If any returns *false*, return *false*. - TODO: Elaborate the preceding paragraph with spec text inserted in each relevant place + TODO: Elaborate the preceding paragraph with spec text inserted in each relevant place

Runtime Semantics: PerformEval ( _x_, _evalRealm_, _strictCaller_, _direct_ )

@@ -295,7 +295,7 @@

Runtime Semantics: Evaluation

1. Perform ! _scopeEnvRec_.InitializeBinding(_bindingName_, _field_). 1. Return _field_. - Each time a class declaration executes, distinct internal Private Names are created. This means, that they cannot directly access each other's private state if a method of one is called with the other as a receiver. + Each time a class declaration executes, distinct internal Private Names are created. This means, that they cannot directly access each other's private state if a method of one is called with the other as a receiver.
@@ -439,7 +439,7 @@

InitializeInstanceFields ( _O_, _constructor_ )

1. Perform ? DefineField(_O_, _fieldRecord_). 1. Return. - Private fields are added to the object one by one, interspersed with evaluation of the initializers, following the construction of the receiver. These semantics allow for a later initializer to refer to a previously private field. + Private fields are added to the object one by one, interspersed with evaluation of the initializers, following the construction of the receiver. These semantics allow for a later initializer to refer to a previously private field. @@ -587,7 +587,7 @@

Static Semantics: ContainsArguments

For all other grammatical productions, recurse on all nonterminals. If any piece returns *true*, then return *true*. Otherwise return *false*. - TODO: Elaborate the preceding paragraph with spec text inserted in each relevant place + TODO: Elaborate the preceding paragraph with spec text inserted in each relevant place
@@ -748,7 +748,7 @@

[[Construct]] ( _argumentsList_, _newTarget_)

1. Else, ReturnIfAbrupt(_result_). 1. Return ? _envRec_.GetThisBinding(). - Fields are added by the base class constructor when the super chain reaches up to that, rather than by the subclass constructor when creating the object, in order to be analogous to ES2015 subclassable builtins. See this GitHub thread for more discussion. + Fields are added by the base class constructor when the super chain reaches up to that, rather than by the subclass constructor when creating the object, in order to be analogous to ES2015 subclassable builtins. See this GitHub thread for more discussion.
@@ -812,7 +812,7 @@

Private Names and references

All ECMAScript objects have a new additional internal slot, [[PrivateFieldValues]], which is a List of Records of the form { [[PrivateName]]: Private Name, [[PrivateFieldValue]]: ECMAScript value }. This List represents the values of the private fields for the object. All objects, including Proxies and all host environment-provided objects, have this internal slot, but primitives such as Numbers do not.

- +

Private fields are designed to have semantics analogous to WeakMaps. However, the implied garbage collection semantics are weaker: If all the references to a WeakMap are inaccessible, but there is still a reference to a key which was in the WeakMap, one would expect the value to be eventually collected. However, PrivateNameIdentifiers specifically do not have this connotation: because the reference from the Identifier to the Value is in a Record which the Object points to, the value would not be collected, even if nothing else points to the identifier.

@@ -821,7 +821,7 @@

Private Names and references

- + Private fields are deliberately inaccessible outside of the class body. It is proposed that there could be an "escape hatch" to access them though some sort of reflective mechanism; see the GitHub thread. This proposal deliberately omits any such escape hatch. @@ -837,7 +837,7 @@

ObjectCreate (_proto_ [ , _internalSlotsList_ ])

1. Set _obj_.[[PrivateFieldValues]] to an empty List. 1. Return _obj_. - TODO: All ECMAScript objects, including Proxies, and any user exotic object, should have a [[PrivateFieldValues]] internal slot iniitlaized to an empty List. + TODO: All ECMAScript objects, including Proxies, and any user exotic object, should have a [[PrivateFieldValues]] internal slot iniitlaized to an empty List.
@@ -1070,10 +1070,10 @@

Execution Contexts

The PrivateNameEnvironment Lexical Context is always a chain of Declaration Contexts. Each name begins with `"#"`. - Private names could be specified by lumping it all into the LexicalEnvironment. However, this would create false conflicts with object environment records that would need to be resolved. Further, it seems logically cleaner to separate out the distinct namespace into a distinct object. + Private names could be specified by lumping it all into the LexicalEnvironment. However, this would create false conflicts with object environment records that would need to be resolved. Further, it seems logically cleaner to separate out the distinct namespace into a distinct object. When a new execution context is created for an ECMAScript code execution context, the PrivateNameIdentifiers value is inherited from the running execution context, or if none exists, a new Declaration Context with a *null* parent. - TODO: Elaborate the preceding paragraph with spec text inserted in each relevant place + TODO: Elaborate the preceding paragraph with spec text inserted in each relevant place