function
BindingIdentifier[?Yield] (
FormalParameters )
{
FunctionBody }
function
(
FormalParameters )
{
FunctionBody }
function
BindingIdentifieropt (
FormalParameters )
{
FunctionBody }
,
FunctionRestParameter[?Yield],
FormalParameter[?Yield]A Directive Prologue is the longest sequence of ExpressionStatement productions occurring as the initial StatementListItem or ModuleItem productions of a FunctionBody, a ScriptBody, or a ModuleBody and where each ExpressionStatement in the sequence consists entirely of a StringLiteral token followed by a semicolon. The semicolon may appear explicitly or may be inserted by automatic semicolon insertion. A Directive Prologue may be an empty sequence.
A Use Strict Directive is an ExpressionStatement in a Directive Prologue whose StringLiteral is either the exact code unit sequences "use
strict"
or
'use
strict'
. A Use Strict Directive may not contain an EscapeSequence or LineContinuation.
A Directive Prologue may contain more than one Use Strict Directive. However, an implementation may issue a warning if this occurs.
NOTE The ExpressionStatement productions of a Directive Prologue are evaluated normally during evaluation of the containing production. Implementations may define implementation specific meanings for ExpressionStatement productions which are not a Use Strict Directive and which occur in a Directive Prologue. If an appropriate notification mechanism exists, an implementation should issue a warning if it encounters in a Directive Prologue an ExpressionStatement that is not a Use Strict Directive and which does not have a meaning defined by the implementation.
FunctionDeclaration : function
BindingIdentifier (
FormalParameters )
{
FunctionBody }
FunctionDeclaration : function
(
FormalParameters )
{
FunctionBody }
FunctionExpression : function
BindingIdentifieropt (
FormalParameters )
{
FunctionBody
}
If the source code matching this production is strict code, the Early Error rules for StrictFormalParameters : FormalParameters are applied.
If the source code matching this production is strict code, it is a Syntax Error
if BindingIdentifier is the IdentifierName eval
or the
IdentifierName arguments
.
It is a Syntax Error if any element of the BoundNames of FormalParameters also occurs in the LexicallyDeclaredNames of FunctionBody.
It is a Syntax Error if FormalParameters Contains SuperProperty is true.
It is a Syntax Error if FunctionBody Contains SuperProperty is true.
It is a Syntax Error if FormalParameters Contains SuperCall is true.
It is a Syntax Error if FunctionBody Contains SuperCall is true.
NOTE 1 The LexicallyDeclaredNames of a FunctionBody does not include identifiers bound using var or function declarations.
It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements.
It is a Syntax Error if IsSimpleParameterList of FormalParameterList is false and BoundNames of FormalParameterList contains any duplicate elements.
NOTE 2 Multiple occurrences of the same BindingIdentifier in a FormalParameterList is only allowed for functions and generator functions which have simple parameter lists and which are not defined in strict mode code.
It is a Syntax Error if the LexicallyDeclaredNames of FunctionStatementList contains any duplicate entries.
It is a Syntax Error if any element of the LexicallyDeclaredNames of FunctionStatementList also occurs in the VarDeclaredNames of FunctionStatementList.
It is a Syntax Error if ContainsDuplicateLabels of FunctionStatementList with argument « » is true.
It is a Syntax Error if ContainsUndefinedBreakTarget of FunctionStatementList with argument « » is true.
It is a Syntax Error if ContainsUndefinedContinueTarget of FunctionStatementList with arguments « » and « » is true.
See also: 12.1.2, 13.3.1.2, 13.3.2.1, 13.3.3.1, 13.7.5.2, 14.2.2, 14.4.2, 14.5.2, 15.2.2.2, 15.2.3.2.
function
BindingIdentifier (
FormalParameters )
{
FunctionBody }
function
(
FormalParameters )
{
FunctionBody }
"*default*"
».NOTE "*default*"
is used within this specification as a synthetic name for
hoistable anonymous functions that are defined using export declarations.
,
FunctionRestParameter,
FormalParameterWith parameter symbol.
See also: 5.3, 12.2.6.3, 12.3.1.1, 14.2.3, 14.4.4, 14.5.4
function
BindingIdentifier (
FormalParameters )
{
FunctionBody }
FunctionDeclaration : function
(
FormalParameters )
{
FunctionBody }
FunctionExpression : function
BindingIdentifieropt (
FormalParameters )
{
FunctionBody
}
NOTE Static semantic rules that depend upon substructure generally do not look into function definitions.
,
FunctionRestParameter,
FormalParameter,
FunctionRestParameterNOTE The ExpectedArgumentCount of a FormalParameterList is the number of FormalParameters to the left of either the rest parameter or the first FormalParameter with an Initializer. A FormalParameter without an initializer is allowed after the first parameter with an initializer but such parameters are considered to be optional with undefined as their default value.
,
FormalParameter,
FunctionRestParameter,
FormalParameterSee also: 12.2.1.2, 14.2.7, 14.4.7, 14.5.6.
function
(
FormalParameters )
{
FunctionBody }
function
BindingIdentifier (
FormalParameters )
{
FunctionBody }
The abstract operation IsAnonymousFunctionDefinition determines if its argument is a function definition that does not bind a name. The argument production is the result of parsing an AssignmentExpression or Initializer. The following steps are taken:
See also: 13.3.1.3, 14.4.8, 14.5.7, 15.2.3.7.
FunctionDeclaration : function
BindingIdentifier (
FormalParameters )
{
FunctionBody }
FunctionDeclaration : function
(
FormalParameters )
{
FunctionBody }
See also: 12.2.1.3, 12.2.10.2, 12.3.1.2, 12.4.2, 12.5.2, 12.6.1, 12.7.1, 12.8.1, 12.9.1, 12.10.1, 12.11.1, 12.12.1, 12.13.1, 12.14.2, 12.15.1, 14.4.9, 14.5.8.
function
(
FormalParameters )
{
FunctionBody }
function
BindingIdentifier (
FormalParameters )
{
FunctionBody }
,
FunctionRestParameter,
FormalParameterSee also: 13.2.5, 13.12.5, 13.13.6, 14.2.10, 15.1.3, 15.2.1.11.
See also: 13.2.6, 13.12.6, 13.13.7, 14.2.11, 15.1.4, 15.2.1.12, 15.2.3.8.
See also: 13.1.5, 13.2.11, 13.3.2.2, 13.6.5, 13.7.2.4, 13.7.3.4, 13.7.4.5, 13.7.5.7, 13.11.5, 13.12.7, 13.13.12, 13.15.5, 14.2.12, 15.1.5, 15.2.1.13.
See also: 13.1.6, 13.2.12, 13.3.2.3, 13.6.6, 13.7.2.5, 13.7.3.5, 13.7.4.6, 13.7.5.8, 13.11.6, 13.12.8, 13.13.13, 13.15.6, 14.2.13, 15.1.6, 15.2.1.14.
With parameter functionObject.
With parameters iteratorRecord and environment.
NOTE When undefined is passed for environment it indicates that a PutValue operation should be used to assign the initialization value. This is the case for formal parameter lists of non-strict functions. In that case the formal parameter bindings are preinitialized in order to deal with the possibility of multiple parameters with the same name.
,
FunctionRestParameter,
FormalParameterThe new Environment Record created in step 6 is only used if the BindElement’s Initializer contains a direct eval.
With parameter scope.
See also: 14.4.12.
function
BindingIdentifier (
FormalParameters )
{
FunctionBody }
function
(
FormalParameters )
{
FunctionBody }
"default"
).NOTE An anonymous FunctionDeclaration can only occur as part of an
export default
declaration.
function
BindingIdentifier (
FormalParameters )
{
FunctionBody }
NOTE 1 An alternative semantics is provided in B.3.3.
function
(
FormalParameters )
{
FunctionBody }
function
(
FormalParameters )
{
FunctionBody }
function
BindingIdentifier (
FormalParameters )
{
FunctionBody }
NOTE 2 The BindingIdentifier in a FunctionExpression can be referenced from inside the FunctionExpression's FunctionBody to allow the function to call itself recursively. However, unlike in a FunctionDeclaration, the BindingIdentifier in a FunctionExpression cannot be referenced from and does not affect the scope enclosing the FunctionExpression.
NOTE 3 A prototype
property is automatically created for every function defined
using a FunctionDeclaration or FunctionExpression, to allow for the
possibility that the function will be used as a constructor.
=>
ConciseBody[?In]{
FunctionBody }
When the production
ArrowParameters[Yield] : CoverParenthesizedExpressionAndArrowParameterList[?Yield]
is recognized the following grammar is used to refine the interpretation of CoverParenthesizedExpressionAndArrowParameterList :
(
StrictFormalParameters[?Yield] )
=>
ConciseBodyIt is a Syntax Error if ArrowParameters Contains YieldExpression is true.
It is a Syntax Error if ConciseBody Contains YieldExpression is true.
It is a Syntax Error if any element of the BoundNames of ArrowParameters also occurs in the LexicallyDeclaredNames of ConciseBody.
ArrowParameters[Yield] : CoverParenthesizedExpressionAndArrowParameterList[?Yield]
If the [Yield] grammar parameter is present on ArrowParameters, it is a Syntax Error if the lexical token sequence matched by CoverParenthesizedExpressionAndArrowParameterList[?Yield] cannot be parsed with no tokens left over using ArrowFormalParameters[Yield] as the goal symbol.
If the [Yield] grammar parameter is not present on ArrowParameters, it is a Syntax Error if the lexical token sequence matched by CoverParenthesizedExpressionAndArrowParameterList[?Yield] cannot be parsed with no tokens left over using ArrowFormalParameters as the goal symbol.
All early errors rules for ArrowFormalParameters and its derived productions also apply to CoveredFormalsList of CoverParenthesizedExpressionAndArrowParameterList[?Yield].
See also: 12.1.2, 13.3.1.2, 13.3.2.1, 13.3.3.1, 13.7.5.2, 14.1.3, 14.4.2, 14.5.2, 15.2.2.2, 15.2.3.2.
With parameter symbol.
See also: 5.3, 12.2.6.3, 12.3.1.1, 14.1.4, 14.4.4, 14.5.4
=>
ConciseBodysuper
or
this
, return false.NOTE Normally, Contains does not look inside
most function forms However, Contains is used to detect
new.target
, this
, and super
usage within an ArrowFunction.
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
See also: 12.2.1.2, 14.1.8, 14.4.7, 14.5.6.
=>
ConciseBody(
Expression )
(
)
(
...
BindingIdentifier )
(
Expression ,
...
BindingIdentifier )
See also: 13.2.5, 13.12.5, 13.13.6, 14.1.13, 15.1.3, 15.2.1.11.
See also: 13.2.6, 13.12.6, 13.13.7, 14.1.14, 15.1.4, 15.2.1.12, 15.2.3.8.
See also: 13.1.5, 13.2.11, 13.3.2.2, 13.6.5, 13.7.2.4, 13.7.3.4, 13.7.4.5, 13.7.5.7, 13.11.5, 13.12.7, 13.13.12, 13.15.5, 14.1.15, 15.1.5, 15.2.1.13.
See also: 13.1.6, 13.2.12, 13.3.2.3, 13.6.6, 13.7.2.5, 13.7.3.5, 13.7.4.6, 13.7.5.8, 13.11.6, 13.12.8, 13.13.13, 13.15.6, 14.1.16, 15.1.6, 15.2.1.14.
With parameters iteratorRecord and environment.
NOTE When undefined is passed for environment it indicates that a PutValue operation should be used to assign the initialization value. This is the case for formal parameter lists of non-strict functions. In that case the formal parameter bindings are preinitialized in order to deal with the possibility of multiple parameters with the same name.
With parameter functionObject.
=>
ConciseBodyNOTE 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.
(
StrictFormalParameters )
{
FunctionBody }
get
PropertyName[?Yield] (
)
{
FunctionBody }
set
PropertyName[?Yield] (
PropertySetParameterList )
{
FunctionBody }
(
StrictFormalParameters )
{
FunctionBody }
It is a Syntax Error if any element of the BoundNames of StrictFormalParameters also occurs in the LexicallyDeclaredNames of FunctionBody.
set
PropertyName (
PropertySetParameterList )
{
FunctionBody }
It is a Syntax Error if BoundNames of PropertySetParameterList contains any duplicate elements.
It is a Syntax Error if any element of the BoundNames of PropertySetParameterList also occurs in the LexicallyDeclaredNames of FunctionBody.
With parameter symbol.
See also: 12.2.6.2, 14.4.3, 14.5.5.
(
StrictFormalParameters )
{
FunctionBody }
get
PropertyName (
)
{
FunctionBody }
set
PropertyName (
PropertySetParameterList )
{
FunctionBody }
(
StrictFormalParameters )
{
FunctionBody }
get
PropertyName (
)
{
FunctionBody }
set
PropertyName (
PropertySetParameterList )
{
FunctionBody }
See also: 14.4.6.
(
StrictFormalParameters )
{
FunctionBody }
get
PropertyName (
)
{
FunctionBody }
set
PropertyName (
PropertySetParameterList )
{
FunctionBody }
See also: 12.2.6.6, 14.4.10, 14.5.12
(
StrictFormalParameters )
{
FunctionBody }
get
PropertyName (
)
{
FunctionBody }
set
PropertyName (
PropertySetParameterList )
{
FunctionBody }
(
StrictFormalParameters )
{
FunctionBody }
get
PropertyName (
)
{
FunctionBody }
set
PropertyName (
PropertySetParameterList )
{
FunctionBody }
With parameters object and optional parameter functionPrototype.
(
StrictFormalParameters )
{
FunctionBody }
With parameters object and enumerable.
See also: 12.2.6.9, 14.4.13, B.3.1
(
StrictFormalParameters )
{
FunctionBody }
See 14.4.
get
PropertyName (
)
{
FunctionBody }
"get"
).set
PropertyName (
PropertySetParameterList )
{
FunctionBody }
"set"
).*
PropertyName[?Yield] (
StrictFormalParameters[Yield] )
{
GeneratorBody }
function
*
BindingIdentifier[?Yield] (
FormalParameters[Yield] )
{
GeneratorBody }
function
*
(
FormalParameters[Yield] )
{
GeneratorBody }
function
*
BindingIdentifier[Yield]opt (
FormalParameters[Yield] )
{
GeneratorBody }
yield
yield
[no LineTerminator here] AssignmentExpression[?In, Yield]yield
[no LineTerminator here] *
AssignmentExpression[?In, Yield]NOTE 1 The syntactic context immediately following yield
requires use of the InputElementRegExpOrTemplateTail lexical goal.
NOTE 2 YieldExpression cannot be used within the FormalParameters of a generator function because any expressions that are part of FormalParameters are evaluated before the resulting generator object is in a resumable state.
NOTE 3 Abstract operations relating to generator objects are defined in 25.3.3.
*
PropertyName (
StrictFormalParameters )
{
GeneratorBody }
It is a Syntax Error if HasDirectSuper of GeneratorMethod is true.
It is a Syntax Error if StrictFormalParameters Contains YieldExpression is true.
It is a Syntax Error if any element of the BoundNames of StrictFormalParameters also occurs in the LexicallyDeclaredNames of GeneratorBody.
function
*
BindingIdentifier (
FormalParameters )
{
GeneratorBody }
function
*
BindingIdentifieropt (
FormalParameters )
{
GeneratorBody }
GeneratorDeclaration : function
*
BindingIdentifier (
FormalParameters )
{
GeneratorBody
}
GeneratorExpression :
function
*
BindingIdentifieropt (
FormalParameters )
{
GeneratorBody }
If the source code matching this production is strict code, the Early Error rules for StrictFormalParameters : FormalParameters are applied.
If the source code matching this production is strict code, it is a Syntax Error
if BindingIdentifier is the IdentifierName eval
or the
IdentifierName arguments
.
It is a Syntax Error if any element of the BoundNames of FormalParameters also occurs in the LexicallyDeclaredNames of GeneratorBody.
It is a Syntax Error if FormalParameters Contains YieldExpression is true.
It is a Syntax Error if FormalParameters Contains SuperProperty is true.
It is a Syntax Error if GeneratorBody Contains SuperProperty is true.
See also: 12.1.2, 13.3.1.2, 13.3.2.1, 13.3.3.1, 13.7.5.2, 14.1.3, 14.2.2, 14.5.2, 15.2.2.2, 15.2.3.2.
function
*
BindingIdentifier (
FormalParameters )
{
GeneratorBody }
function
*
(
FormalParameters )
{
GeneratorBody }
"*default*"
».NOTE "*default*"
is used within this specification as a synthetic name for
hoistable anonymous functions that are defined using export declarations.
With parameter symbol.
See also: 12.2.6.2, 14.3.2, 14.5.5.
*
PropertyName (
StrictFormalParameters )
{
GeneratorBody }
With parameter symbol.
See also: 5.3, 12.2.6.3, 12.3.1.1, 14.1.4, 14.2.3, 14.5.4
GeneratorDeclaration : function
*
BindingIdentifier (
FormalParameters )
{
GeneratorBody
}GeneratorDeclaration
:
function
*
(
FormalParameters )
{
GeneratorBody }
function
*
BindingIdentifieropt (
FormalParameters )
{
GeneratorBody }
NOTE Static semantic rules that depend upon substructure generally do not look into function definitions.
*
PropertyName (
StrictFormalParameters )
{
GeneratorBody }
See also: 14.3.5.
*
PropertyName (
StrictFormalParameters )
{
GeneratorBody }
GeneratorDeclaration : function
*
BindingIdentifier (
FormalParameters )
{
GeneratorBody
}
GeneratorDeclaration :
function
*
(
FormalParameters )
{
GeneratorBody }
GeneratorExpression : function
*
(
FormalParameters )
{
GeneratorBody }
GeneratorExpression : function
*
BindingIdentifier (
FormalParameters )
{
GeneratorBody }
See also: 12.2.1.2, 14.1.8, 14.2.7, 14.5.6.
function
*
(
FormalParameters )
{
GeneratorBody }
function
*
BindingIdentifier (
FormalParameters )
{
GeneratorBody }
See also: 13.3.1.3, 14.1.10, 14.5.7, 15.2.3.7.
GeneratorDeclaration : function
*
BindingIdentifier (
FormalParameters )
{
GeneratorBody
}GeneratorDeclaration
:
function
*
(
FormalParameters )
{
GeneratorBody }
See also: 12.2.1.3, 12.2.10.2, 12.3.1.2, 12.4.2, 12.5.2, 12.6.1, 12.7.1, 12.8.1, 12.9.1, 12.10.1, 12.11.1, 12.12.1, 12.13.1, 12.14.2, 12.15.1, 14.1.11, 14.5.8.
function
*
(
FormalParameters )
{
GeneratorBody }
function
*
BindingIdentifier (
FormalParameters )
{
GeneratorBody }
See also: 12.2.6.6, 14.3.6, 14.5.12
*
PropertyName (
StrictFormalParameters )
{
GeneratorBody }
With parameter functionObject.
"%GeneratorPrototype%"
, «[[GeneratorState]], [[GeneratorContext]]» ).NOTE If the generator was invoked using [[Call]], the this
binding will have
already been initialized in the normal manner. If the generator was invoked using [[Construct]], the this
bind is not initialized and any references to this
within the FunctionBody will
produce a ReferenceError exception.
With parameter scope.
See also: 14.1.19.
function
*
BindingIdentifier (
FormalParameters )
{
GeneratorBody }
function
*
(
FormalParameters )
{
GeneratorBody }
"default"
).NOTE An anonymous GeneratorDeclaration can only occur as part of an
export default
declaration.
With parameter object and enumerable.
See also: 12.2.6.9, 14.3.9, B.3.1
*
PropertyName (
StrictFormalParameters )
{
GeneratorBody }
function
*
(
FormalParameters )
{
GeneratorBody }
function
*
BindingIdentifier (
FormalParameters )
{
GeneratorBody }
NOTE The BindingIdentifier in a GeneratorExpression can be referenced from inside the GeneratorExpression's FunctionBody to allow the generator code to call itself recursively. However, unlike in a GeneratorDeclaration, the BindingIdentifier in a GeneratorExpression cannot be referenced from and does not affect the scope enclosing the GeneratorExpression.
yield
yield
AssignmentExpressionyield
*
AssignmentExpression"throw"
).throw
method are propagated. Normal completions
from an inner throw
method are processed similarly to an inner next
.throw
method, this throw is going to terminate
the yield*
loop. But first we need to give iterator a chance to clean up.yield*
protocol violation: iterator does not have a throw
method."return"
).class
BindingIdentifier[?Yield] ClassTail[?Yield]class
ClassTail[?Yield]class
BindingIdentifier[?Yield]opt ClassTail[?Yield]{
ClassBody[?Yield]opt }
extends
LeftHandSideExpression[?Yield]static
MethodDefinition[?Yield];
NOTE A ClassBody is always strict code.
{
ClassBody }
It is a Syntax Error if ClassHeritage is not present and the following algorithm evaluates to true:
It is a Syntax Error if PrototypePropertyNameList of ClassElementList contains more than one occurrence of "constructor"
.
It is a Syntax Error if PropName of MethodDefinition is not "constructor"
and HasDirectSuper of MethodDefinition is true.
It is a Syntax Error if PropName of MethodDefinition is "constructor"
and SpecialMethod of MethodDefinition is true.
static
MethodDefinition"prototype"
.See also: 12.1.2, 13.3.1.2, 13.3.2.1, 13.3.3.1, 13.7.5.2, 14.1.3, 14.2.2, 14.4.2, 15.2.2.2, 15.2.3.2.
class
BindingIdentifier ClassTailclass
ClassTail"*default*"
».;
, return empty."constructor"
, return empty.;
, return empty."constructor"
, return empty.NOTE Early Error rules ensure that there is only one method definition named
"constructor"
and that it is not an accessor property or generator definition.
With parameter symbol.
See also: 5.3, 12.2.6.3, 12.3.1.1, 14.1.4, 14.2.3, 14.4.4
{
ClassBody }
NOTE Static semantic rules that depend upon substructure generally do not look into class bodies except for PropertyName productions.
With parameter symbol.
See also: 12.2.6.2, 14.3.2, 14.4.3.
static
MethodDefinition;
See also: 12.2.1.2, 14.1.8, 14.2.7, 14.4.7.
class
ClassTailclass
BindingIdentifier ClassTailSee also: 13.3.1.3, 14.1.10, 14.4.8, 15.2.3.7.
ClassDeclaration : class
BindingIdentifier ClassTail
class
ClassTailSee also: 12.2.1.3, 12.2.10.2, 12.3.1.2, 12.4.2, 12.5.2, 12.6.1, 12.7.1, 12.8.1, 12.9.1, 12.10.1, 12.11.1, 12.12.1, 12.13.1, 12.14.2, 12.15.1, 14.1.11, 14.4.9.
class
ClassTailclass
BindingIdentifier ClassTailstatic
MethodDefinition;
;
, return a new empty List."constructor"
,
return a new empty List.;
, return list."constructor"
,
return list.See also: 12.2.6.6, 14.3.6, 14.4.10
;
With parameter className.
{
ClassBodyopt }
"generator"
, throw a TypeError exception."prototype"
).constructor(... args){ super
(...args);}
using
the syntactic grammar with the goal symbol MethodDefinition.constructor(
){ }
using the syntactic grammar with the goal symbol MethodDefinition."derived"
."constructor"
,
F).class
BindingIdentifier ClassTail"name"
).class
ClassTailNOTE ClassDeclaration :
class
ClassTail only occurs as part of an ExportDeclaration and the setting of a name property and establishing its binding are handled as part
of the evaluation action for that production. See 15.2.3.11.
class
BindingIdentifier ClassTailNOTE 1 ClassDeclaration :
class
ClassTail only occurs as part of an ExportDeclaration and is never directly evaluated.
class
BindingIdentifieropt ClassTail"name"
).NOTE 2 If the class definition included a name
static method then that method is
not over-written with a name
data property for the class name.
The abstract operation IsInTailPosition with argument nonterminal performs the following steps:
NOTE Tail Position calls are only defined in strict mode code because of a common non-standard language extension (see 9.2.7) that enables observation of the chain of caller contexts.
With parameter nonterminal.
NOTE nonterminal is a parsed grammar production that represent a specific range of source text. When the following algorithms compare nonterminal to other grammar symbols they are testing whether the same source text was matched by both symbols.
FunctionStatementList : [empty]
StatementListItem : Declaration
:
{
}
:
return
;
:
FunctionDeclarationfor
(
LeftHandSideExpression in
Expression )
Statementfor
(
var
ForBinding in
Expression )
Statementfor
(
ForDeclaration in
Expression )
Statementfor
(
LeftHandSideExpression of
AssignmentExpression )
Statementfor
(
var
ForBinding of
AssignmentExpression )
Statementfor
(
ForDeclaration of
AssignmentExpression )
Statement:
{
}
if
(
Expression )
Statement else
StatementIfStatement : if
(
Expression )
Statement
do
Statement while
(
Expression )
;
while
(
Expression )
Statementfor
(
Expressionopt ;
Expressionopt ;
Expressionopt )
Statementfor
(
var
VariableDeclarationList ;
Expressionopt ;
Expressionopt )
Statementfor
(
LexicalDeclaration Expressionopt ;
Expressionopt )
Statement:
with
(
Expression )
Statement:
LabelledItemreturn
Expression ;
switch
(
Expression )
CaseBlock{
CaseClausesopt DefaultClause CaseClausesopt }
CaseClause : case
Expression :
StatementListopt
default
:
StatementListopttry
Block CatchTryStatement : try
Block Finally
try
Block Catch Finallycatch
(
CatchParameter )
BlockNOTE A potential tail position call that is immediately followed by return GetValue of the call result is also a possible tail position call. Function calls cannot return reference values, so such a GetValue operation will always returns the same value as the actual function call result.
=
AssignmentExpression:
BitwiseANDExpression &
EqualityExpression:
BitwiseXORExpression ^
BitwiseANDExpression:
BitwiseORExpression |
BitwiseXORExpression==
RelationalExpression!=
RelationalExpression===
RelationalExpression!==
RelationalExpression<
ShiftExpression>
ShiftExpression<=
ShiftExpression>=
ShiftExpressioninstanceof
ShiftExpressionin
ShiftExpression<<
AdditiveExpression>>
AdditiveExpression>>>
AdditiveExpression+
MultiplicativeExpression-
MultiplicativeExpressiondelete
UnaryExpressionvoid
UnaryExpressiontypeof
UnaryExpression++
UnaryExpression--
UnaryExpression+
UnaryExpression-
UnaryExpression~
UnaryExpression!
UnaryExpression++
--
[
Expression ]
.
IdentifierName:
new
NewExpression[
Expression ]
.
IdentifierNamenew
MemberExpression Argumentsthis
,
AssignmentExpression?
AssignmentExpression :
AssignmentExpression&&
BitwiseORExpression||
LogicalANDExpression(
Expression )
The abstract operation PrepareForTailCall performs the following steps:
A tail position call must either release any transient internal resources associated with the currently executing function execution context before invoking the target function or reuse those resources in support of the target function.
NOTE For example, a tail position call should only grow an implementation's activation record stack by the amount that the size of the target function's activation record exceeds the size of the calling function's activation record. If the target function's activation record is smaller, then the total size of the stack should decrease.