With argument labelSet.
See also: 13.2.2, 13.6.2, 13.7.2.1, 13.7.3.1, 13.7.4.2, 13.7.5.3, 13.11.2, 13.12.2, 13.13.2, 13.15.2, 15.2.1.2.
With argument labelSet.
See also: 13.2.3, 13.6.3, 13.7.2.2, 13.7.3.2, 13.7.4.3, 13.7.5.4, 13.9.2, 13.11.3, 13.12.3, 13.13.3, 13.15.3, 15.2.1.3.
With arguments iterationSet and labelSet.
See also: 13.2.4, 13.6.4, 13.7.2.3, 13.7.3.3, 13.7.4.4, 13.7.5.5, 13.8.2, 13.11.4, 13.12.4, 13.13.4,13.15.4, 15.2.1.4.
See also: 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, 14.2.12, 15.1.5, 15.2.1.13.
See also: 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, 14.2.13, 15.1.6, 15.2.1.14.
With argument labelSet.
See also: 13.7.2.6, 13.7.3.6, 13.7.4.7, 13.7.5.11, 13.13.14.
NOTE A BreakableStatement is one that can be exited via an unlabelled BreakStatement.
{ StatementList[?Yield, ?Return]opt }{ StatementList }It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains any duplicate entries.
It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList also occurs in the VarDeclaredNames of StatementList.
With argument labelSet.
See also: 13.1.1, 13.6.2, 13.7.2.1, 13.7.3.1, 13.7.4.2, 13.7.5.3, 13.11.2, 13.12.2, 13.13.2, 13.15.2, 15.2.1.2.
{ }With argument labelSet.
See also: 13.1.2, 13.6.3, 13.7.2.2, 13.7.3.2, 13.7.4.3, 13.7.5.4, 13.9.2, 13.11.3, 13.12.3, 13.13.3, 13.15.3, 15.2.1.3.
{ }With arguments iterationSet and labelSet.
See also: 13.1.3, 13.6.4, 13.7.2.3, 13.7.3.3, 13.7.4.4, 13.7.5.5, 13.8.2, 13.11.4, 13.12.4, 13.13.4,13.15.4, 15.2.1.4.
{ }See also: 13.12.5, 13.13.6, 14.1.13, 14.2.10, 15.1.3, 15.2.1.11.
{ }See also: 13.12.6, 13.13.7, 14.1.14, 14.2.11, 15.1.4, 15.2.1.12, 15.2.3.8.
See also: 13.13.8.
NOTE At the top level of a function, or script, function declarations are treated like var declarations rather than like lexical declarations.
See also: 13.13.9.
{ }See also: 13.13.10.
{ }NOTE At the top level of a function or script, inner function declarations are treated like var declarations.
See also: 13.13.11.
{ }See also: 13.1.5, 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, 14.2.12, 15.1.5, 15.2.1.13.
{ }See also: 13.1.6, 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, 14.2.13, 15.1.6, 15.2.1.14.
{ }{ }{ StatementList }NOTE 1 No matter how control leaves the Block the LexicalEnvironment is always restored to its former state.
NOTE 2 The value of a StatementList is the value of the last value
producing item in the StatementList. For example, the following calls to the eval
function all return the value 1:
eval("1;;;;;")
eval("1;{}")
eval("1;var a;")
NOTE When a Block or CaseBlock production is evaluated a new declarative Environment Record is created and bindings for each block scoped variable, constant, function, generator function, or class declared in the block are instantiated in the Environment Record.
BlockDeclarationInstantiation is performed as follows using arguments code and env. code is the grammar production corresponding to the body of the block. env is the declarative Environment Record in which bindings are to be created.
NOTE let and const declarations define variables that are scoped to
the running execution context's LexicalEnvironment. The variables are created when their containing Lexical Environment is instantiated but may not be accessed in any way until the
variable's LexicalBinding is evaluated. A variable defined by a LexicalBinding with an Initializer is assigned the value of its Initializer’s AssignmentExpression when
the LexicalBinding is evaluated, not when the variable is created. If a LexicalBinding in a let declaration does not have an Initializer
the variable is assigned the value undefined when the LexicalBinding is evaluated.
;letconst, LexicalBinding[?In, ?Yield];"let".It is a Syntax Error if Initializer is not present and IsConstantDeclaration of the LexicalDeclaration containing this production is true.
See also: 12.1.2, 13.3.2.1, 13.3.3.1, 13.7.5.2, 14.1.3, 14.2.2, 14.4.2, 14.5.2, 15.2.2.2, 15.2.3.2.
;, LexicalBindingSee also: 14.1.10, 14.4.8, 14.5.7, 15.2.3.7.
;letconst;, LexicalBindingNOTE A static semantics rule ensures that this form of LexicalBinding
never occurs in a const declaration.
"name").NOTE A var statement declares variables that are scoped to the running execution context's VariableEnvironment. Var variables are created when their containing Lexical Environment is instantiated and are initialized to undefined when
created. Within the scope of any VariableEnvironment a common BindingIdentifier may appear in more than one VariableDeclaration but those
declarations collective define only one variable. A variable defined by a VariableDeclaration
with an Initializer is assigned the value of its Initializer’s AssignmentExpression when the VariableDeclaration is executed, not when the variable is created.
var VariableDeclarationList[In, ?Yield] ;, VariableDeclaration[?In, ?Yield]See also: 12.1.2, 13.3.1.2, 13.3.3.1, 13.7.5.2, 14.1.3, 14.2.2, 14.4.2, 14.5.2, 15.2.2.2, 15.2.3.2.
, VariableDeclarationSee also: 13.1.5, 13.2.11, 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, 14.2.12, 15.1.5, 15.2.1.13.
var VariableDeclarationList ;See also: 13.1.6, 13.2.12, 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, 14.2.13, 15.1.6, 15.2.1.14.
, VariableDeclarationvar VariableDeclarationList ;, VariableDeclaration"name").NOTE If a VariableDeclaration is nested within a with statement and the BindingIdentifier in the VariableDeclaration is the same as a property name of the binding object of the with statement's object Environment Record, then step 7 will assign value to the property instead of assigning to the VariableEnvironment binding of the Identifier.
{ }{ BindingPropertyList[?Yield] }{ BindingPropertyList[?Yield] , }[ Elisionopt BindingRestElement[?Yield]opt ][ BindingElementList[?Yield] ][ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ], BindingProperty[?Yield], BindingElisionElement[?Yield]: BindingElement[?Yield]... BindingIdentifier[?Yield]See also: 12.1.2, 13.3.1.2, 13.3.2.1, 13.7.5.2, 14.1.3, 14.2.2, 14.4.2, 14.5.2, 15.2.2.2, 15.2.3.2.
{ }[ Elisionopt ][ Elisionopt BindingRestElement ][ BindingElementList , Elisionopt ][ BindingElementList , Elisionopt BindingRestElement ], BindingProperty, BindingElisionElement: BindingElement{ }[ Elisionopt ][ Elisionopt BindingRestElement ][ BindingElementList , Elisionopt ][ BindingElementList , Elisionopt BindingRestElement ], BindingProperty, BindingElisionElement: BindingElementWith parameters value 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.
{ }, BindingProperty: BindingElementWith 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.
[ ][ Elision ][ Elisionopt BindingRestElement ][ BindingElementList ][ BindingElementList , ][ BindingElementList , Elision ][ BindingElementList , Elisionopt BindingRestElement ], BindingElisionElement"name").... BindingIdentifierWith parameters value, environment, and propertyName.
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.
"name").;{, function, class, let [}] Expression[In, ?Yield] ;NOTE An ExpressionStatement cannot start with a U+007B (LEFT CURLY
BRACKET) because that might make it ambiguous with a Block. Also, an ExpressionStatement cannot start with the function or class keywords because
that would make it ambiguous with a FunctionDeclaration, a GeneratorDeclaration, or a ClassDeclaration. An ExpressionStatement cannot start with the two token sequence let [ because that would make
it ambiguous with a let LexicalDeclaration whose first LexicalBinding was an ArrayBindingPattern.
;if Statementif ( Expression[In, ?Yield] ) Statement[?Yield, ?Return] else Statement[?Yield, ?Return]if ( Expression[In, ?Yield] ) Statement[?Yield, ?Return]Each else for which the choice of associated if is ambiguous shall be associated with the
nearest possible if that would otherwise have no corresponding else.
if ( Expression ) Statement else Statementif ( Expression ) StatementNOTE It is only necessary to apply this rule if the extension specified in B.3.2 is implemented.
With argument labelSet.
See also: 13.1.1, 13.2.2, 13.7.2.1, 13.7.3.1, 13.7.4.2, 13.7.5.3, 13.11.2, 13.12.2, 13.13.2, 13.15.2, 15.2.1.2.
if ( Expression ) Statement else Statementif ( Expression ) StatementWith argument labelSet.
See also: 13.1.2, 13.2.3, 13.7.2.2, 13.7.3.2, 13.7.4.3, 13.7.5.4, 13.9.2, 13.11.3, 13.12.3, 13.13.3, 13.15.3, 15.2.1.3.
if ( Expression ) Statement else Statementif ( Expression ) StatementWith arguments iterationSet and labelSet.
See also: 13.1.3, 13.2.4, 13.7.2.3, 13.7.3.3, 13.7.4.4, 13.7.5.5, 13.8.2, 13.11.4, 13.12.4, 13.13.4,13.15.4, 15.2.1.4.
if ( Expression ) Statement else Statementif ( Expression ) StatementSee also: 13.1.5, 13.2.11, 13.3.2.2, 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, 14.2.12, 15.1.5, 15.2.1.13.
if ( Expression ) Statement else Statementif ( Expression ) StatementSee also: 13.1.6, 13.2.12, 13.3.2.3, 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, 14.2.13, 15.1.6, 15.2.1.14.
if ( Expression ) Statement else Statementif ( Expression ) Statementif ( Expression ) Statement else Statementif ( Expression ) Statementdo Statement[?Yield, ?Return] while ( Expression[In, ?Yield] ) ;while ( Expression[In, ?Yield] ) Statement[?Yield, ?Return]for ( [lookahead ∉ {let [}] Expression[?Yield]opt ; Expression[In, ?Yield]opt ; Expression[In, ?Yield]opt ) Statement[?Yield, ?Return]for ( var VariableDeclarationList[?Yield] ; Expression[In, ?Yield]opt ; Expression[In, ?Yield]opt ) Statement[?Yield, ?Return]for ( LexicalDeclaration[?Yield] Expression[In, ?Yield]opt ; Expression[In, ?Yield]opt ) Statement[?Yield, ?Return]for ( [lookahead ∉ {let [}] LeftHandSideExpression[?Yield] in Expression[In, ?Yield] ) Statement[?Yield, ?Return]for ( var ForBinding[?Yield] in Expression[In, ?Yield] ) Statement[?Yield, ?Return]for ( ForDeclaration[?Yield] in Expression[In, ?Yield] ) Statement[?Yield, ?Return]for ( [lookahead ≠ let ] LeftHandSideExpression[?Yield] of AssignmentExpression[In, ?Yield] ) Statement[?Yield, ?Return]for ( var ForBinding[?Yield] of AssignmentExpression[In, ?Yield] ) Statement[?Yield, ?Return]for ( ForDeclaration[?Yield] of AssignmentExpression[In, ?Yield] ) Statement[?Yield, ?Return]do Statement while ( Expression ) ;while ( Expression ) Statementfor ( Expressionopt ; Expressionopt ; Expressionopt ) Statementfor ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statementfor ( LexicalDeclaration Expressionopt ; Expressionopt ) Statementfor ( 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 ) StatementNOTE It is only necessary to apply this rule if the extension specified in B.3.2 is implemented.
The abstract operation LoopContinues with arguments completion and labelSet is defined by the following steps:
NOTE Within the Statement part of an IterationStatement a ContinueStatement may be used to begin a new iteration.
do-while StatementWith argument labelSet.
See also: 13.1.1, 13.2.2, 13.6.2, 13.7.3.1, 13.7.4.2, 13.7.5.3, 13.11.2, 13.12.2, 13.13.2, 13.15.2, 15.2.1.2.
do Statement while ( Expression ) ;With argument labelSet.
See also: 13.1.2, 13.2.3, 13.6.3, 13.7.3.2, 13.7.4.3, 13.7.5.4, 13.9.2, 13.11.3, 13.12.3, 13.13.3, 13.15.3, 15.2.1.3.
do Statement while ( Expression ) ;With arguments iterationSet and labelSet.
See also: 13.1.3, 13.2.4, 13.6.4, 13.7.3.3, 13.7.4.4, 13.7.5.5, 13.8.2, 13.11.4, 13.12.4, 13.13.4,13.15.4, 15.2.1.4.
do Statement while ( Expression ) ;See also: 13.1.5, 13.2.11, 13.3.2.2, 13.6.5, 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, 14.2.12, 15.1.5, 15.2.1.13.
do Statement while ( Expression ) ;See also: 13.1.6, 13.2.12, 13.3.2.3, 13.6.6, 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, 14.2.13, 15.1.6, 15.2.1.14.
do Statement while ( Expression ) ;With argument labelSet.
See also: 13.1.7, 13.7.3.6, 13.7.4.7, 13.7.5.11, 13.13.14.
do Statement while ( Expression ) ;while StatementWith argument labelSet.
See also: 13.1.1, 13.2.2, 13.6.2, 13.7.2.1, 13.7.4.2, 13.7.5.3, 13.11.2, 13.12.2, 13.13.2, 13.15.2, 15.2.1.2.
while ( Expression ) StatementWith argument labelSet.
See also: 13.1.2, 13.2.3, 13.6.3, 13.7.2.2, 13.7.4.3, 13.7.5.4, 13.9.2, 13.11.3, 13.12.3, 13.13.3, 13.15.3, 15.2.1.3.
while ( Expression ) StatementWith arguments iterationSet and labelSet.
See also: 13.1.3, 13.2.4, 13.6.4, 13.7.2.3, 13.7.4.4, 13.7.5.5, 13.8.2, 13.11.4, 13.12.4, 13.13.4,13.15.4, 15.2.1.4.
while ( Expression ) StatementSee also: 13.1.5, 13.2.11, 13.3.2.2, 13.6.5, 13.7.2.4, 13.7.4.5, 13.7.5.7, 13.11.5, 13.12.7, 13.13.12, 13.15.5, 14.1.15, 14.2.12, 15.1.5, 15.2.1.13.
while ( Expression ) StatementSee also: 13.1.6, 13.2.12, 13.3.2.3, 13.6.6, 13.7.2.5, 13.7.4.6, 13.7.5.8, 13.11.6, 13.12.8, 13.13.13, 13.15.6, 14.1.16, 14.2.13, 15.1.6, 15.2.1.14.
while ( Expression ) StatementWith argument labelSet.
See also: 13.1.7, 13.7.2.6, 13.7.4.7, 13.7.5.11, 13.13.14.
while ( Expression ) Statementfor Statementfor ( LexicalDeclaration Expressionopt ; Expressionopt ) StatementIt is a Syntax Error if any element of the BoundNames of LexicalDeclaration also occurs in the VarDeclaredNames of Statement.
With argument labelSet.
See also: 13.1.1, 13.2.2, 13.6.2, 13.7.2.1, 13.7.3.1, 13.7.5.3, 13.11.2, 13.12.2, 13.13.2, 13.15.2, 15.2.1.2.
for ( Expressionopt ; Expressionopt ; Expressionopt ) Statementfor ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statementfor ( LexicalDeclaration Expressionopt ; Expressionopt ) StatementWith argument labelSet.
See also: 13.1.2, 13.2.3, 13.6.3, 13.7.2.2, 13.7.3.2, 13.7.5.4, 13.9.2, 13.11.3, 13.12.3, 13.13.3, 13.15.3, 15.2.1.3.
for ( Expressionopt ; Expressionopt ; Expressionopt ) Statementfor ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statementfor ( LexicalDeclaration Expressionopt ; Expressionopt ) StatementWith arguments iterationSet and labelSet.
See also: 13.1.3, 13.2.4, 13.6.4, 13.7.2.3, 13.7.3.3, 13.7.5.5, 13.8.2, 13.11.4, 13.12.4, 13.13.4,13.15.4, 15.2.1.4.
for ( Expressionopt ; Expressionopt ; Expressionopt ) Statementfor ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statementfor ( LexicalDeclaration Expressionopt ; Expressionopt ) StatementSee also: 13.1.5, 13.2.11, 13.3.2.2, 13.6.5, 13.7.2.4, 13.7.3.4, 13.7.5.7, 13.11.5, 13.12.7, 13.13.12, 13.15.5, 14.1.15, 14.2.12, 15.1.5, 15.2.1.13.
for ( Expressionopt ; Expressionopt ; Expressionopt ) Statementfor ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statementfor ( LexicalDeclaration Expressionopt ; Expressionopt ) StatementSee also: 13.1.6, 13.2.12, 13.3.2.3, 13.6.6, 13.7.2.5, 13.7.3.5, 13.7.5.8, 13.11.6, 13.12.8, 13.13.13, 13.15.6, 14.1.16, 14.2.13, 15.1.6, 15.2.1.14.
for ( Expressionopt ; Expressionopt ; Expressionopt ) Statementfor ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statementfor ( LexicalDeclaration Expressionopt ; Expressionopt ) StatementWith argument labelSet.
See also: 13.1.7, 13.7.2.6, 13.7.3.6, 13.7.5.11, 13.13.14.
for ( Expressionopt ; Expressionopt ; Expressionopt ) Statementfor ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statementfor ( LexicalDeclaration Expressionopt ; Expressionopt ) StatementThe abstract operation ForBodyEvaluation with arguments test, increment, stmt, perIterationBindings, and labelSet is performed as follows:
The abstract operation CreatePerIterationEnvironment with argument perIterationBindings is performed as follows:
for-in and
for-of Statementsfor ( LeftHandSideExpression in Expression ) Statementfor ( LeftHandSideExpression of AssignmentExpression ) StatementIt is a Syntax Error if LeftHandSideExpression is either an ObjectLiteral or an ArrayLiteral and if the lexical token sequence matched by LeftHandSideExpression cannot be parsed with no tokens left over using AssignmentPattern as the goal symbol.
If LeftHandSideExpression is either an ObjectLiteral or an ArrayLiteral and if the lexical token sequence matched by LeftHandSideExpression can be parsed with no tokens left over using AssignmentPattern as the goal symbol then the following rules are not applied. Instead, the Early Error rules for AssignmentPattern are used.
It is a Syntax Error if IsValidSimpleAssignmentTarget of LeftHandSideExpression is false.
It is a Syntax Error if the LeftHandSideExpression is CoverParenthesizedExpressionAndArrowParameterList :
( Expression ) and Expression derives a production that would produce a Syntax Error according to these rules if that
production is substituted for LeftHandSideExpression. This rule is recursively applied.
NOTE The last rule means that the other rules are applied even if parentheses surround Expression.
for ( ForDeclaration in Expression ) Statementfor ( ForDeclaration of AssignmentExpression ) StatementIt is a Syntax Error if the BoundNames of ForDeclaration contains "let".
It is a Syntax Error if any element of the BoundNames of ForDeclaration also occurs in the VarDeclaredNames of Statement.
It is a Syntax Error if the BoundNames of ForDeclaration contains any duplicate entries.
See also: 12.1.2, 13.3.1.2, 13.3.2.1, 13.3.3.1, 14.1.3, 14.2.2, 14.4.2, 14.5.2, 15.2.2.2, 15.2.3.2.
With argument labelSet.
See also: 13.1.1, 13.2.2, 13.6.2, 13.7.2.1, 13.7.3.1, 13.7.4.2, 13.11.2, 13.12.2, 13.13.2, 13.15.2, 15.2.1.2.
for ( 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 ) StatementWith argument labelSet.
See also: 13.1.2, 13.2.3, 13.6.3, 13.7.2.2, 13.7.3.2, 13.7.4.3, 13.9.2, 13.11.3, 13.12.3, 13.13.3, 13.15.3, 15.2.1.3.
for ( 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 ) StatementWith arguments iterationSet and labelSet.
See also: 13.1.3, 13.2.4, 13.6.4, 13.7.2.3, 13.7.3.3, 13.7.4.4, 13.8.2, 13.11.4, 13.12.4, 13.13.4,13.15.4, 15.2.1.4.
for ( 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 ) StatementSee also: 12.3.1.3.
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.11.5, 13.12.7, 13.13.12, 13.15.5, 14.1.15, 14.2.12, 15.1.5, 15.2.1.13.
for ( 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 ) StatementSee 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.11.6, 13.12.8, 13.13.13, 13.15.6, 14.1.16, 14.2.13, 15.1.6, 15.2.1.14.
for ( 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 ) StatementWith arguments value and environment.
NOTE undefined is passed for environment to indicate that a PutValue operation should be used to assign the initialization value. This is the case for
var statements and the formal parameter lists of some non-strict functions (see 9.2.12). In those cases a lexical binding is hoisted and
preinitialized prior to evaluation of its initializer.
With argument environment.
With argument labelSet.
See also: 13.1.7, 13.7.2.6, 13.7.3.6, 13.7.4.7, 13.13.14.
for ( 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 ) StatementThe abstract operation ForIn/OfHeadEvaluation is called with arguments TDZnames, expr, and iterationKind. The value of iterationKind is either enumerate or iterate.
The abstract operation ForIn/OfBodyEvaluation is called with arguments lhs, stmt, iterator, lhsKind, and labelSet. The value of lhsKind is either assignment, varBinding or lexicalBinding.
continue Statementcontinue ;continue [no LineTerminator here] LabelIdentifier[?Yield] ;ContinueStatement : continue
;
continue LabelIdentifier ;It is a Syntax Error if this production is not nested, directly or indirectly (but not crossing function boundaries), within an IterationStatement.
With arguments iterationSet and labelSet.
See also: 13.1.3, 13.2.4, 13.6.4, 13.7.2.3, 13.7.3.3, 13.7.4.4, 13.7.5.5, 13.11.4, 13.12.4, 13.13.4,13.15.4, 15.2.1.4.
continue ;continue LabelIdentifier ;continue ;continue LabelIdentifier ;break Statementbreak ;break [no LineTerminator here] LabelIdentifier[?Yield] ;break ;It is a Syntax Error if this production is not nested, directly or indirectly (but not crossing function boundaries), within an IterationStatement or a SwitchStatement.
With argument labelSet.
See also: 13.1.2, 13.2.3, 13.6.3, 13.7.2.2, 13.7.3.2, 13.7.4.3, 13.7.5.4, 13.11.3, 13.12.3, 13.13.3, 13.15.3, 15.2.1.3.
break ;break LabelIdentifier ;break ;break LabelIdentifier ;return Statementreturn ;return [no LineTerminator here] Expression[In, ?Yield] ;NOTE A return statement causes a function to cease execution and return a value to
the caller. If Expression is omitted, the return value is undefined. Otherwise, the return
value is the value of Expression.
return ;return Expression ;with Statementwith ( Expression[In, ?Yield] ) Statement[?Yield, ?Return]NOTE The with statement adds an object Environment Record for a computed object to the lexical environment of the running execution
context. It then executes a statement using this augmented lexical
environment. Finally, it restores the original lexical environment.
with ( Expression ) StatementNOTE It is only necessary to apply the second rule if the extension specified in B.3.2 is implemented.
With argument labelSet.
See also: 13.1.1, 13.2.2, 13.6.2, 13.7.2.1, 13.7.3.1, 13.7.4.2, 13.7.5.3, 13.12.2, 13.13.2, 13.15.2, 15.2.1.2.
with ( Expression ) StatementWith argument labelSet.
See also: 13.1.2, 13.2.3, 13.6.3, 13.7.2.2, 13.7.3.2, 13.7.4.3, 13.7.5.4, 13.9.2, 13.12.3, 13.13.3, 13.15.3, 15.2.1.3.
with ( Expression ) StatementWith arguments iterationSet and labelSet.
See also: 13.1.3, 13.2.4, 13.6.4, 13.7.2.3, 13.7.3.3, 13.7.4.4, 13.7.5.5, 13.8.2, 13.12.4, 13.13.4,13.15.4, 15.2.1.4.
with ( Expression ) StatementSee 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.12.7, 13.13.12, 13.15.5, 14.1.15, 14.2.12, 15.1.5, 15.2.1.13.
with ( Expression ) StatementSee 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.12.8, 13.13.13, 13.15.6, 14.1.16, 14.2.13, 15.1.6, 15.2.1.14.
with ( Expression ) Statementwith ( Expression ) StatementNOTE No matter how control leaves the embedded Statement, whether normally or by some form of abrupt completion or exception, the LexicalEnvironment is always restored to its former state.
switch Statementswitch ( Expression[In, ?Yield] ) CaseBlock[?Yield, ?Return]{ CaseClauses[?Yield, ?Return]opt }{ CaseClauses[?Yield, ?Return]opt DefaultClause[?Yield, ?Return] CaseClauses[?Yield, ?Return]opt }case Expression[In, ?Yield] : StatementList[?Yield, ?Return]optdefault : StatementList[?Yield, ?Return]opt{ CaseClauses }It is a Syntax Error if the LexicallyDeclaredNames of CaseClauses contains any duplicate entries.
It is a Syntax Error if any element of the LexicallyDeclaredNames of CaseClauses also occurs in the VarDeclaredNames of CaseClauses.
With argument labelSet.
See also: 13.1.1, 13.2.2, 13.6.2, 13.7.2.1, 13.7.3.1, 13.7.4.2, 13.7.5.3, 13.11.2, 13.13.2, 13.15.2, 15.2.1.2.
switch ( Expression ) CaseBlock{ }{ CaseClausesopt DefaultClause CaseClausesopt }case Expression : StatementListoptdefault : StatementListoptWith argument labelSet.
See also: 13.1.2, 13.2.3, 13.6.3, 13.7.2.2, 13.7.3.2, 13.7.4.3, 13.7.5.4, 13.9.2, 13.11.3, 13.13.3, 13.15.3, 15.2.1.3.
switch ( Expression ) CaseBlock{ }{ CaseClausesopt DefaultClause CaseClausesopt }case Expression : StatementListoptdefault : StatementListoptWith arguments iterationSet and labelSet.
See also: 13.1.3, 13.2.4, 13.6.4, 13.7.2.3, 13.7.3.3, 13.7.4.4, 13.7.5.5, 13.8.2, 13.11.4, 13.13.4,13.15.4, 15.2.1.4.
switch ( Expression ) CaseBlock{ }{ CaseClausesopt DefaultClause CaseClausesopt }case Expression : StatementListoptdefault : StatementListoptSee also: 13.2.5, 13.13.6, 14.1.13, 14.2.10, 15.1.3, 15.2.1.11.
{ }{ CaseClausesopt DefaultClause CaseClausesopt }case Expression : StatementListoptdefault : StatementListoptSee also: 13.2.6, 13.13.7, 14.1.14, 14.2.11, 15.1.4, 15.2.1.12, 15.2.3.8.
{ }{ CaseClausesopt DefaultClause CaseClausesopt }case Expression : StatementListoptdefault : StatementListoptSee 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.13.12, 13.15.5, 14.1.15, 14.2.12, 15.1.5, 15.2.1.13.
switch ( Expression ) CaseBlock{ }{ CaseClausesopt DefaultClause CaseClausesopt }case Expression : StatementListoptdefault : StatementListoptSee 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.13.13, 13.15.6, 14.1.16, 14.2.13, 15.1.6, 15.2.1.14.
switch ( Expression ) CaseBlock{ }{ CaseClausesopt DefaultClause CaseClausesopt }case Expression : StatementListoptdefault : StatementListoptWith argument input.
{ }{ CaseClauses }{ CaseClausesopt DefaultClause CaseClausesopt }case Expression : StatementListoptNOTE CaseSelectorEvaluation does not execute the associated StatementList. It simply evaluates the Expression and returns the value, which the CaseBlock algorithm uses to determine which StatementList to start executing.
switch ( Expression ) CaseBlockNOTE No matter how control leaves the SwitchStatement the LexicalEnvironment is always restored to its former state.
case Expression :case Expression : StatementListdefault :default : StatementList: LabelledItem[?Yield, ?Return]NOTE A Statement may be prefixed by a label. Labelled statements are
only used in conjunction with labelled break and continue statements. ECMAScript has no
goto statement. A Statement can be part of a LabelledStatement, which itself can be part of a LabelledStatement, and so on.
The labels introduced this way are collectively referred to as the “current label set” when describing the
semantics of individual statements. A LabelledStatement has no semantic meaning other than the
introduction of a label to a label set.
NOTE An alternative definition for this rule is provided in B.3.2.
With argument labelSet.
See also: 13.1.1, 13.2.2, 13.6.2, 13.7.2.1, 13.7.3.1, 13.7.4.2, 13.7.5.3, 13.11.2, 13.12.2, 13.15.2, 15.2.1.2.
: LabelledItemWith argument labelSet.
See also: 13.1.2, 13.2.3, 13.6.3, 13.7.2.2, 13.7.3.2, 13.7.4.3, 13.7.5.4, 13.9.2, 13.11.3, 13.12.3, 13.15.3, 15.2.1.3.
: LabelledItemWith arguments iterationSet and labelSet.
See also: 13.1.3, 13.2.4, 13.6.4, 13.7.2.3, 13.7.3.3, 13.7.4.4, 13.7.5.5, 13.8.2, 13.11.4, 13.12.4, 13.15.4, 15.2.1.4.
: LabelledItemThe abstract operation IsLabelledFunction with argument stmt performs the following steps:
See also: 13.2.5, 13.12.5, 14.1.13, 14.2.10, 15.1.3, 15.2.1.11.
: LabelledItemSee also: 13.2.6, 13.12.6, 14.1.14, 14.2.11, 15.1.4, 15.2.1.12, 15.2.3.8.
: LabelledItemSee also: 13.2.7.
: LabelledItemSee also: 13.2.8.
: LabelledItemSee also: 13.2.9.
: LabelledItemSee also: 13.2.10.
: LabelledItemSee 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.15.5, 14.1.15, 14.2.12, 15.1.5, 15.2.1.13.
: LabelledItemSee 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.15.6, 14.1.16, 14.2.13, 15.1.6, 15.2.1.14.
: LabelledItemWith argument labelSet.
See also: 13.1.7, 13.7.2.6, 13.7.3.6, 13.7.4.7, 13.7.5.11.
: LabelledItemLabelledItem : FunctionDeclaration
: LabelledItemthrow Statementthrow [no LineTerminator here] Expression[In, ?Yield] ;throw Expression ;try Statementtry Block[?Yield, ?Return] Catch[?Yield, ?Return]try Block[?Yield, ?Return] Finally[?Yield, ?Return]try Block[?Yield, ?Return] Catch[?Yield, ?Return] Finally[?Yield, ?Return]catch ( CatchParameter[?Yield] ) Block[?Yield, ?Return]finally Block[?Yield, ?Return]NOTE The try statement encloses a block of code in which an exceptional condition
can occur, such as a runtime error or a throw statement. The catch clause provides the
exception-handling code. When a catch clause catches an exception, its CatchParameter is bound to
that exception.
catch ( CatchParameter ) BlockIt is a Syntax Error if BoundNames of CatchParameter contains any duplicate elements.
It is a Syntax Error if any element of the BoundNames of CatchParameter also occurs in the LexicallyDeclaredNames of Block.
It is a Syntax Error if any element of the BoundNames of CatchParameter also occurs in the VarDeclaredNames of Block.
NOTE An alternative static semantics for this production is given in B.3.5.
With argument labelSet.
See also: 13.1.1, 13.2.2, 13.6.2, 13.7.2.1, 13.7.3.1, 13.7.4.2, 13.7.5.3, 13.11.2, 13.12.2, 13.13.2, 15.2.1.2.
try Block Catchtry Block Finallytry Block Catch Finallycatch ( CatchParameter ) BlockWith argument labelSet.
See also: 13.1.2, 13.2.3, 13.6.3, 13.7.2.2, 13.7.3.2, 13.7.4.3, 13.7.5.4, 13.9.2, 13.11.3, 13.12.3, 13.13.3, 15.2.1.3.
try Block Catchtry Block Finallytry Block Catch Finallycatch ( CatchParameter ) BlockWith arguments iterationSet and labelSet.
See also: 13.1.3, 13.2.4, 13.6.4, 13.7.2.3, 13.7.3.3, 13.7.4.4, 13.7.5.5, 13.8.2, 13.11.4, 13.12.4, 13.13.4, 15.2.1.4.
try Block Catchtry Block Finallytry Block Catch Finallycatch ( CatchParameter ) BlockSee 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, 14.1.15, 14.2.12, 15.1.5, 15.2.1.13.
try Block Catchtry Block Finallytry Block Catch Finallycatch ( CatchParameter ) BlockSee 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, 14.1.16, 14.2.13, 15.1.6, 15.2.1.14.
try Block Catchtry Block Finallytry Block Catch Finallycatch ( CatchParameter ) Blockwith parameter thrownValue
catch ( CatchParameter ) BlockNOTE No matter how control leaves the Block the LexicalEnvironment is always restored to its former state.
try Block Catchtry Block Finallytry Block Catch FinallyNOTE Evaluating the DebuggerStatement production may allow an implementation to cause a breakpoint when run under a debugger. If a debugger is not present or active this statement has no observable effect.
debugger ;