From c112315a29724582c4001c53ee452d92affad39a Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Wed, 22 Apr 2020 22:15:27 -0400 Subject: [PATCH] Editorial: quick fixes (#1965) Editorial: Reinstate an SDO rule PR #1933 deleted SDO rules that are handled by the chain production rule, but it also deleted this one which isn't. (It has "TV" on the left and "TRV" on the right.) Editorial: Move an element PR #1490 (among other things) moved the evaluation semantics for ArrowFunction from the Evaluation SDO to the NamedEvaluation SDO. The accompanying should have moved at the same time (in particular because of the reference to "step 3"). Editorial: Delete in TimeClip clause PR #1827 (among other things) removed step 4 from the algorithm for TimeClip, obsoleting the accompanying emu-note that describes "the point of step 4". Conceivably, the note could be reworded to describe the effect of 'ToInteger' on step 3, but I don't think it'd be worth the bother. Editorial: Change "Step 2.a" to "Step 2.b" in RepeatMatcher note PR #1889 (among other things) inserted a step before the former 2.a, but didn't update the note that referenced it. Editorial: Change step 7 to step 6 in SortCompare note Commit 9c1e076c (2015-10-26) introduced the '?' abbreviation for ReturnIfAbrupt. This caused the ToString call on step 7 to move to step 6, but the note that referred to it wasn't updated. Editorial: Fix typo: "Descritor" -> "Descriptor" Editorial: Fix typo: "GeneratorObject" -> "generator object" (There's no such thing as a GeneratorObject.) Editorial: Delete "as a parameter" after "is present" (It's the only place in the spec where we use that phrasing.) Editorial: Change "which" to "that" ... in "{String,Array,Map,Set} methods which return such iterators" Editorial: Insert a comma in SetDefaultGlobalBindings() Formerly, it read like "containing" modified "the property", when it actually modified "the property descriptor". Editorial: Change "lexical environment" to "Environment Record" ... in FunctionDeclarationInstantiation, to balance the NOTE in the other arm of the if-else, and also for consistency with the NOTE at 27.a. (I should have done this in PR #1697.) Editorial: Change "step 3" to "step 4" in Note ... that accompanies the NamedEvaluation semantics for ArrowFunction : ArrowParameters `=>` ConciseBody PR #1870 (among other things) inserted a step before the former step 3, but didn't update the note that referenced it. --- spec.html | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/spec.html b/spec.html index 61eea4120f..1359d31b6f 100644 --- a/spec.html +++ b/spec.html @@ -2546,7 +2546,7 @@

[[GetOwnProperty]] ( _P_ )

If the Type of the return value is Property Descriptor, the return value must be a complete property descriptor.
  • - If _P_ is described as a non-configurable, non-writable own data property, all future calls to [[GetOwnProperty]] ( _P_ ) must return Property Descritor whose [[Value]] is SameValue as _P_'s [[Value]] attribute. + If _P_ is described as a non-configurable, non-writable own data property, all future calls to [[GetOwnProperty]] ( _P_ ) must return Property Descriptor whose [[Value]] is SameValue as _P_'s [[Value]] attribute.
  • If _P_'s attributes other than [[Writable]] may change over time or if the property might be deleted, then _P_'s [[Configurable]] attribute must be *true*. @@ -7417,7 +7417,7 @@

    SetDefaultGlobalBindings ( _realmRec_ )

    1. Let _global_ be _realmRec_.[[GlobalObject]]. 1. For each property of the Global Object specified in clause , do 1. Let _name_ be the String value of the property name. - 1. Let _desc_ be the fully populated data property descriptor for the property containing the specified attributes for the property. For properties listed in , , or the value of the [[Value]] attribute is the corresponding intrinsic object from _realmRec_. + 1. Let _desc_ be the fully populated data property descriptor for the property, containing the specified attributes for the property. For properties listed in , , or the value of the [[Value]] attribute is the corresponding intrinsic object from _realmRec_. 1. Perform ? DefinePropertyOrThrow(_global_, _name_, _desc_). 1. Return _global_. @@ -7526,7 +7526,7 @@

    Execution Contexts

    Generator - The GeneratorObject that this execution context is evaluating. + The generator object that this execution context is evaluating. @@ -8624,7 +8624,7 @@

    FunctionDeclarationInstantiation ( _func_, _argumentsList_ )

    1. If *"arguments"* is an element of _functionNames_ or if *"arguments"* is an element of _lexicalNames_, then 1. Set _argumentsObjectNeeded_ to *false*. 1. If _strict_ is *true* or if _hasParameterExpressions_ is *false*, then - 1. NOTE: Only a single lexical environment is needed for the parameters and top-level vars. + 1. NOTE: Only a single Environment Record is needed for the parameters and top-level vars. 1. Let _env_ be the LexicalEnvironment of _calleeContext_. 1. Else, 1. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. @@ -11821,6 +11821,9 @@

    Static Semantics: TV and TRV

  • The TV of TemplateCharacter :: `\` NotEscapeSequence is *undefined*.
  • +
  • + The TV of TemplateCharacter :: LineTerminatorSequence is the TRV of |LineTerminatorSequence|. +
  • The TV of LineContinuation :: `\` LineTerminatorSequence is the empty code unit sequence.
  • @@ -20121,6 +20124,9 @@

    Runtime Semantics: NamedEvaluation

    1. Perform SetFunctionName(_closure_, _name_). 1. Return _closure_. + +

    An |ArrowFunction| does not define local bindings for `arguments`, `super`, `this`, or `new.target`. Any reference to `arguments`, `super`, `this`, or `new.target` within an |ArrowFunction| must resolve to a binding in a lexically enclosing environment. Typically this will be the Function Environment of an immediately enclosing function. Even though an |ArrowFunction| may contain references to `super`, the function object created in step 4 is not made into a method by performing MakeMethod. An |ArrowFunction| that references `super` is always contained within a non-|ArrowFunction| and the necessary state to implement `super` is accessible via the _scope_ that is captured by the function object of the |ArrowFunction|.

    +
    @@ -20129,9 +20135,6 @@

    Runtime Semantics: Evaluation

    1. Return the result of performing NamedEvaluation for this |ArrowFunction| with argument *""*. - -

    An |ArrowFunction| does not define local bindings for `arguments`, `super`, `this`, or `new.target`. Any reference to `arguments`, `super`, `this`, or `new.target` within an |ArrowFunction| must resolve to a binding in a lexically enclosing environment. Typically this will be the Function Environment of an immediately enclosing function. Even though an |ArrowFunction| may contain references to `super`, the function object created in step 3 is not made into a method by performing MakeMethod. An |ArrowFunction| that references `super` is always contained within a non-|ArrowFunction| and the necessary state to implement `super` is accessible via the _scope_ that is captured by the function object of the |ArrowFunction|.

    -
    ExpressionBody : AssignmentExpression 1. Let _exprRef_ be the result of evaluating |AssignmentExpression|. @@ -20267,7 +20270,7 @@

    Runtime Semantics: DefineMethod

    1. Let _propKey_ be the result of evaluating |PropertyName|. 1. ReturnIfAbrupt(_propKey_). 1. Let _scope_ be the running execution context's LexicalEnvironment. - 1. If _functionPrototype_ is present as a parameter, then + 1. If _functionPrototype_ is present, then 1. Let _prototype_ be _functionPrototype_. 1. Else, 1. Let _prototype_ be %Function.prototype%. @@ -28550,9 +28553,6 @@

    TimeClip ( _time_ )

    1. If abs(_time_) > 8.64 × 1015, return *NaN*. 1. Return ! ToInteger(_time_).
    - -

    The point of step 4 is that an implementation is permitted a choice of internal representations of time values, for example as a 64-bit signed integer or as a 64-bit floating-point value. Depending on the implementation, this internal representation may or may not distinguish *-0* and *+0*.

    -
    @@ -30662,7 +30662,7 @@

    String Iterator Objects

    CreateStringIterator ( _string_ )

    -

    The abstract operation CreateStringIterator takes argument _string_. This operation is used to create iterator objects for String methods which return such iterators. It performs the following steps when called:

    +

    The abstract operation CreateStringIterator takes argument _string_. This operation is used to create iterator objects for String methods that return such iterators. It performs the following steps when called:

    1. Assert: Type(_string_) is String. 1. Let _iterator_ be OrdinaryObjectCreate(%StringIteratorPrototype%, « [[IteratedString]], [[StringNextIndex]] »). @@ -31533,7 +31533,7 @@

    Runtime Semantics: RepeatMatcher ( _m_, _min_, _max_, _greedy_, _x_, _c_, _p

    because each iteration of the outermost `*` clears all captured Strings contained in the quantified |Atom|, which in this case includes capture Strings numbered 2, 3, 4, and 5.

    -

    Step 2.a of the RepeatMatcher states that once the minimum number of repetitions has been satisfied, any more expansions of |Atom| that match the empty character sequence are not considered for further repetitions. This prevents the regular expression engine from falling into an infinite loop on patterns such as:

    +

    Step 2.b of the RepeatMatcher states that once the minimum number of repetitions has been satisfied, any more expansions of |Atom| that match the empty character sequence are not considered for further repetitions. This prevents the regular expression engine from falling into an infinite loop on patterns such as:

    /(a*)*/.exec("b")

    or the slightly more complicated:

    /(a*)b\1+/.exec("baaaac")
    @@ -34272,7 +34272,7 @@

    Runtime Semantics: SortCompare ( _x_, _y_ )

    Because non-existent property values always compare greater than *undefined* property values, and *undefined* always compares greater than any other value, *undefined* property values always sort to the end of the result, followed by non-existent property values.

    -

    Method calls performed by the ToString abstract operations in steps 5 and 7 have the potential to cause SortCompare to not behave as a consistent comparison function.

    +

    Method calls performed by the ToString abstract operations in steps 5 and 6 have the potential to cause SortCompare to not behave as a consistent comparison function.

    @@ -34502,7 +34502,7 @@

    Array Iterator Objects

    CreateArrayIterator ( _array_, _kind_ )

    -

    The abstract operation CreateArrayIterator takes arguments _array_ and _kind_. This operation is used to create iterator objects for Array methods which return such iterators. It performs the following steps when called:

    +

    The abstract operation CreateArrayIterator takes arguments _array_ and _kind_. This operation is used to create iterator objects for Array methods that return such iterators. It performs the following steps when called:

    1. Assert: Type(_array_) is Object. 1. Assert: _kind_ is ~key+value~, ~key~, or ~value~. @@ -36039,7 +36039,7 @@

    Map Iterator Objects

    CreateMapIterator ( _map_, _kind_ )

    -

    The abstract operation CreateMapIterator takes arguments _map_ and _kind_. This operation is used to create iterator objects for Map methods which return such iterators. It performs the following steps when called:

    +

    The abstract operation CreateMapIterator takes arguments _map_ and _kind_. This operation is used to create iterator objects for Map methods that return such iterators. It performs the following steps when called:

    1. Perform ? RequireInternalSlot(_map_, [[MapData]]). 1. Let _iterator_ be OrdinaryObjectCreate(%MapIteratorPrototype%, « [[IteratedMap]], [[MapNextIndex]], [[MapIterationKind]] »). @@ -36373,7 +36373,7 @@

    Set Iterator Objects

    CreateSetIterator ( _set_, _kind_ )

    -

    The abstract operation CreateSetIterator takes arguments _set_ and _kind_. This operation is used to create iterator objects for Set methods which return such iterators. It performs the following steps when called:

    +

    The abstract operation CreateSetIterator takes arguments _set_ and _kind_. This operation is used to create iterator objects for Set methods that return such iterators. It performs the following steps when called:

    1. Perform ? RequireInternalSlot(_set_, [[SetData]]). 1. Let _iterator_ be OrdinaryObjectCreate(%SetIteratorPrototype%, « [[IteratedSet]], [[SetNextIndex]], [[SetIterationKind]] »).