diff --git a/spec.html b/spec.html index 43f39fe00a..c02bcd844f 100644 --- a/spec.html +++ b/spec.html @@ -16163,8 +16163,6 @@

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 |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

PrivateIdentifier :: @@ -16175,15 +16173,21 @@

Syntax

IdentifierName IdentifierPart IdentifierStart :: + IdentifierStartChar + `\` UnicodeEscapeSequence + + IdentifierPart :: + IdentifierPartChar + `\` UnicodeEscapeSequence + + IdentifierStartChar :: UnicodeIDStart `$` `_` - `\` UnicodeEscapeSequence - IdentifierPart :: + IdentifierPartChar :: UnicodeIDContinue `$` - `\` UnicodeEscapeSequence <ZWNJ> <ZWJ> @@ -16203,22 +16207,63 @@

Syntax

Identifier Names

+

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.

Static Semantics: Early Errors

IdentifierStart :: `\` UnicodeEscapeSequence
  • - It is a Syntax Error if the SV of |UnicodeEscapeSequence| is none of *"$"*, or *"_"*, or ! UTF16EncodeCodePoint(_cp_) for some Unicode code point _cp_ matched by the |UnicodeIDStart| lexical grammar production. + It is a Syntax Error if IdentifierCodePoint of |UnicodeEscapeSequence| is not some Unicode code point matched by the |IdentifierStartChar| lexical grammar production.
IdentifierPart :: `\` UnicodeEscapeSequence
  • - It is a Syntax Error if the SV of |UnicodeEscapeSequence| is none of *"$"*, *"_"*, ! UTF16EncodeCodePoint(<ZWNJ>), ! UTF16EncodeCodePoint(<ZWJ>), or ! UTF16EncodeCodePoint(_cp_) for some Unicode code point _cp_ that would be matched by the |UnicodeIDContinue| lexical grammar production. + It is a Syntax Error if IdentifierCodePoint of |UnicodeEscapeSequence| is not some Unicode code point matched by the |IdentifierPartChar| lexical grammar production.
+ + +

Static Semantics: IdentifierCodePoints

+
+
+ IdentifierName :: IdentifierStart + + 1. Let _cp_ be IdentifierCodePoint of |IdentifierStart|. + 1. Return « _cp_ ». + + IdentifierName :: IdentifierName IdentifierPart + + 1. Let _cps_ be IdentifierCodePoints of the derived |IdentifierName|. + 1. Let _cp_ be IdentifierCodePoint of |IdentifierPart|. + 1. Return the list-concatenation of _cps_ and « _cp_ ». + +
+ + +

Static Semantics: IdentifierCodePoint

+
+
+ IdentifierStart :: IdentifierStartChar + + 1. Return the code point matched by |IdentifierStartChar|. + + IdentifierPart :: IdentifierPartChar + + 1. Return the code point matched by |IdentifierPartChar|. + + UnicodeEscapeSequence :: `u` Hex4Digits + + 1. Return the code point whose numeric value is the MV of |Hex4Digits|. + + UnicodeEscapeSequence :: `u{` CodePoint `}` + + 1. Return the code point whose numeric value is the MV of |CodePoint|. + +
@@ -17057,22 +17102,12 @@

Syntax

RegularExpressionFlags :: [empty] - RegularExpressionFlags IdentifierPart + RegularExpressionFlags IdentifierPartChar

Regular expression literals may not be empty; instead of representing an empty regular expression literal, the code unit sequence `//` starts a single-line comment. To specify an empty regular expression, use: `/(?:)/`.

- -

Static Semantics: Early Errors

- RegularExpressionFlags :: RegularExpressionFlags IdentifierPart - -
-

Static Semantics: BodyText

@@ -17676,8 +17711,7 @@

Static Semantics: StringValue

IdentifierName IdentifierPart - 1. Let _idText_ be the source text matched by |IdentifierName|. - 1. Let _idTextUnescaped_ be the result of replacing any occurrences of `\\` |UnicodeEscapeSequence| in _idText_ with the code point represented by the |UnicodeEscapeSequence|. + 1. Let _idTextUnescaped_ be IdentifierCodePoints of |IdentifierName|. 1. Return ! CodePointsToString(_idTextUnescaped_). @@ -34244,19 +34278,14 @@

Syntax

RegExpIdentifierName[?UnicodeMode] RegExpIdentifierPart[?UnicodeMode] RegExpIdentifierStart[UnicodeMode] :: - UnicodeIDStart - `$` - `_` + IdentifierStartChar `\` RegExpUnicodeEscapeSequence[+UnicodeMode] [~UnicodeMode] UnicodeLeadSurrogate UnicodeTrailSurrogate RegExpIdentifierPart[UnicodeMode] :: - UnicodeIDContinue - `$` + IdentifierPartChar `\` RegExpUnicodeEscapeSequence[+UnicodeMode] [~UnicodeMode] UnicodeLeadSurrogate UnicodeTrailSurrogate - <ZWNJ> - <ZWJ> RegExpUnicodeEscapeSequence[UnicodeMode] :: [+UnicodeMode] `u` HexLeadSurrogate `\u` HexTrailSurrogate @@ -34418,25 +34447,25 @@

Static Semantics: Early Errors

RegExpIdentifierStart :: `\` RegExpUnicodeEscapeSequence
  • - It is a Syntax Error if the CharacterValue of |RegExpUnicodeEscapeSequence| is not the code point value of *"$"*, *"_"*, or some code point matched by the |UnicodeIDStart| lexical grammar production. + It is a Syntax Error if the CharacterValue of |RegExpUnicodeEscapeSequence| is not the code point value of some code point matched by the |IdentifierStartChar| lexical grammar production.
RegExpIdentifierStart :: UnicodeLeadSurrogate UnicodeTrailSurrogate
  • - It is a Syntax Error if the result of performing UTF16SurrogatePairToCodePoint on the two code points matched by |UnicodeLeadSurrogate| and |UnicodeTrailSurrogate| respectively is not matched by the |UnicodeIDStart| lexical grammar production. + It is a Syntax Error if RegExpIdentifierCodePoint of |RegExpIdentifierStart| is not matched by the |UnicodeIDStart| lexical grammar production.
RegExpIdentifierPart :: `\` RegExpUnicodeEscapeSequence
  • - It is a Syntax Error if the CharacterValue of |RegExpUnicodeEscapeSequence| is not the code point value of *"$"*, *"_"*, <ZWNJ>, <ZWJ>, or some code point matched by the |UnicodeIDContinue| lexical grammar production. + It is a Syntax Error if the CharacterValue of |RegExpUnicodeEscapeSequence| is not the code point value of some code point matched by the |IdentifierPartChar| lexical grammar production.
RegExpIdentifierPart :: UnicodeLeadSurrogate UnicodeTrailSurrogate
  • - It is a Syntax Error if the result of performing UTF16SurrogatePairToCodePoint on the two code points matched by |UnicodeLeadSurrogate| and |UnicodeTrailSurrogate| respectively is not matched by the |UnicodeIDContinue| lexical grammar production. + It is a Syntax Error if RegExpIdentifierCodePoint of |RegExpIdentifierPart| is not matched by the |UnicodeIDContinue| lexical grammar production.
UnicodePropertyValueExpression :: UnicodePropertyName `=` UnicodePropertyValue @@ -34719,11 +34748,59 @@

Static Semantics: CapturingGroupName

RegExpIdentifierName RegExpIdentifierPart
- 1. Let _idText_ be the source text matched by |RegExpIdentifierName|. - 1. Let _idTextUnescaped_ be the result of replacing any occurrences of `\\` |RegExpUnicodeEscapeSequence| in _idText_ with the code point represented by the |RegExpUnicodeEscapeSequence|. + 1. Let _idTextUnescaped_ be RegExpIdentifierCodePoints of |RegExpIdentifierName|. 1. Return ! CodePointsToString(_idTextUnescaped_). + + +

Static Semantics: RegExpIdentifierCodePoints

+
+
+ RegExpIdentifierName :: RegExpIdentifierStart + + 1. Let _cp_ be RegExpIdentifierCodePoint of |RegExpIdentifierStart|. + 1. Return « _cp_ ». + + RegExpIdentifierName :: RegExpIdentifierName RegExpIdentifierPart + + 1. Let _cps_ be RegExpIdentifierCodePoints of the derived |RegExpIdentifierName|. + 1. Let _cp_ be RegExpIdentifierCodePoint of |RegExpIdentifierPart|. + 1. Return the list-concatenation of _cps_ and « _cp_ ». + +
+ + +

Static Semantics: RegExpIdentifierCodePoint

+
+
+ RegExpIdentifierStart :: IdentifierStartChar + + 1. Return the code point matched by |IdentifierStartChar|. + + RegExpIdentifierPart :: IdentifierPartChar + + 1. Return the code point matched by |IdentifierPartChar|. + + + RegExpIdentifierStart :: `\` RegExpUnicodeEscapeSequence + + RegExpIdentifierPart :: `\` RegExpUnicodeEscapeSequence + + + 1. Return the code point whose numeric value is the CharacterValue of |RegExpUnicodeEscapeSequence|. + + + RegExpIdentifierStart :: UnicodeLeadSurrogate UnicodeTrailSurrogate + + RegExpIdentifierPart :: UnicodeLeadSurrogate UnicodeTrailSurrogate + + + 1. Let _lead_ be the code unit whose numeric value is that of the code point matched by |UnicodeLeadSurrogate|. + 1. Let _trail_ be the code unit whose numeric value is that of the code point matched by |UnicodeTrailSurrogate|. + 1. Return UTF16SurrogatePairToCodePoint(_lead_, _trail_). + +
@@ -46020,6 +46097,8 @@

Lexical Grammar

+ +