diff --git a/spec.html b/spec.html index b41add7fce..0eb0f62c9f 100644 --- a/spec.html +++ b/spec.html @@ -9657,7 +9657,7 @@

Names and Keywords

This standard specifies specific code point additions: U+0024 (DOLLAR SIGN) and U+005F (LOW LINE) are permitted anywhere in an |IdentifierName|, and the code points U+200C (ZERO WIDTH NON-JOINER) and U+200D (ZERO WIDTH JOINER) are permitted anywhere after the first code point of an |IdentifierName|.

-

Unicode escape sequences are permitted in an |IdentifierName|, where they contribute a single Unicode code point to the |IdentifierName|. The code point is expressed by the |HexDigits| of the |UnicodeEscapeSequence| (see ). The `\\` preceding the |UnicodeEscapeSequence| and the `u` and `{ }` code units, if they appear, do not contribute code points to the |IdentifierName|. A |UnicodeEscapeSequence| cannot be used to put a code point into an |IdentifierName| that would otherwise be illegal. In other words, if a `\\` |UnicodeEscapeSequence| sequence were replaced by the |SourceCharacter| it contributes, the result must still be a valid |IdentifierName| that has the exact same sequence of |SourceCharacter| elements as the original |IdentifierName|. All interpretations of |IdentifierName| within this specification are based upon their actual code points regardless of whether or not an escape sequence was used to contribute any particular code point.

+

Unicode escape sequences are permitted in an |IdentifierName|, where they contribute a single Unicode code point to the |IdentifierName|. The code point is expressed by the |CodePoint| of the |UnicodeEscapeSequence| (see ). The `\\` preceding the |UnicodeEscapeSequence| and the `u` and `{ }` code units, if they appear, do not contribute code points to the |IdentifierName|. A |UnicodeEscapeSequence| cannot be used to put a code point into an |IdentifierName| that would otherwise be illegal. In other words, if a `\\` |UnicodeEscapeSequence| sequence were replaced by the |SourceCharacter| it contributes, the result must still be a valid |IdentifierName| that has the exact same sequence of |SourceCharacter| elements as the original |IdentifierName|. All interpretations of |IdentifierName| within this specification are based upon their actual code points regardless of whether or not an escape sequence was used to contribute any particular code point.

Two |IdentifierName|s that are canonically equivalent according to the Unicode standard are not equal unless, after replacement of each |UnicodeEscapeSequence|, they are represented by the exact same sequence of code points.

Syntax

@@ -10176,7 +10176,7 @@

Syntax

UnicodeEscapeSequence :: `u` Hex4Digits - `u{` HexDigits `}` + `u{` CodePoint `}` Hex4Digits :: HexDigit HexDigit HexDigit HexDigit @@ -10186,17 +10186,6 @@

Syntax

A line terminator code point cannot appear in a string literal, except as part of a |LineContinuation| to produce the empty code points sequence. The proper way to cause a line terminator code point to be part of the String value of a string literal is to use an escape sequence such as `\\n` or `\\u000A`.

- - -

Static Semantics: Early Errors

- UnicodeEscapeSequence :: `u{` HexDigits `}` - -
-

Static Semantics: StringValue

@@ -10232,13 +10221,13 @@

Static Semantics: SV

The SV of DoubleStringCharacters :: DoubleStringCharacter is a sequence of one or two code units that is the SV of |DoubleStringCharacter|.
  • - The SV of DoubleStringCharacters :: DoubleStringCharacter DoubleStringCharacters is a sequence of one or two code units that is the SV of |DoubleStringCharacter| followed by all the code units in the SV of |DoubleStringCharacters| in order. + The SV of DoubleStringCharacters :: DoubleStringCharacter DoubleStringCharacters is a sequence of one or two code units that is the SV of |DoubleStringCharacter| followed by the code units of the SV of |DoubleStringCharacters| in order.
  • The SV of SingleStringCharacters :: SingleStringCharacter is a sequence of one or two code units that is the SV of |SingleStringCharacter|.
  • - The SV of SingleStringCharacters :: SingleStringCharacter SingleStringCharacters is a sequence of one or two code units that is the SV of |SingleStringCharacter| followed by all the code units in the SV of |SingleStringCharacters| in order. + The SV of SingleStringCharacters :: SingleStringCharacter SingleStringCharacters is a sequence of one or two code units that is the SV of |SingleStringCharacter| followed by the code units of the SV of |SingleStringCharacters| in order.
  • The SV of DoubleStringCharacter :: SourceCharacter but not one of `"` or `\` or LineTerminator is the UTF16Encoding of the code point value of |SourceCharacter|. @@ -10437,7 +10426,7 @@

    Static Semantics: SV

    The SV of Hex4Digits :: HexDigit HexDigit HexDigit HexDigit is the code unit value that is (0x1000 times the MV of the first |HexDigit|) plus (0x100 times the MV of the second |HexDigit|) plus (0x10 times the MV of the third |HexDigit|) plus the MV of the fourth |HexDigit|.
  • - The SV of UnicodeEscapeSequence :: `u{` HexDigits `}` is the UTF16Encoding of the MV of |HexDigits|. + The SV of UnicodeEscapeSequence :: `u{` CodePoint `}` is the UTF16Encoding of the MV of |CodePoint|.
  • @@ -10559,9 +10548,29 @@

    Syntax

    TemplateCharacter :: `$` [lookahead != `{` ] `\` EscapeSequence + `\` NotEscapeSequence LineContinuation LineTerminatorSequence SourceCharacter but not one of ``` or `\` or `$` or LineTerminator + + NotEscapeSequence :: + `0` DecimalDigit + DecimalDigit but not `0` + `x` [lookahead <! HexDigit] + `x` HexDigit [lookahead <! HexDigit] + `u` [lookahead <! HexDigit] [lookahead != `{`] + `u` HexDigit [lookahead <! HexDigit] + `u` HexDigit HexDigit [lookahead <! HexDigit] + `u` HexDigit HexDigit HexDigit [lookahead <! HexDigit] + `u` `{` [lookahead <! HexDigit] + `u` `{` NotCodePoint + `u` `{` CodePoint [lookahead != `}`] + + NotCodePoint :: + HexDigits [> but not if MV of HexDigits ≤ 0x10FFFF ] + + CodePoint :: + HexDigits [> but not if MV of HexDigits > 0x10FFFF ]

    A conforming implementation must not use the extended definition of |EscapeSequence| described in when parsing a |TemplateCharacter|.

    @@ -10601,7 +10610,7 @@

    Static Semantics: TV and TRV

    The TV of TemplateCharacters :: TemplateCharacter is the TV of |TemplateCharacter|.
  • - The TV of TemplateCharacters :: TemplateCharacter TemplateCharacters is a sequence consisting of the code units in the TV of |TemplateCharacter| followed by all the code units in the TV of |TemplateCharacters| in order. + The TV of TemplateCharacters :: TemplateCharacter TemplateCharacters is *undefined* if either the TV of |TemplateCharacter| is *undefined* or the TV of |TemplateCharacters| is *undefined*. Otherwise, it is a sequence consisting of the code units of the TV of |TemplateCharacter| followed by the code units of the TV of |TemplateCharacters|.
  • The TV of TemplateCharacter :: SourceCharacter but not one of ``` or `\` or `$` or LineTerminator is the UTF16Encoding of the code point value of |SourceCharacter|. @@ -10612,6 +10621,9 @@

    Static Semantics: TV and TRV

  • The TV of TemplateCharacter :: `\` EscapeSequence is the SV of |EscapeSequence|.
  • +
  • + The TV of TemplateCharacter :: `\` NotEscapeSequence is *undefined*. +
  • The TV of TemplateCharacter :: LineContinuation is the TV of |LineContinuation|.
  • @@ -10637,7 +10649,7 @@

    Static Semantics: TV and TRV

    The TRV of TemplateCharacters :: TemplateCharacter is the TRV of |TemplateCharacter|.
  • - The TRV of TemplateCharacters :: TemplateCharacter TemplateCharacters is a sequence consisting of the code units in the TRV of |TemplateCharacter| followed by all the code units in the TRV of |TemplateCharacters|, in order. + The TRV of TemplateCharacters :: TemplateCharacter TemplateCharacters is a sequence consisting of the code units of the TRV of |TemplateCharacter| followed by the code units of the TRV of |TemplateCharacters|.
  • The TRV of TemplateCharacter :: SourceCharacter but not one of ``` or `\` or `$` or LineTerminator is the UTF16Encoding of the code point value of |SourceCharacter|. @@ -10648,6 +10660,9 @@

    Static Semantics: TV and TRV

  • The TRV of TemplateCharacter :: `\` EscapeSequence is the sequence consisting of the code unit value 0x005C followed by the code units of TRV of |EscapeSequence|.
  • +
  • + The TRV of TemplateCharacter :: `\` NotEscapeSequence is the sequence consisting of the code unit value 0x005C followed by the code units of TRV of |NotEscapeSequence|. +
  • The TRV of TemplateCharacter :: LineContinuation is the TRV of |LineContinuation|.
  • @@ -10666,6 +10681,39 @@

    Static Semantics: TV and TRV

  • The TRV of EscapeSequence :: UnicodeEscapeSequence is the TRV of the |UnicodeEscapeSequence|.
  • +
  • + The TRV of NotEscapeSequence :: `0` DecimalDigit is the sequence consisting of the code unit value 0x0030 (DIGIT ZERO) followed by the code units of the TRV of |DecimalDigit|. +
  • +
  • + The TRV of NotEscapeSequence :: `x` [lookahead <! HexDigit] is the code unit value 0x0078. +
  • +
  • + The TRV of NotEscapeSequence :: `x` HexDigit [lookahead <! HexDigit] is the sequence consisting of the code unit value 0x0078 followed by the code units of the TRV of |HexDigit|. +
  • +
  • + The TRV of NotEscapeSequence :: `u` [lookahead <! { HexDigit, `{` }] is the code unit value 0x0075. +
  • +
  • + The TRV of NotEscapeSequence :: `u` HexDigit [lookahead <! { HexDigit, `{` }] is the sequence consisting of the code unit value 0x0075 followed by the code units of the TRV of |HexDigit|. +
  • +
  • + The TRV of NotEscapeSequence :: `u` HexDigit HexDigit [lookahead <! { HexDigit, `{` }] is the sequence consisting of the code unit value 0x0075 followed by the code units of the TRV of the first |HexDigit| followed by the code units of the TRV of the second |HexDigit|. +
  • +
  • + The TRV of NotEscapeSequence :: `u` HexDigit HexDigit HexDigit [lookahead <! { HexDigit, `{` }] is the sequence consisting of the code unit value 0x0075 followed by the code units of the TRV of the first |HexDigit| followed by the code units of the TRV of the second |HexDigit| followed by the code units of the TRV of the third |HexDigit|. +
  • +
  • + The TRV of NotEscapeSequence :: `u` `{` [lookahead <! HexDigit] is the sequence consisting of the code unit value 0x0075 followed by the code unit value 0x007B. +
  • +
  • + The TRV of NotEscapeSequence :: `u` `{` NotCodePoint is the sequence consisting of the code unit value 0x0075 followed by the code unit value 0x007B followed by the code units of the TRV of |NotCodePoint|. +
  • +
  • + The TRV of NotEscapeSequence :: `u` `{` CodePoint [lookahead <! `}`] is the sequence consisting of the code unit value 0x0075 followed by the code unit value 0x007B followed by the code units of the TRV of |CodePoint|. +
  • +
  • + The TRV of DecimalDigit :: one of `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` is the SV of the |SourceCharacter| that is that single code point. +
  • The TRV of CharacterEscapeSequence :: SingleEscapeCharacter is the TRV of the |SingleEscapeCharacter|.
  • @@ -10682,7 +10730,7 @@

    Static Semantics: TV and TRV

    The TRV of UnicodeEscapeSequence :: `u` Hex4Digits is the sequence consisting of code unit value 0x0075 followed by TRV of |Hex4Digits|.
  • - The TRV of UnicodeEscapeSequence :: `u{` HexDigits `}` is the sequence consisting of code unit value 0x0075 followed by code unit value 0x007B followed by TRV of |HexDigits| followed by code unit value 0x007D. + The TRV of UnicodeEscapeSequence :: `u{` CodePoint `}` is the sequence consisting of code unit value 0x0075 followed by code unit value 0x007B followed by TRV of |CodePoint| followed by code unit value 0x007D.
  • The TRV of Hex4Digits :: HexDigit HexDigit HexDigit HexDigit is the sequence consisting of the TRV of the first |HexDigit| followed by the TRV of the second |HexDigit| followed by the TRV of the third |HexDigit| followed by the TRV of the fourth |HexDigit|. @@ -11733,29 +11781,59 @@

    Runtime Semantics: Evaluation

    Template Literals

    Syntax

    - TemplateLiteral[Yield, Await] : + TemplateLiteral[Yield, Await, Tagged] : NoSubstitutionTemplate - TemplateHead Expression[+In, ?Yield, ?Await] TemplateSpans[?Yield, ?Await] + SubstitutionTemplate[?Yield, ?Await, ?Tagged] - TemplateSpans[Yield, Await] : + SubstitutionTemplate[Yield, Await, Tagged] : + TemplateHead Expression[+In, ?Yield, ?Await] TemplateSpans[?Yield, ?Await, ?Tagged] + + TemplateSpans[Yield, Await, Tagged] : TemplateTail - TemplateMiddleList[?Yield, ?Await] TemplateTail + TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateTail - TemplateMiddleList[Yield, Await] : + TemplateMiddleList[Yield, Await, Tagged] : TemplateMiddle Expression[+In, ?Yield, ?Await] - TemplateMiddleList[?Yield, ?Await] TemplateMiddle Expression[+In, ?Yield, ?Await] + TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateMiddle Expression[+In, ?Yield, ?Await] - +

    Static Semantics: Early Errors

    - TemplateLiteral : - NoSubstitutionTemplate - TemplateHead Expression TemplateSpans + TemplateLiteral[Yield, Await, Tagged] : NoSubstitutionTemplate + +
      +
    • + It is a Syntax Error if the Tagged parameter was not set and |NoSubstitutionTemplate| Contains |NotEscapeSequence|. +
    • +
    + + + SubstitutionTemplate[Yield, Await, Tagged] : TemplateHead Expression[In, ?Yield] TemplateSpans[?Yield, ?Tagged] + +
      +
    • + It is a Syntax Error if the Tagged parameter was not set and |TemplateHead| Contains |NotEscapeSequence|. +
    • +
    + + + TemplateSpans[Yield, Await, Tagged] : TemplateTail + +
      +
    • + It is a Syntax Error if the Tagged parameter was not set and |TemplateTail| Contains |NotEscapeSequence|. +
    • +
    + + + TemplateMiddleList[Yield, Await, Tagged] : + TemplateMiddle Expression[+In, ?Yield, ?Await] + TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateMiddle Expression[+In, ?Yield, ?Await]
    • - It is a Syntax Error if the number of elements in the result of TemplateStrings of |TemplateLiteral| with argument *false* is greater than 232-1. + It is a Syntax Error if the Tagged parameter was not set and |TemplateMiddle| Contains |NotEscapeSequence|.
    @@ -11772,7 +11850,7 @@

    Static Semantics: TemplateStrings

    1. Let _string_ be the TRV of |NoSubstitutionTemplate|. 1. Return a List containing the single element, _string_. - TemplateLiteral : TemplateHead Expression TemplateSpans + SubstitutionTemplate : TemplateHead Expression TemplateSpans 1. If _raw_ is *false*, then 1. Let _head_ be the TV of |TemplateHead|. @@ -12035,7 +12113,7 @@

    Syntax

    PrimaryExpression[?Yield, ?Await] MemberExpression[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` MemberExpression[?Yield, ?Await] `.` IdentifierName - MemberExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await] + MemberExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, Tagged] SuperProperty[?Yield, ?Await] MetaProperty `new` MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] @@ -12060,7 +12138,7 @@

    Syntax

    CallExpression[?Yield, ?Await] Arguments[?Yield, ?Await] CallExpression[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` CallExpression[?Yield, ?Await] `.` IdentifierName - CallExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, Tagged] SuperCall[Yield, Await] : `super` Arguments[?Yield, ?Await] @@ -28961,7 +29039,7 @@

    Syntax

    [+U] `u` TrailSurrogate [+U] `u` NonSurrogate [~U] `u` Hex4Digits - [+U] `u{` HexDigits `}` + [+U] `u{` CodePoint `}`

    Each `\\u` |TrailSurrogate| for which the choice of associated `u` |LeadSurrogate| is ambiguous shall be associated with the nearest possible `u` |LeadSurrogate| that would otherwise have no corresponding `\\u` |TrailSurrogate|.

    @@ -29017,23 +29095,6 @@

    Syntax

    CharacterClassEscape CharacterEscape[?U]
    - - - -

    Static Semantics: Early Errors

    - Pattern :: Disjunction -
      -
    • - It is a Syntax Error if _NcapturingParens_ ≥ 232-1. -
    • -
    - RegExpUnicodeEscapeSequence :: `u{` HexDigits `}` -
      -
    • - It is a Syntax Error if the MV of |HexDigits| > 0x10FFFF. -
    • -
    -
    @@ -29934,9 +29995,9 @@

    CharacterEscape

    1. Return the character whose code is the SV of |Hex4Digits|. -

    The production RegExpUnicodeEscapeSequence :: `u{` HexDigits `}` evaluates as follows:

    +

    The production RegExpUnicodeEscapeSequence :: `u{` CodePoint `}` evaluates as follows:

    - 1. Return the character whose code is the MV of |HexDigits|. + 1. Return the character whose code is the MV of |CodePoint|.

    The production LeadSurrogate :: Hex4Digits evaluates as follows: