13.1 Identifiers
Syntax
yield
and await
are permitted as
let
await 0;
13.1.1 Static Semantics: Early Errors
-
It is a Syntax Error if the
source text matched by this production is contained instrict mode code and theStringValue ofIdentifier is either"arguments" or"eval" .
-
It is a Syntax Error if the
source text matched by this production is contained instrict mode code .
-
It is a Syntax Error if the
goal symbol of the syntactic grammar isModule .
- It is a Syntax Error if this production has a [Yield] parameter.
- It is a Syntax Error if this production has an [Await] parameter.
-
It is a Syntax Error if this production has a [Yield] parameter and
StringValue ofIdentifier is"yield" . -
It is a Syntax Error if this production has an [Await] parameter and
StringValue ofIdentifier is"await" .
-
It is a Syntax Error if this phrase is contained in
strict mode code and theStringValue ofIdentifierName is one of"implements" ,"interface" ,"let" ,"package" ,"private" ,"protected" ,"public" ,"static" , or"yield" . -
It is a Syntax Error if the
goal symbol of the syntactic grammar isModule and theStringValue ofIdentifierName is"await" . -
It is a Syntax Error if the
StringValue ofIdentifierName is theStringValue of anyReservedWord except foryield
orawait
.
13.1.2 Static Semantics: StringValue
The
- Let idTextUnescaped be
IdentifierCodePoints ofIdentifierName . - Return
CodePointsToString (idTextUnescaped).
- Return
"yield" .
- Return
"await" .
- Return the
StringValue ofIdentifierName .
- Return the
string-concatenation of 0x0023 (NUMBER SIGN) and theStringValue ofIdentifierName .
- Return the
SV ofStringLiteral .
13.1.3 Runtime Semantics: Evaluation
- Return ?
ResolveBinding (StringValue ofIdentifier ).
- Return ?
ResolveBinding ("yield" ).
- Return ?
ResolveBinding ("await" ).
The result of evaluating an
In yield
may be used as an identifier. Evaluating the yield
as if it was an