15.3 Arrow Function Definitions
Syntax
Supplemental Syntax
When processing an instance of the production
the interpretation of
15.3.1 Static Semantics: Early Errors
-
It is a Syntax Error if
ArrowParameters Contains YieldExpression istrue . -
It is a Syntax Error if
ArrowParameters Contains AwaitExpression istrue . -
It is a Syntax Error if
ConciseBodyContainsUseStrict ofConciseBody istrue andIsSimpleParameterList ofArrowParameters isfalse . -
It is a Syntax Error if any element of the
BoundNames ofArrowParameters also occurs in theLexicallyDeclaredNames ofConciseBody .
15.3.2 Static Semantics: ConciseBodyContainsUseStrict
The
- Return
false .
- Return
FunctionBodyContainsUseStrict ofFunctionBody .
15.3.3 Runtime Semantics: EvaluateConciseBody
The
- Perform ?
FunctionDeclarationInstantiation (functionObject, argumentsList). - Return ?
Evaluation ofExpressionBody .
15.3.4 Runtime Semantics: InstantiateArrowFunctionExpression
The
- If name is not present, set name to
"" . - Let env be the LexicalEnvironment of the
running execution context . - Let privateEnv be the
running execution context 's PrivateEnvironment. - Let sourceText be the
source text matched by ArrowFunction . - Let closure be
OrdinaryFunctionCreate (%Function.prototype% , sourceText,ArrowParameters ,ConciseBody ,lexical-this , env, privateEnv). - Perform
SetFunctionName (closure, name). - Return closure.
An arguments
, super
, this
, or new.target
. Any reference to arguments
, super
, this
, or new.target
within an super
, the super
is always contained within a non-super
is accessible via the env that is captured by the
15.3.5 Runtime Semantics: Evaluation
- Return
InstantiateArrowFunctionExpression ofArrowFunction .
- Let exprRef be ?
Evaluation ofAssignmentExpression . - Let exprValue be ?
GetValue (exprRef). - Return
Completion Record { [[Type]]:return , [[Value]]: exprValue, [[Target]]:empty }.