8 構文指向操作 (Syntax-Directed Operations)

本節で定義されるものに加えて、特化した構文指向操作が本仕様全体で定義されている。

8.1 実行時意味論: Evaluation : Completion Record

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS.

Note
この操作の定義は本仕様の「ECMAScript Language」各節に分散している。各定義は関連する生成規則 (production) が定義出現する直後に現れる。

8.2 スコープ解析 (Scope Analysis)

8.2.1 静的意味論: BoundNames : 文字列の List

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS.

Note

"*default*" は、モジュールの default export に別名が存在しない場合に、そのモジュールの default export を表すための合成(synthetic)名として本仕様内で用いられる。この名前でモジュールの [[Environment]] にエントリが作成され対応する値を保持し、当該モジュールについて ResolveExport ( exportName [ , resolveSet ] ) を呼び "default" という export を解決すると、[[BindingName]]"*default*"ResolvedBinding Record を返し、それがモジュールの [[Environment]] 内で前述の値へ解決される。これは仕様記述の簡便さのみを目的としており、無名の default export を他の export と同様に解決できるようにするためである。この "*default*" 文字列が ECMAScript コードやモジュールリンクアルゴリズムからアクセスされることは決してない。

It is defined piecewise over the following productions:

BindingIdentifier : Identifier
  1. Identifier の StringValue を唯一の要素とする List を返す。
BindingIdentifier : yield
  1. « "yield" » を返す。
BindingIdentifier : await
  1. « "await" » を返す。
LexicalDeclaration : LetOrConst BindingList ;
  1. BindingList の BoundNames を返す。
BindingList : BindingList , LexicalBinding
  1. names1BindingList の BoundNames とする。
  2. names2LexicalBinding の BoundNames とする。
  3. names1names2リスト結合を返す。
LexicalBinding : BindingIdentifier Initializeropt
  1. BindingIdentifier の BoundNames を返す。
LexicalBinding : BindingPattern Initializer
  1. BindingPattern の BoundNames を返す。
VariableDeclarationList : VariableDeclarationList , VariableDeclaration
  1. names1VariableDeclarationList の BoundNames とする。
  2. names2VariableDeclaration の BoundNames とする。
  3. names1names2リスト結合を返す。
VariableDeclaration : BindingIdentifier Initializeropt
  1. BindingIdentifier の BoundNames を返す。
VariableDeclaration : BindingPattern Initializer
  1. BindingPattern の BoundNames を返す。
ObjectBindingPattern : { }
  1. 新しい空の List を返す。
ObjectBindingPattern : { BindingPropertyList , BindingRestProperty }
  1. names1BindingPropertyList の BoundNames とする。
  2. names2BindingRestProperty の BoundNames とする。
  3. names1names2リスト結合を返す。
ArrayBindingPattern : [ Elisionopt ]
  1. 新しい空の List を返す。
ArrayBindingPattern : [ Elisionopt BindingRestElement ]
  1. BindingRestElement の BoundNames を返す。
ArrayBindingPattern : [ BindingElementList , Elisionopt ]
  1. BindingElementList の BoundNames を返す。
ArrayBindingPattern : [ BindingElementList , Elisionopt BindingRestElement ]
  1. names1BindingElementList の BoundNames とする。
  2. names2BindingRestElement の BoundNames とする。
  3. names1names2リスト結合を返す。
BindingPropertyList : BindingPropertyList , BindingProperty
  1. names1BindingPropertyList の BoundNames とする。
  2. names2BindingProperty の BoundNames とする。
  3. names1names2リスト結合を返す。
BindingElementList : BindingElementList , BindingElisionElement
  1. names1BindingElementList の BoundNames とする。
  2. names2BindingElisionElement の BoundNames とする。
  3. names1names2リスト結合を返す。
BindingElisionElement : Elisionopt BindingElement
  1. BindingElement の BoundNames を返す。
BindingProperty : PropertyName : BindingElement
  1. BindingElement の BoundNames を返す。
SingleNameBinding : BindingIdentifier Initializeropt
  1. BindingIdentifier の BoundNames を返す。
BindingElement : BindingPattern Initializeropt
  1. BindingPattern の BoundNames を返す。
ForDeclaration : LetOrConst ForBinding
  1. ForBinding の BoundNames を返す。
FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
  1. BindingIdentifier の BoundNames を返す。
FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
  1. « "*default*" » を返す。
FormalParameters : [empty]
  1. 新しい空の List を返す。
FormalParameters : FormalParameterList , FunctionRestParameter
  1. names1FormalParameterList の BoundNames とする。
  2. names2FunctionRestParameter の BoundNames とする。
  3. names1names2リスト結合を返す。
FormalParameterList : FormalParameterList , FormalParameter
  1. names1FormalParameterList の BoundNames とする。
  2. names2FormalParameter の BoundNames とする。
  3. names1names2リスト結合を返す。
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
  1. formalsCoverParenthesizedExpressionAndArrowParameterList が被覆する ArrowFormalParameters とする。
  2. formals の BoundNames を返す。
GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
  1. BindingIdentifier の BoundNames を返す。
GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
  1. « "*default*" » を返す。
AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
  1. BindingIdentifier の BoundNames を返す。
AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
  1. « "*default*" » を返す。
ClassDeclaration : class BindingIdentifier ClassTail
  1. BindingIdentifier の BoundNames を返す。
ClassDeclaration : class ClassTail
  1. « "*default*" » を返す。
AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
  1. BindingIdentifier の BoundNames を返す。
AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
  1. « "*default*" » を返す。
CoverCallExpressionAndAsyncArrowHead : MemberExpression Arguments
  1. headCoverCallExpressionAndAsyncArrowHead が被覆する AsyncArrowHead とする。
  2. head の BoundNames を返す。
ImportDeclaration : import ImportClause FromClause WithClauseopt ;
  1. ImportClause の BoundNames を返す。
ImportDeclaration : import ModuleSpecifier WithClauseopt ;
  1. 新しい空の List を返す。
ImportClause : ImportedDefaultBinding , NameSpaceImport
  1. names1ImportedDefaultBinding の BoundNames とする。
  2. names2NameSpaceImport の BoundNames とする。
  3. names1names2リスト結合を返す。
ImportClause : ImportedDefaultBinding , NamedImports
  1. names1ImportedDefaultBinding の BoundNames とする。
  2. names2NamedImports の BoundNames とする。
  3. names1names2リスト結合を返す。
NamedImports : { }
  1. 新しい空の List を返す。
ImportsList : ImportsList , ImportSpecifier
  1. names1ImportsList の BoundNames とする。
  2. names2ImportSpecifier の BoundNames とする。
  3. names1names2リスト結合を返す。
ImportSpecifier : ModuleExportName as ImportedBinding
  1. ImportedBinding の BoundNames を返す。
ExportDeclaration : export ExportFromClause FromClause WithClauseopt ; export NamedExports ;
  1. 新しい空の List を返す。
ExportDeclaration : export VariableStatement
  1. VariableStatement の BoundNames を返す。
ExportDeclaration : export Declaration
  1. Declaration の BoundNames を返す。
ExportDeclaration : export default HoistableDeclaration
  1. declarationNamesHoistableDeclaration の BoundNames とする。
  2. declarationNames"*default*" が含まれないなら "*default*"declarationNames に追加する。
  3. declarationNames を返す。
ExportDeclaration : export default ClassDeclaration
  1. declarationNamesClassDeclaration の BoundNames とする。
  2. declarationNames"*default*" が含まれないなら "*default*"declarationNames に追加する。
  3. declarationNames を返す。
ExportDeclaration : export default AssignmentExpression ;
  1. « "*default*" » を返す。

8.2.2 静的意味論: DeclarationPart : Parse Node

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

HoistableDeclaration : FunctionDeclaration
  1. FunctionDeclaration を返す。
HoistableDeclaration : GeneratorDeclaration
  1. GeneratorDeclaration を返す。
HoistableDeclaration : AsyncFunctionDeclaration
  1. AsyncFunctionDeclaration を返す。
HoistableDeclaration : AsyncGeneratorDeclaration
  1. AsyncGeneratorDeclaration を返す。
Declaration : ClassDeclaration
  1. ClassDeclaration を返す。
Declaration : LexicalDeclaration
  1. LexicalDeclaration を返す。

8.2.3 静的意味論: IsConstantDeclaration : Boolean

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

LexicalDeclaration : LetOrConst BindingList ;
  1. LetOrConst の IsConstantDeclaration を返す。
LetOrConst : let
  1. false を返す。
LetOrConst : const
  1. true を返す。
FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody } function ( FormalParameters ) { FunctionBody } GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } function * ( FormalParameters ) { GeneratorBody } AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } async function * ( FormalParameters ) { AsyncGeneratorBody } AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } async function ( FormalParameters ) { AsyncFunctionBody }
  1. false を返す。
ClassDeclaration : class BindingIdentifier ClassTail class ClassTail
  1. false を返す。
ExportDeclaration : export ExportFromClause FromClause ; export NamedExports ; export default AssignmentExpression ;
  1. false を返す。
Note

export default AssignmentExpression を定数宣言として扱う必要はない。モジュールの default オブジェクトを参照する内部束縛名に代入できる構文は存在しないためである。

8.2.4 静的意味論: LexicallyDeclaredNames : 文字列の List

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

Block : { }
  1. 新しい空の List を返す。
StatementList : StatementList StatementListItem
  1. names1StatementList の LexicallyDeclaredNames とする。
  2. names2StatementListItem の LexicallyDeclaredNames とする。
  3. names1names2リスト結合を返す。
StatementListItem : Statement
  1. Statement Statement : LabelledStatement であれば、LabelledStatement の LexicallyDeclaredNames を返す。
  2. 新しい空の List を返す。
StatementListItem : Declaration
  1. Declaration の BoundNames を返す。
CaseBlock : { }
  1. 新しい空の List を返す。
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 最初の CaseClauses が存在するなら names1 をその LexicallyDeclaredNames、存在しないなら新しい空の List とする。
  2. names2DefaultClause の LexicallyDeclaredNames とする。
  3. 2番目の CaseClauses が存在するなら names3 をその LexicallyDeclaredNames、存在しないなら新しい空の List とする。
  4. names1, names2, names3リスト結合を返す。
CaseClauses : CaseClauses CaseClause
  1. names1CaseClauses の LexicallyDeclaredNames とする。
  2. names2CaseClause の LexicallyDeclaredNames とする。
  3. names1names2リスト結合を返す。
CaseClause : case Expression : StatementListopt
  1. StatementList が存在するならその LexicallyDeclaredNames を返す。
  2. 新しい空の List を返す。
DefaultClause : default : StatementListopt
  1. StatementList が存在するならその LexicallyDeclaredNames を返す。
  2. 新しい空の List を返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItem の LexicallyDeclaredNames を返す。
LabelledItem : Statement
  1. 新しい空の List を返す。
LabelledItem : FunctionDeclaration
  1. FunctionDeclaration の BoundNames を返す。
FunctionStatementList : [empty]
  1. 新しい空の List を返す。
FunctionStatementList : StatementList
  1. StatementList の TopLevelLexicallyDeclaredNames を返す。
ClassStaticBlockStatementList : [empty]
  1. 新しい空の List を返す。
ClassStaticBlockStatementList : StatementList
  1. StatementList の TopLevelLexicallyDeclaredNames を返す。
ConciseBody : ExpressionBody
  1. 新しい空の List を返す。
AsyncConciseBody : ExpressionBody
  1. 新しい空の List を返す。
Script : [empty]
  1. 新しい空の List を返す。
ScriptBody : StatementList
  1. StatementList の TopLevelLexicallyDeclaredNames を返す。
Note 1

Script の最上位では function 宣言は lexical 宣言ではなく var 宣言として扱われる。

Note 2

Module の LexicallyDeclaredNames にはその全ての import された束縛の名前が含まれる。

ModuleItemList : ModuleItemList ModuleItem
  1. names1ModuleItemList の LexicallyDeclaredNames とする。
  2. names2ModuleItem の LexicallyDeclaredNames とする。
  3. names1names2リスト結合を返す。
ModuleItem : ImportDeclaration
  1. ImportDeclaration の BoundNames を返す。
ModuleItem : ExportDeclaration
  1. ExportDeclarationexport VariableStatement であれば新しい空の List を返す。
  2. ExportDeclaration の BoundNames を返す。
ModuleItem : StatementListItem
  1. StatementListItem の LexicallyDeclaredNames を返す。
Note 3

Module の最上位では function 宣言は var 宣言ではなく lexical 宣言として扱われる。

8.2.5 静的意味論: LexicallyScopedDeclarations : Parse Node の List

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

StatementList : StatementList StatementListItem
  1. declarations1StatementList の LexicallyScopedDeclarations とする。
  2. declarations2StatementListItem の LexicallyScopedDeclarations とする。
  3. declarations1declarations2リスト結合を返す。
StatementListItem : Statement
  1. Statement Statement : LabelledStatement なら LabelledStatement の LexicallyScopedDeclarations を返す。
  2. 新しい空の List を返す。
StatementListItem : Declaration
  1. Declaration の DeclarationPart を唯一の要素とする List を返す。
CaseBlock : { }
  1. 新しい空の List を返す。
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 最初の CaseClauses が存在するなら declarations1 をその LexicallyScopedDeclarations、存在しないなら新しい空の List とする。
  2. declarations2DefaultClause の LexicallyScopedDeclarations とする。
  3. 2番目の CaseClauses が存在するなら declarations3 をその LexicallyScopedDeclarations、存在しないなら新しい空の List とする。
  4. declarations1, declarations2, declarations3リスト結合を返す。
CaseClauses : CaseClauses CaseClause
  1. declarations1CaseClauses の LexicallyScopedDeclarations とする。
  2. declarations2CaseClause の LexicallyScopedDeclarations とする。
  3. declarations1declarations2リスト結合を返す。
CaseClause : case Expression : StatementListopt
  1. StatementList が存在するならその LexicallyScopedDeclarations を返す。
  2. 新しい空の List を返す。
DefaultClause : default : StatementListopt
  1. StatementList が存在するならその LexicallyScopedDeclarations を返す。
  2. 新しい空の List を返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItem の LexicallyScopedDeclarations を返す。
LabelledItem : Statement
  1. 新しい空の List を返す。
LabelledItem : FunctionDeclaration
  1. « FunctionDeclaration » を返す。
FunctionStatementList : [empty]
  1. 新しい空の List を返す。
FunctionStatementList : StatementList
  1. StatementList の TopLevelLexicallyScopedDeclarations を返す。
ClassStaticBlockStatementList : [empty]
  1. 新しい空の List を返す。
ClassStaticBlockStatementList : StatementList
  1. StatementList の TopLevelLexicallyScopedDeclarations を返す。
ConciseBody : ExpressionBody
  1. 新しい空の List を返す。
AsyncConciseBody : ExpressionBody
  1. 新しい空の List を返す。
Script : [empty]
  1. 新しい空の List を返す。
ScriptBody : StatementList
  1. StatementList の TopLevelLexicallyScopedDeclarations を返す。
Module : [empty]
  1. 新しい空の List を返す。
ModuleItemList : ModuleItemList ModuleItem
  1. declarations1ModuleItemList の LexicallyScopedDeclarations とする。
  2. declarations2ModuleItem の LexicallyScopedDeclarations とする。
  3. declarations1declarations2リスト結合を返す。
ModuleItem : ImportDeclaration
  1. 新しい空の List を返す。
ExportDeclaration : export ExportFromClause FromClause WithClauseopt ; export NamedExports ; export VariableStatement
  1. 新しい空の List を返す。
ExportDeclaration : export Declaration
  1. DeclarationPart が Declaration である要素のみを持つ List を返す。
ExportDeclaration : export default HoistableDeclaration
  1. DeclarationPart が HoistableDeclaration である唯一の要素を持つ List を返す。
ExportDeclaration : export default ClassDeclaration
  1. 唯一の要素が ClassDeclaration である List を返す。
ExportDeclaration : export default AssignmentExpression ;
  1. 唯一の要素がこの ExportDeclaration である List を返す。

8.2.6 静的意味論: VarDeclaredNames : 文字列の List

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

Statement : EmptyStatement ExpressionStatement ContinueStatement BreakStatement ReturnStatement ThrowStatement DebuggerStatement
  1. 新しい空の List を返す。
Block : { }
  1. 新しい空の List を返す。
StatementList : StatementList StatementListItem
  1. names1StatementList の VarDeclaredNames とする。
  2. names2StatementListItem の VarDeclaredNames とする。
  3. names1names2リスト結合を返す。
StatementListItem : Declaration
  1. 新しい空の List を返す。
VariableStatement : var VariableDeclarationList ;
  1. VariableDeclarationList の BoundNames を返す。
IfStatement : if ( Expression ) Statement else Statement
  1. names1 を最初の Statement の VarDeclaredNames とする。
  2. names2 を2番目の Statement の VarDeclaredNames とする。
  3. names1names2リスト結合を返す。
IfStatement : if ( Expression ) Statement
  1. Statement の VarDeclaredNames を返す。
DoWhileStatement : do Statement while ( Expression ) ;
  1. Statement の VarDeclaredNames を返す。
WhileStatement : while ( Expression ) Statement
  1. Statement の VarDeclaredNames を返す。
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement
  1. Statement の VarDeclaredNames を返す。
ForStatement : for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement
  1. names1VariableDeclarationList の BoundNames とする。
  2. names2Statement の VarDeclaredNames とする。
  3. names1names2リスト結合を返す。
ForStatement : for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. Statement の VarDeclaredNames を返す。
ForInOfStatement : for ( LeftHandSideExpression in Expression ) Statement for ( ForDeclaration in Expression ) Statement for ( LeftHandSideExpression of AssignmentExpression ) Statement for ( ForDeclaration of AssignmentExpression ) Statement for await ( LeftHandSideExpression of AssignmentExpression ) Statement for await ( ForDeclaration of AssignmentExpression ) Statement
  1. Statement の VarDeclaredNames を返す。
ForInOfStatement : for ( var ForBinding in Expression ) Statement for ( var ForBinding of AssignmentExpression ) Statement for await ( var ForBinding of AssignmentExpression ) Statement
  1. names1 を « ForBinding » とする。
  2. names2Statement の VarDeclaredNames とする。
  3. names1names2リスト結合を返す。
Note

本節は付録 B.3.5 により拡張される。

WithStatement : with ( Expression ) Statement
  1. Statement の VarDeclaredNames を返す。
SwitchStatement : switch ( Expression ) CaseBlock
  1. CaseBlock の VarDeclaredNames を返す。
CaseBlock : { }
  1. 新しい空の List を返す。
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 最初の CaseClauses が存在するなら names1 をその VarDeclaredNames、存在しないなら新しい空の List とする。
  2. names2DefaultClause の VarDeclaredNames とする。
  3. 2番目の CaseClauses が存在するなら names3 をその VarDeclaredNames、存在しないなら新しい空の List とする。
  4. names1, names2, names3リスト結合を返す。
CaseClauses : CaseClauses CaseClause
  1. names1CaseClauses の VarDeclaredNames とする。
  2. names2CaseClause の VarDeclaredNames とする。
  3. names1names2リスト結合を返す。
CaseClause : case Expression : StatementListopt
  1. StatementList が存在するならその VarDeclaredNames を返す。
  2. 新しい空の List を返す。
DefaultClause : default : StatementListopt
  1. StatementList が存在するならその VarDeclaredNames を返す。
  2. 新しい空の List を返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItem の VarDeclaredNames を返す。
LabelledItem : FunctionDeclaration
  1. 新しい空の List を返す。
TryStatement : try Block Catch
  1. names1Block の VarDeclaredNames とする。
  2. names2Catch の VarDeclaredNames とする。
  3. names1names2リスト結合を返す。
TryStatement : try Block Finally
  1. names1Block の VarDeclaredNames とする。
  2. names2Finally の VarDeclaredNames とする。
  3. names1names2リスト結合を返す。
TryStatement : try Block Catch Finally
  1. names1Block の VarDeclaredNames とする。
  2. names2Catch の VarDeclaredNames とする。
  3. names3Finally の VarDeclaredNames とする。
  4. names1, names2, names3リスト結合を返す。
Catch : catch ( CatchParameter ) Block
  1. Block の VarDeclaredNames を返す。
FunctionStatementList : [empty]
  1. 新しい空の List を返す。
FunctionStatementList : StatementList
  1. StatementList の TopLevelVarDeclaredNames を返す。
ClassStaticBlockStatementList : [empty]
  1. 新しい空の List を返す。
ClassStaticBlockStatementList : StatementList
  1. StatementList の TopLevelVarDeclaredNames を返す。
ConciseBody : ExpressionBody
  1. 新しい空の List を返す。
AsyncConciseBody : ExpressionBody
  1. 新しい空の List を返す。
Script : [empty]
  1. 新しい空の List を返す。
ScriptBody : StatementList
  1. StatementList の TopLevelVarDeclaredNames を返す。
ModuleItemList : ModuleItemList ModuleItem
  1. names1ModuleItemList の VarDeclaredNames とする。
  2. names2ModuleItem の VarDeclaredNames とする。
  3. names1names2リスト結合を返す。
ModuleItem : ImportDeclaration
  1. 新しい空の List を返す。
ModuleItem : ExportDeclaration
  1. ExportDeclarationexport VariableStatement であれば ExportDeclaration の BoundNames を返す。
  2. 新しい空の List を返す。

8.2.7 静的意味論: VarScopedDeclarations : Parse Node の List

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

Statement : EmptyStatement ExpressionStatement ContinueStatement BreakStatement ReturnStatement ThrowStatement DebuggerStatement
  1. 新しい空の List を返す。
Block : { }
  1. 新しい空の List を返す。
StatementList : StatementList StatementListItem
  1. declarations1StatementList の VarScopedDeclarations とする。
  2. declarations2StatementListItem の VarScopedDeclarations とする。
  3. declarations1declarations2リスト結合を返す。
StatementListItem : Declaration
  1. 新しい空の List を返す。
VariableDeclarationList : VariableDeclaration
  1. « VariableDeclaration » を返す。
VariableDeclarationList : VariableDeclarationList , VariableDeclaration
  1. declarations1VariableDeclarationList の VarScopedDeclarations とする。
  2. declarations1 と « VariableDeclaration » のリスト結合を返す。
IfStatement : if ( Expression ) Statement else Statement
  1. declarations1 を最初の Statement の VarScopedDeclarations とする。
  2. declarations2 を2番目の Statement の VarScopedDeclarations とする。
  3. declarations1declarations2リスト結合を返す。
IfStatement : if ( Expression ) Statement
  1. Statement の VarScopedDeclarations を返す。
DoWhileStatement : do Statement while ( Expression ) ;
  1. Statement の VarScopedDeclarations を返す。
WhileStatement : while ( Expression ) Statement
  1. Statement の VarScopedDeclarations を返す。
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement
  1. Statement の VarScopedDeclarations を返す。
ForStatement : for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement
  1. declarations1VariableDeclarationList の VarScopedDeclarations とする。
  2. declarations2Statement の VarScopedDeclarations とする。
  3. declarations1declarations2リスト結合を返す。
ForStatement : for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. Statement の VarScopedDeclarations を返す。
ForInOfStatement : for ( LeftHandSideExpression in Expression ) Statement for ( ForDeclaration in Expression ) Statement for ( LeftHandSideExpression of AssignmentExpression ) Statement for ( ForDeclaration of AssignmentExpression ) Statement for await ( LeftHandSideExpression of AssignmentExpression ) Statement for await ( ForDeclaration of AssignmentExpression ) Statement
  1. Statement の VarScopedDeclarations を返す。
ForInOfStatement : for ( var ForBinding in Expression ) Statement for ( var ForBinding of AssignmentExpression ) Statement for await ( var ForBinding of AssignmentExpression ) Statement
  1. declarations1 を « ForBinding » とする。
  2. declarations2Statement の VarScopedDeclarations とする。
  3. declarations1declarations2リスト結合を返す。
Note

本節は付録 B.3.5 により拡張される。

WithStatement : with ( Expression ) Statement
  1. Statement の VarScopedDeclarations を返す。
SwitchStatement : switch ( Expression ) CaseBlock
  1. CaseBlock の VarScopedDeclarations を返す。
CaseBlock : { }
  1. 新しい空の List を返す。
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 最初の CaseClauses が存在するなら declarations1 をその VarScopedDeclarations、存在しないなら新しい空の List とする。
  2. declarations2DefaultClause の VarScopedDeclarations とする。
  3. 2番目の CaseClauses が存在するなら declarations3 をその VarScopedDeclarations、存在しないなら新しい空の List とする。
  4. declarations1, declarations2, declarations3リスト結合を返す。
CaseClauses : CaseClauses CaseClause
  1. declarations1CaseClauses の VarScopedDeclarations とする。
  2. declarations2CaseClause の VarScopedDeclarations とする。
  3. declarations1declarations2リスト結合を返す。
CaseClause : case Expression : StatementListopt
  1. StatementList が存在するならその VarScopedDeclarations を返す。
  2. 新しい空の List を返す。
DefaultClause : default : StatementListopt
  1. StatementList が存在するならその VarScopedDeclarations を返す。
  2. 新しい空の List を返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItem の VarScopedDeclarations を返す。
LabelledItem : Statement
  1. Statement Statement : LabelledStatement なら Statement の VarScopedDeclarations を返す。
  2. Statement の VarScopedDeclarations を返す。
LabelledItem : FunctionDeclaration
  1. « FunctionDeclaration » を返す。
FunctionStatementList : [empty]
  1. 新しい空の List を返す。
FunctionStatementList : StatementList
  1. StatementList の TopLevelVarScopedDeclarations を返す。
ClassStaticBlockStatementList : [empty]
  1. 新しい空の List を返す。
ClassStaticBlockStatementList : StatementList
  1. StatementList の TopLevelVarScopedDeclarations を返す。
ConciseBody : ExpressionBody
  1. 新しい空の List を返す。
AsyncConciseBody : ExpressionBody
  1. 新しい空の List を返す。
Script : [empty]
  1. 新しい空の List を返す。
ScriptBody : StatementList
  1. StatementList の TopLevelVarScopedDeclarations を返す。
Module : [empty]
  1. 新しい空の List を返す。
ModuleItemList : ModuleItemList ModuleItem
  1. declarations1ModuleItemList の VarScopedDeclarations とする。
  2. declarations2ModuleItem の VarScopedDeclarations とする。
  3. declarations1declarations2リスト結合を返す。
ModuleItem : ImportDeclaration
  1. 新しい空の List を返す。
ModuleItem : ExportDeclaration
  1. ExportDeclarationexport VariableStatement であれば VariableStatement の VarScopedDeclarations を返す。
  2. 新しい空の List を返す。

8.2.8 静的意味論: TopLevelLexicallyDeclaredNames : 文字列の List

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

StatementList : StatementList StatementListItem
  1. names1StatementList の TopLevelLexicallyDeclaredNames とする。
  2. names2StatementListItem の TopLevelLexicallyDeclaredNames とする。
  3. names1names2リスト結合を返す。
StatementListItem : Statement
  1. 新しい空の List を返す。
StatementListItem : Declaration
  1. Declaration Declaration : HoistableDeclaration であれば
    1. 新しい空の List を返す。
  2. Declaration の BoundNames を返す。
Note

関数またはスクリプトの最上位では function 宣言は lexical 宣言ではなく var 宣言として扱われる。

8.2.9 静的意味論: TopLevelLexicallyScopedDeclarations : Parse Node の List

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

StatementList : StatementList StatementListItem
  1. declarations1StatementList の TopLevelLexicallyScopedDeclarations とする。
  2. declarations2StatementListItem の TopLevelLexicallyScopedDeclarations とする。
  3. declarations1declarations2リスト結合を返す。
StatementListItem : Statement
  1. 新しい空の List を返す。
StatementListItem : Declaration
  1. Declaration Declaration : HoistableDeclaration であれば
    1. 新しい空の List を返す。
  2. « Declaration » を返す。

8.2.10 静的意味論: TopLevelVarDeclaredNames : 文字列の List

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

StatementList : StatementList StatementListItem
  1. names1StatementList の TopLevelVarDeclaredNames とする。
  2. names2StatementListItem の TopLevelVarDeclaredNames とする。
  3. names1names2リスト結合を返す。
StatementListItem : Declaration
  1. Declaration Declaration : HoistableDeclaration であれば
    1. HoistableDeclaration の BoundNames を返す。
  2. 新しい空の List を返す。
StatementListItem : Statement
  1. Statement Statement : LabelledStatement なら Statement の TopLevelVarDeclaredNames を返す。
  2. Statement の VarDeclaredNames を返す。
Note

関数またはスクリプトの最上位では内部の function 宣言は var 宣言として扱われる。

LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItem の TopLevelVarDeclaredNames を返す。
LabelledItem : Statement
  1. Statement Statement : LabelledStatement なら Statement の TopLevelVarDeclaredNames を返す。
  2. Statement の VarDeclaredNames を返す。
LabelledItem : FunctionDeclaration
  1. FunctionDeclaration の BoundNames を返す。

8.2.11 静的意味論: TopLevelVarScopedDeclarations : Parse Node の List

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

StatementList : StatementList StatementListItem
  1. declarations1StatementList の TopLevelVarScopedDeclarations とする。
  2. declarations2StatementListItem の TopLevelVarScopedDeclarations とする。
  3. declarations1declarations2リスト結合を返す。
StatementListItem : Statement
  1. Statement Statement : LabelledStatement なら Statement の TopLevelVarScopedDeclarations を返す。
  2. Statement の VarScopedDeclarations を返す。
StatementListItem : Declaration
  1. Declaration Declaration : HoistableDeclaration であれば
    1. declarationHoistableDeclaration の DeclarationPart とする。
    2. « declaration » を返す。
  2. 新しい空の List を返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItem の TopLevelVarScopedDeclarations を返す。
LabelledItem : Statement
  1. Statement Statement : LabelledStatement なら Statement の TopLevelVarScopedDeclarations を返す。
  2. Statement の VarScopedDeclarations を返す。
LabelledItem : FunctionDeclaration
  1. « FunctionDeclaration » を返す。

8.3 ラベル (Labels)

8.3.1 静的意味論: ContainsDuplicateLabels : Boolean

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

Statement : VariableStatement EmptyStatement ExpressionStatement ContinueStatement BreakStatement ReturnStatement ThrowStatement DebuggerStatement Block : { } StatementListItem : Declaration
  1. false を返す。
StatementList : StatementList StatementListItem
  1. hasDuplicatesStatementList の ContainsDuplicateLabels (引数 labelSet) とする。
  2. hasDuplicatestrue なら true を返す。
  3. StatementListItem の ContainsDuplicateLabels (引数 labelSet) を返す。
IfStatement : if ( Expression ) Statement else Statement
  1. hasDuplicate を 最初の Statement の ContainsDuplicateLabels (引数 labelSet) とする。
  2. hasDuplicatetrue なら true を返す。
  3. 2番目の Statement の ContainsDuplicateLabels (引数 labelSet) を返す。
IfStatement : if ( Expression ) Statement
  1. Statement の ContainsDuplicateLabels (引数 labelSet) を返す。
DoWhileStatement : do Statement while ( Expression ) ;
  1. Statement の ContainsDuplicateLabels (引数 labelSet) を返す。
WhileStatement : while ( Expression ) Statement
  1. Statement の ContainsDuplicateLabels (引数 labelSet) を返す。
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. Statement の ContainsDuplicateLabels (引数 labelSet) を返す。
ForInOfStatement : for ( LeftHandSideExpression in Expression ) Statement for ( var ForBinding in Expression ) Statement for ( ForDeclaration in Expression ) Statement for ( LeftHandSideExpression of AssignmentExpression ) Statement for ( var ForBinding of AssignmentExpression ) Statement for ( ForDeclaration of AssignmentExpression ) Statement for await ( LeftHandSideExpression of AssignmentExpression ) Statement for await ( var ForBinding of AssignmentExpression ) Statement for await ( ForDeclaration of AssignmentExpression ) Statement
  1. Statement の ContainsDuplicateLabels (引数 labelSet) を返す。
Note

本節は付録 B.3.5 により拡張される。

WithStatement : with ( Expression ) Statement
  1. Statement の ContainsDuplicateLabels (引数 labelSet) を返す。
SwitchStatement : switch ( Expression ) CaseBlock
  1. CaseBlock の ContainsDuplicateLabels (引数 labelSet) を返す。
CaseBlock : { }
  1. false を返す。
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 最初の CaseClauses が存在するなら
    1. 最初の CaseClauses の ContainsDuplicateLabels (引数 labelSet) が true なら true を返す。
  2. DefaultClause の ContainsDuplicateLabels (引数 labelSet) が true なら true を返す。
  3. 2番目の CaseClauses が存在しないなら false を返す。
  4. 2番目の CaseClauses の ContainsDuplicateLabels (引数 labelSet) を返す。
CaseClauses : CaseClauses CaseClause
  1. hasDuplicatesCaseClauses の ContainsDuplicateLabels (引数 labelSet) とする。
  2. hasDuplicatestrue なら true を返す。
  3. CaseClause の ContainsDuplicateLabels (引数 labelSet) を返す。
CaseClause : case Expression : StatementListopt
  1. StatementList が存在するなら StatementList の ContainsDuplicateLabels (引数 labelSet) を返す。
  2. false を返す。
DefaultClause : default : StatementListopt
  1. StatementList が存在するなら StatementList の ContainsDuplicateLabels (引数 labelSet) を返す。
  2. false を返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. labelLabelIdentifier の StringValue とする。
  2. labelSetlabel を含むなら true を返す。
  3. newLabelSetlabelSet と « label » のリスト結合とする。
  4. LabelledItem の ContainsDuplicateLabels (引数 newLabelSet) を返す。
LabelledItem : FunctionDeclaration
  1. false を返す。
TryStatement : try Block Catch
  1. hasDuplicatesBlock の ContainsDuplicateLabels (引数 labelSet) とする。
  2. hasDuplicatestrue なら true を返す。
  3. Catch の ContainsDuplicateLabels (引数 labelSet) を返す。
TryStatement : try Block Finally
  1. hasDuplicatesBlock の ContainsDuplicateLabels (引数 labelSet) とする。
  2. hasDuplicatestrue なら true を返す。
  3. Finally の ContainsDuplicateLabels (引数 labelSet) を返す。
TryStatement : try Block Catch Finally
  1. Block の ContainsDuplicateLabels (引数 labelSet) が true なら true を返す。
  2. Catch の ContainsDuplicateLabels (引数 labelSet) が true なら true を返す。
  3. Finally の ContainsDuplicateLabels (引数 labelSet) を返す。
Catch : catch ( CatchParameter ) Block
  1. Block の ContainsDuplicateLabels (引数 labelSet) を返す。
FunctionStatementList : [empty]
  1. false を返す。
ClassStaticBlockStatementList : [empty]
  1. false を返す。
ModuleItemList : ModuleItemList ModuleItem
  1. hasDuplicatesModuleItemList の ContainsDuplicateLabels (引数 labelSet) とする。
  2. hasDuplicatestrue なら true を返す。
  3. ModuleItem の ContainsDuplicateLabels (引数 labelSet) を返す。
ModuleItem : ImportDeclaration ExportDeclaration
  1. false を返す。

8.3.2 静的意味論: ContainsUndefinedBreakTarget : Boolean

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

Statement : VariableStatement EmptyStatement ExpressionStatement ContinueStatement ReturnStatement ThrowStatement DebuggerStatement Block : { } StatementListItem : Declaration
  1. false を返す。
StatementList : StatementList StatementListItem
  1. hasUndefinedLabelsStatementList の ContainsUndefinedBreakTarget (引数 labelSet) とする。
  2. hasUndefinedLabelstrue なら true を返す。
  3. StatementListItem の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
IfStatement : if ( Expression ) Statement else Statement
  1. hasUndefinedLabels を 最初の Statement の ContainsUndefinedBreakTarget (引数 labelSet) とする。
  2. hasUndefinedLabelstrue なら true を返す。
  3. 2番目の Statement の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
IfStatement : if ( Expression ) Statement
  1. Statement の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
DoWhileStatement : do Statement while ( Expression ) ;
  1. Statement の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
WhileStatement : while ( Expression ) Statement
  1. Statement の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. Statement の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
ForInOfStatement : for ( LeftHandSideExpression in Expression ) Statement for ( var ForBinding in Expression ) Statement for ( ForDeclaration in Expression ) Statement for ( LeftHandSideExpression of AssignmentExpression ) Statement for ( var ForBinding of AssignmentExpression ) Statement for ( ForDeclaration of AssignmentExpression ) Statement for await ( LeftHandSideExpression of AssignmentExpression ) Statement for await ( var ForBinding of AssignmentExpression ) Statement for await ( ForDeclaration of AssignmentExpression ) Statement
  1. Statement の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
Note

本節は付録 B.3.5 により拡張される。

BreakStatement : break ;
  1. false を返す。
BreakStatement : break LabelIdentifier ;
  1. labelSetLabelIdentifier の StringValue を含まないなら true を返す。
  2. false を返す。
WithStatement : with ( Expression ) Statement
  1. Statement の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
SwitchStatement : switch ( Expression ) CaseBlock
  1. CaseBlock の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
CaseBlock : { }
  1. false を返す。
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 最初の CaseClauses が存在するなら
    1. 最初の CaseClauses の ContainsUndefinedBreakTarget (引数 labelSet) が true なら true を返す。
  2. DefaultClause の ContainsUndefinedBreakTarget (引数 labelSet) が true なら true を返す。
  3. 2番目の CaseClauses が存在しないなら false を返す。
  4. 2番目の CaseClauses の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
CaseClauses : CaseClauses CaseClause
  1. hasUndefinedLabelsCaseClauses の ContainsUndefinedBreakTarget (引数 labelSet) とする。
  2. hasUndefinedLabelstrue なら true を返す。
  3. CaseClause の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
CaseClause : case Expression : StatementListopt
  1. StatementList が存在するなら StatementList の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
  2. false を返す。
DefaultClause : default : StatementListopt
  1. StatementList が存在するなら StatementList の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
  2. false を返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. labelLabelIdentifier の StringValue とする。
  2. newLabelSetlabelSet と « label » のリスト結合とする。
  3. LabelledItem の ContainsUndefinedBreakTarget (引数 newLabelSet) を返す。
LabelledItem : FunctionDeclaration
  1. false を返す。
TryStatement : try Block Catch
  1. hasUndefinedLabelsBlock の ContainsUndefinedBreakTarget (引数 labelSet) とする。
  2. hasUndefinedLabelstrue なら true を返す。
  3. Catch の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
TryStatement : try Block Finally
  1. hasUndefinedLabelsBlock の ContainsUndefinedBreakTarget (引数 labelSet) とする。
  2. hasUndefinedLabelstrue なら true を返す。
  3. Finally の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
TryStatement : try Block Catch Finally
  1. Block の ContainsUndefinedBreakTarget (引数 labelSet) が true なら true を返す。
  2. Catch の ContainsUndefinedBreakTarget (引数 labelSet) が true なら true を返す。
  3. Finally の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
Catch : catch ( CatchParameter ) Block
  1. Block の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
FunctionStatementList : [empty]
  1. false を返す。
ClassStaticBlockStatementList : [empty]
  1. false を返す。
ModuleItemList : ModuleItemList ModuleItem
  1. hasUndefinedLabelsModuleItemList の ContainsUndefinedBreakTarget (引数 labelSet) とする。
  2. hasUndefinedLabelstrue なら true を返す。
  3. ModuleItem の ContainsUndefinedBreakTarget (引数 labelSet) を返す。
ModuleItem : ImportDeclaration ExportDeclaration
  1. false を返す。

8.3.3 静的意味論: ContainsUndefinedContinueTarget : Boolean

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

Statement : VariableStatement EmptyStatement ExpressionStatement BreakStatement ReturnStatement ThrowStatement DebuggerStatement Block : { } StatementListItem : Declaration
  1. false を返す。
Statement : BlockStatement
  1. BlockStatement の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
BreakableStatement : IterationStatement
  1. newIterationSetiterationSetlabelSetリスト結合とする。
  2. IterationStatement の ContainsUndefinedContinueTarget (引数 newIterationSet と « ») を返す。
StatementList : StatementList StatementListItem
  1. hasUndefinedLabelsStatementList の ContainsUndefinedContinueTarget (引数 iterationSet と « ») とする。
  2. hasUndefinedLabelstrue なら true を返す。
  3. StatementListItem の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
IfStatement : if ( Expression ) Statement else Statement
  1. hasUndefinedLabels を 最初の Statement の ContainsUndefinedContinueTarget (引数 iterationSet と « ») とする。
  2. hasUndefinedLabelstrue なら true を返す。
  3. 2番目の Statement の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
IfStatement : if ( Expression ) Statement
  1. Statement の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
DoWhileStatement : do Statement while ( Expression ) ;
  1. Statement の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
WhileStatement : while ( Expression ) Statement
  1. Statement の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. Statement の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
ForInOfStatement : for ( LeftHandSideExpression in Expression ) Statement for ( var ForBinding in Expression ) Statement for ( ForDeclaration in Expression ) Statement for ( LeftHandSideExpression of AssignmentExpression ) Statement for ( var ForBinding of AssignmentExpression ) Statement for ( ForDeclaration of AssignmentExpression ) Statement for await ( LeftHandSideExpression of AssignmentExpression ) Statement for await ( var ForBinding of AssignmentExpression ) Statement for await ( ForDeclaration of AssignmentExpression ) Statement
  1. Statement の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
Note

本節は付録 B.3.5 により拡張される。

ContinueStatement : continue ;
  1. false を返す。
ContinueStatement : continue LabelIdentifier ;
  1. iterationSetLabelIdentifier の StringValue を含まないなら true を返す。
  2. false を返す。
WithStatement : with ( Expression ) Statement
  1. Statement の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
SwitchStatement : switch ( Expression ) CaseBlock
  1. CaseBlock の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
CaseBlock : { }
  1. false を返す。
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 最初の CaseClauses が存在するなら
    1. 最初の CaseClauses の ContainsUndefinedContinueTarget (引数 iterationSet と « ») が true なら true を返す。
  2. DefaultClause の ContainsUndefinedContinueTarget (引数 iterationSet と « ») が true なら true を返す。
  3. 2番目の CaseClauses が存在しないなら false を返す。
  4. 2番目の CaseClauses の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
CaseClauses : CaseClauses CaseClause
  1. hasUndefinedLabelsCaseClauses の ContainsUndefinedContinueTarget (引数 iterationSet と « ») とする。
  2. hasUndefinedLabelstrue なら true を返す。
  3. CaseClause の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
CaseClause : case Expression : StatementListopt
  1. StatementList が存在するなら StatementList の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
  2. false を返す。
DefaultClause : default : StatementListopt
  1. StatementList が存在するなら StatementList の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
  2. false を返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. labelLabelIdentifier の StringValue とする。
  2. newLabelSetlabelSet と « label » のリスト結合とする。
  3. LabelledItem の ContainsUndefinedContinueTarget (引数 iterationSetnewLabelSet) を返す。
LabelledItem : FunctionDeclaration
  1. false を返す。
TryStatement : try Block Catch
  1. hasUndefinedLabelsBlock の ContainsUndefinedContinueTarget (引数 iterationSet と « ») とする。
  2. hasUndefinedLabelstrue なら true を返す。
  3. Catch の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
TryStatement : try Block Finally
  1. hasUndefinedLabelsBlock の ContainsUndefinedContinueTarget (引数 iterationSet と « ») とする。
  2. hasUndefinedLabelstrue なら true を返す。
  3. Finally の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
TryStatement : try Block Catch Finally
  1. Block の ContainsUndefinedContinueTarget (引数 iterationSet と « ») が true なら true を返す。
  2. Catch の ContainsUndefinedContinueTarget (引数 iterationSet と « ») が true なら true を返す。
  3. Finally の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
Catch : catch ( CatchParameter ) Block
  1. Block の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
FunctionStatementList : [empty]
  1. false を返す。
ClassStaticBlockStatementList : [empty]
  1. false を返す。
ModuleItemList : ModuleItemList ModuleItem
  1. hasUndefinedLabelsModuleItemList の ContainsUndefinedContinueTarget (引数 iterationSet と « ») とする。
  2. hasUndefinedLabelstrue なら true を返す。
  3. ModuleItem の ContainsUndefinedContinueTarget (引数 iterationSet と « ») を返す。
ModuleItem : ImportDeclaration ExportDeclaration
  1. false を返す。

8.4 関数名の推論 (Function Name Inference)

8.4.1 静的意味論: HasName : Boolean

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
  1. exprCoverParenthesizedExpressionAndArrowParameterList によって被覆される ParenthesizedExpression とする。
  2. IsFunctionDefinition of exprfalse なら false を返す。
  3. expr の HasName を返す。
FunctionExpression : function ( FormalParameters ) { FunctionBody } GeneratorExpression : function * ( FormalParameters ) { GeneratorBody } AsyncGeneratorExpression : async function * ( FormalParameters ) { AsyncGeneratorBody } AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody } ArrowFunction : ArrowParameters => ConciseBody AsyncArrowFunction : async AsyncArrowBindingIdentifier => AsyncConciseBody CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody ClassExpression : class ClassTail
  1. false を返す。
FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody } GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } ClassExpression : class BindingIdentifier ClassTail
  1. true を返す。

8.4.2 静的意味論: IsFunctionDefinition : Boolean

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
  1. exprCoverParenthesizedExpressionAndArrowParameterList によって被覆される ParenthesizedExpression とする。
  2. expr の IsFunctionDefinition を返す。
PrimaryExpression : this IdentifierReference Literal ArrayLiteral ObjectLiteral RegularExpressionLiteral TemplateLiteral MemberExpression : MemberExpression [ Expression ] MemberExpression . IdentifierName MemberExpression TemplateLiteral SuperProperty MetaProperty new MemberExpression Arguments MemberExpression . PrivateIdentifier NewExpression : new NewExpression LeftHandSideExpression : CallExpression OptionalExpression UpdateExpression : LeftHandSideExpression ++ LeftHandSideExpression -- ++ UnaryExpression -- UnaryExpression UnaryExpression : delete UnaryExpression void UnaryExpression typeof UnaryExpression + UnaryExpression - UnaryExpression ~ UnaryExpression ! UnaryExpression AwaitExpression ExponentiationExpression : UpdateExpression ** ExponentiationExpression MultiplicativeExpression : MultiplicativeExpression MultiplicativeOperator ExponentiationExpression AdditiveExpression : AdditiveExpression + MultiplicativeExpression AdditiveExpression - MultiplicativeExpression ShiftExpression : ShiftExpression << AdditiveExpression ShiftExpression >> AdditiveExpression ShiftExpression >>> AdditiveExpression RelationalExpression : RelationalExpression < ShiftExpression RelationalExpression > ShiftExpression RelationalExpression <= ShiftExpression RelationalExpression >= ShiftExpression RelationalExpression instanceof ShiftExpression RelationalExpression in ShiftExpression PrivateIdentifier in ShiftExpression EqualityExpression : EqualityExpression == RelationalExpression EqualityExpression != RelationalExpression EqualityExpression === RelationalExpression EqualityExpression !== RelationalExpression BitwiseANDExpression : BitwiseANDExpression & EqualityExpression BitwiseXORExpression : BitwiseXORExpression ^ BitwiseANDExpression BitwiseORExpression : BitwiseORExpression | BitwiseXORExpression LogicalANDExpression : LogicalANDExpression && BitwiseORExpression LogicalORExpression : LogicalORExpression || LogicalANDExpression CoalesceExpression : CoalesceExpressionHead ?? BitwiseORExpression ConditionalExpression : ShortCircuitExpression ? AssignmentExpression : AssignmentExpression AssignmentExpression : YieldExpression LeftHandSideExpression = AssignmentExpression LeftHandSideExpression AssignmentOperator AssignmentExpression LeftHandSideExpression &&= AssignmentExpression LeftHandSideExpression ||= AssignmentExpression LeftHandSideExpression ??= AssignmentExpression Expression : Expression , AssignmentExpression
  1. false を返す。
AssignmentExpression : ArrowFunction AsyncArrowFunction FunctionExpression : function BindingIdentifieropt ( FormalParameters ) { FunctionBody } GeneratorExpression : function * BindingIdentifieropt ( FormalParameters ) { GeneratorBody } AsyncGeneratorExpression : async function * BindingIdentifieropt ( FormalParameters ) { AsyncGeneratorBody } AsyncFunctionExpression : async function BindingIdentifieropt ( FormalParameters ) { AsyncFunctionBody } ClassExpression : class BindingIdentifieropt ClassTail
  1. true を返す。

8.4.3 静的意味論: IsAnonymousFunctionDefinition ( expr: AssignmentExpression 生成句ノード, Initializer 生成句ノード, または Expression 生成句ノード, ): Boolean

The abstract operation UNKNOWN takes UNPARSEABLE ARGUMENTS. 引数が名前を束縛しない関数定義かどうかを判定する。 It performs the following steps when called:

  1. IsFunctionDefinition of exprfalse なら false を返す。
  2. hasName を HasName of expr とする。
  3. hasNametrue なら false を返す。
  4. true を返す。

8.4.4 静的意味論: IsIdentifierRef : Boolean

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

PrimaryExpression : IdentifierReference
  1. true を返す。
PrimaryExpression : this Literal ArrayLiteral ObjectLiteral FunctionExpression ClassExpression GeneratorExpression AsyncFunctionExpression AsyncGeneratorExpression RegularExpressionLiteral TemplateLiteral CoverParenthesizedExpressionAndArrowParameterList MemberExpression : MemberExpression [ Expression ] MemberExpression . IdentifierName MemberExpression TemplateLiteral SuperProperty MetaProperty new MemberExpression Arguments MemberExpression . PrivateIdentifier NewExpression : new NewExpression LeftHandSideExpression : CallExpression OptionalExpression
  1. false を返す。

8.4.5 実行時意味論: NamedEvaluation : 関数オブジェクトを含む正常完了または異常完了

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
  1. exprCoverParenthesizedExpressionAndArrowParameterList によって被覆される ParenthesizedExpression とする。
  2. 引数 nameexpr の NamedEvaluation を ? 付きで返す。
ParenthesizedExpression : ( Expression )
  1. アサート: IsAnonymousFunctionDefinition(Expression) は true
  2. 引数 nameExpression の NamedEvaluation を ? 付きで返す。
FunctionExpression : function ( FormalParameters ) { FunctionBody }
  1. 引数 nameFunctionExpression の InstantiateOrdinaryFunctionExpression を返す。
GeneratorExpression : function * ( FormalParameters ) { GeneratorBody }
  1. 引数 nameGeneratorExpression の InstantiateGeneratorFunctionExpression を返す。
AsyncGeneratorExpression : async function * ( FormalParameters ) { AsyncGeneratorBody }
  1. 引数 nameAsyncGeneratorExpression の InstantiateAsyncGeneratorFunctionExpression を返す。
AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
  1. 引数 nameAsyncFunctionExpression の InstantiateAsyncFunctionExpression を返す。
ArrowFunction : ArrowParameters => ConciseBody
  1. 引数 nameArrowFunction の InstantiateArrowFunctionExpression を返す。
AsyncArrowFunction : async AsyncArrowBindingIdentifier => AsyncConciseBody CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
  1. 引数 nameAsyncArrowFunction の InstantiateAsyncArrowFunctionExpression を返す。
ClassExpression : class ClassTail
  1. sourceTextClassExpression によりマッチしたソーステキストとする。
  2. 引数 undefined, name, sourceTextClassTail の ClassDefinitionEvaluation を ? 付きで返す。

8.5 Contains

8.5.1 静的意味論: Contains : Boolean

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS.

以下に列挙されていない本仕様中のすべての文法生成規則の代替は、暗黙的に次の既定の Contains 定義を持つ:

  1. この生成句ノードの各子ノード child について:
    1. childsymbol のインスタンスであるなら true を返す。
    2. child が非終端記号のインスタンスなら
      1. containedchild Contains symbol の結果とする。
      2. containedtrue なら true を返す。
  2. false を返す。
FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody } function ( FormalParameters ) { FunctionBody } FunctionExpression : function BindingIdentifieropt ( FormalParameters ) { FunctionBody } GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } function * ( FormalParameters ) { GeneratorBody } GeneratorExpression : function * BindingIdentifieropt ( FormalParameters ) { GeneratorBody } AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } async function * ( FormalParameters ) { AsyncGeneratorBody } AsyncGeneratorExpression : async function * BindingIdentifieropt ( FormalParameters ) { AsyncGeneratorBody } AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } async function ( FormalParameters ) { AsyncFunctionBody } AsyncFunctionExpression : async function BindingIdentifieropt ( FormalParameters ) { AsyncFunctionBody }
  1. false を返す。
Note 1

部分構造に依存する静的意味規則は一般に関数定義内部を調べない。

ClassTail : ClassHeritageopt { ClassBody }
  1. symbolClassBody なら true を返す。
  2. symbolClassHeritage なら
    1. ClassHeritage が存在するなら true、そうでなければ false を返す。
  3. ClassHeritage が存在するなら
    1. ClassHeritage Contains symboltrue なら true を返す。
  4. 引数 symbolClassBody の ComputedPropertyContains の結果を返す。
Note 2

部分構造に依存する静的意味規則は一般にクラス本体内部(PropertyName 以外)を調べない。

ClassStaticBlock : static { ClassStaticBlockBody }
  1. false を返す。
Note 3

部分構造に依存する静的意味規則は一般に static 初期化ブロック内部を調べない。

ArrowFunction : ArrowParameters => ConciseBody
  1. symbolNewTarget, SuperProperty, SuperCall, super, this のいずれでもないなら false を返す。
  2. ArrowParameters Contains symboltrue なら true を返す。
  3. ConciseBody Contains symbol を返す。
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
  1. formalsCoverParenthesizedExpressionAndArrowParameterList により被覆される ArrowFormalParameters とする。
  2. formals Contains symbol を返す。
AsyncArrowFunction : async AsyncArrowBindingIdentifier => AsyncConciseBody
  1. symbolNewTarget, SuperProperty, SuperCall, super, this のいずれでもないなら false を返す。
  2. AsyncConciseBody Contains symbol を返す。
AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
  1. symbolNewTarget, SuperProperty, SuperCall, super, this のいずれでもないなら false を返す。
  2. headCoverCallExpressionAndAsyncArrowHead により被覆される AsyncArrowHead とする。
  3. head Contains symboltrue なら true を返す。
  4. AsyncConciseBody Contains symbol を返す。
Note 4

Contains は ArrowFunctionAsyncArrowFunction 内での new.target, this, super 使用を検出するために用いられる。

PropertyDefinition : MethodDefinition
  1. symbolMethodDefinition なら true を返す。
  2. 引数 symbolMethodDefinition の ComputedPropertyContains の結果を返す。
LiteralPropertyName : IdentifierName
  1. false を返す。
MemberExpression : MemberExpression . IdentifierName
  1. MemberExpression Contains symboltrue なら true を返す。
  2. false を返す。
SuperProperty : super . IdentifierName
  1. symbol が 予約語 super であるなら true を返す。
  2. false を返す。
CallExpression : CallExpression . IdentifierName
  1. CallExpression Contains symboltrue なら true を返す。
  2. false を返す。
OptionalChain : ?. IdentifierName
  1. false を返す。
OptionalChain : OptionalChain . IdentifierName
  1. OptionalChain Contains symboltrue なら true を返す。
  2. false を返す。

8.5.2 静的意味論: ComputedPropertyContains : Boolean

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

ClassElementName : PrivateIdentifier PropertyName : LiteralPropertyName
  1. false を返す。
PropertyName : ComputedPropertyName
  1. ComputedPropertyName Contains symbol の結果を返す。
MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody } get ClassElementName ( ) { FunctionBody } set ClassElementName ( PropertySetParameterList ) { FunctionBody }
  1. 引数 symbolClassElementName の ComputedPropertyContains の結果を返す。
GeneratorMethod : * ClassElementName ( UniqueFormalParameters ) { GeneratorBody }
  1. 引数 symbolClassElementName の ComputedPropertyContains の結果を返す。
AsyncGeneratorMethod : async * ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody }
  1. 引数 symbolClassElementName の ComputedPropertyContains の結果を返す。
ClassElementList : ClassElementList ClassElement
  1. inList を 引数 symbolClassElementList の ComputedPropertyContains とする。
  2. inListtrue なら true を返す。
  3. 引数 symbolClassElement の ComputedPropertyContains の結果を返す。
ClassElement : ClassStaticBlock
  1. false を返す。
ClassElement : ;
  1. false を返す。
AsyncMethod : async ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody }
  1. 引数 symbolClassElementName の ComputedPropertyContains の結果を返す。
FieldDefinition : ClassElementName Initializeropt
  1. 引数 symbolClassElementName の ComputedPropertyContains の結果を返す。

8.6 その他 (Miscellaneous)

これらの操作は仕様全体の複数箇所で使用される。

8.6.1 実行時意味論: InstantiateFunctionObject : ECMAScript 関数オブジェクト

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody } function ( FormalParameters ) { FunctionBody }
  1. 引数 env, privateEnvFunctionDeclaration の InstantiateOrdinaryFunctionObject を返す。
GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } function * ( FormalParameters ) { GeneratorBody }
  1. 引数 env, privateEnvGeneratorDeclaration の InstantiateGeneratorFunctionObject を返す。
AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } async function * ( FormalParameters ) { AsyncGeneratorBody }
  1. 引数 env, privateEnvAsyncGeneratorDeclaration の InstantiateAsyncGeneratorFunctionObject を返す。
AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } async function ( FormalParameters ) { AsyncFunctionBody }
  1. 引数 env, privateEnvAsyncFunctionDeclaration の InstantiateAsyncFunctionObject を返す。

8.6.2 実行時意味論: BindingInitialization : unused を含む正常完了または異常完了

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS.

Note

environmentundefined が渡されるのは、初期化値の代入に PutValue 操作を用いることを示す。これは var 文と(いくつかの)非 strict 関数の仮引数リストの場合である(10.2.11 参照)。その場合、束縛は初期化子の評価前に巻き上げられ事前初期化される。

It is defined piecewise over the following productions:

BindingIdentifier : Identifier
  1. nameIdentifier の StringValue とする。
  2. InitializeBoundName(name, value, environment) を返す。
BindingIdentifier : yield
  1. InitializeBoundName("yield", value, environment) を返す。
BindingIdentifier : await
  1. InitializeBoundName("await", value, environment) を返す。
BindingPattern : ObjectBindingPattern
  1. RequireObjectCoercible(value) を実行する。
  2. 引数 value, environmentObjectBindingPattern の BindingInitialization を ? 付きで返す。
BindingPattern : ArrayBindingPattern
  1. iteratorRecord を ? GetIterator(value, sync) とする。
  2. resultCompletion( 引数 iteratorRecord, environmentArrayBindingPattern の IteratorBindingInitialization ) とする。
  3. iteratorRecord.[[Done]]false なら ? IteratorClose(iteratorRecord, result) を返す。
  4. result を返す。
ObjectBindingPattern : { }
  1. unused を返す。
ObjectBindingPattern : { BindingPropertyList } { BindingPropertyList , }
  1. 引数 value, environmentBindingPropertyList の PropertyBindingInitialization を ? 付きで実行する。
  2. unused を返す。
ObjectBindingPattern : { BindingRestProperty }
  1. excludedNames を空の新 List とする。
  2. 引数 value, environment, excludedNamesBindingRestProperty の RestBindingInitialization を ? 付きで返す。
ObjectBindingPattern : { BindingPropertyList , BindingRestProperty }
  1. excludedNames を 引数 value, environmentBindingPropertyList の PropertyBindingInitialization (結果は ? ) とする。
  2. 引数 value, environment, excludedNamesBindingRestProperty の RestBindingInitialization を ? 付きで返す。

8.6.2.1 InitializeBoundName ( name, value, environment )

The abstract operation InitializeBoundName takes arguments name (String), value (ECMAScript 言語値), and environment (Environment Record または undefined) and returns unused を含む正常完了または異常完了. It performs the following steps when called:

  1. environmentundefined でないなら
    1. environment.InitializeBinding(name, value) を実行する。
    2. unused を返す。
  2. それ以外
    1. lhs を ? ResolveBinding(name) とする。
    2. PutValue(lhs, value) を返す。

8.6.3 実行時意味論: IteratorBindingInitialization : unused を含む正常完了または異常完了

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS.

Note

environmentundefined が渡される場合は初期化値の代入に PutValue を使うことを示し、これは非 strict 関数の仮引数リストで発生する。その場合、同名パラメータの複数存在可能性に対処するため事前初期化される。

It is defined piecewise over the following productions:

ArrayBindingPattern : [ ]
  1. unused を返す。
ArrayBindingPattern : [ Elision ]
  1. 引数 iteratorRecordElision の IteratorDestructuringAssignmentEvaluation を ? 付きで返す。
ArrayBindingPattern : [ Elisionopt BindingRestElement ]
  1. Elision が存在するなら
    1. 引数 iteratorRecordElision の IteratorDestructuringAssignmentEvaluation を ? 付きで実行する。
  2. 引数 iteratorRecord, environmentBindingRestElement の IteratorBindingInitialization を ? 付きで返す。
ArrayBindingPattern : [ BindingElementList , Elision ]
  1. 引数 iteratorRecord, environmentBindingElementList の IteratorBindingInitialization を ? 付きで実行する。
  2. 引数 iteratorRecordElision の IteratorDestructuringAssignmentEvaluation を ? 付きで返す。
ArrayBindingPattern : [ BindingElementList , Elisionopt BindingRestElement ]
  1. 引数 iteratorRecord, environmentBindingElementList の IteratorBindingInitialization を ? 付きで実行する。
  2. Elision が存在するなら
    1. 引数 iteratorRecordElision の IteratorDestructuringAssignmentEvaluation を ? 付きで実行する。
  3. 引数 iteratorRecord, environmentBindingRestElement の IteratorBindingInitialization を ? 付きで返す。
BindingElementList : BindingElementList , BindingElisionElement
  1. 引数 iteratorRecord, environmentBindingElementList の IteratorBindingInitialization を ? 付きで実行する。
  2. 引数 iteratorRecord, environmentBindingElisionElement の IteratorBindingInitialization を ? 付きで返す。
BindingElisionElement : Elision BindingElement
  1. 引数 iteratorRecordElision の IteratorDestructuringAssignmentEvaluation を ? 付きで実行する。
  2. 引数 iteratorRecord, environmentBindingElement の IteratorBindingInitialization を ? 付きで返す。
SingleNameBinding : BindingIdentifier Initializeropt
  1. bindingIdBindingIdentifier の StringValue とする。
  2. lhs を ? ResolveBinding(bindingId, environment) とする。
  3. vundefined とする。
  4. iteratorRecord.[[Done]]false なら
    1. next を ? IteratorStepValue(iteratorRecord) とする。
    2. nextdone でないなら
      1. vnext に設定する。
  5. Initializer が存在し vundefined なら
    1. IsAnonymousFunctionDefinition(Initializer) が true なら
      1. v を ? NamedEvaluation(Initializer, 引数 bindingId) に設定する。
    2. それ以外
      1. defaultValue を ? Evaluation(Initializer) とする。
      2. v を ? GetValue(defaultValue) に設定する。
  6. environmentundefined なら ? PutValue(lhs, v) を返す。
  7. InitializeReferencedBinding(lhs, v) を返す。
BindingElement : BindingPattern Initializeropt
  1. vundefined とする。
  2. iteratorRecord.[[Done]]false なら
    1. next を ? IteratorStepValue(iteratorRecord) とする。
    2. nextdone でないなら
      1. vnext に設定する。
  3. Initializer が存在し vundefined なら
    1. defaultValue を ? Evaluation(Initializer) とする。
    2. v を ? GetValue(defaultValue) に設定する。
  4. 引数 v, environmentBindingPattern の BindingInitialization を ? 付きで返す。
BindingRestElement : ... BindingIdentifier
  1. lhs を ? ResolveBinding(StringValue of BindingIdentifier, environment) とする。
  2. A を ! ArrayCreate(0) とする。
  3. n を 0 とする。
  4. 繰り返し
    1. nextdone とする。
    2. iteratorRecord.[[Done]]false なら
      1. next を ? IteratorStepValue(iteratorRecord) に設定する。
    3. nextdone なら
      1. environmentundefined なら ? PutValue(lhs, A) を返す。
      2. InitializeReferencedBinding(lhs, A) を返す。
    4. CreateDataPropertyOrThrow(A, ! ToString(𝔽(n)), next) を実行する。
    5. nn + 1 に設定する。
BindingRestElement : ... BindingPattern
  1. A を ! ArrayCreate(0) とする。
  2. n を 0 とする。
  3. 繰り返し
    1. nextdone とする。
    2. iteratorRecord.[[Done]]false なら
      1. next を ? IteratorStepValue(iteratorRecord) に設定する。
    3. nextdone なら
      1. 引数 A, environmentBindingPattern の BindingInitialization を ? 付きで返す。
    4. CreateDataPropertyOrThrow(A, ! ToString(𝔽(n)), next) を実行する。
    5. nn + 1 に設定する。
FormalParameters : [empty]
  1. unused を返す。
FormalParameters : FormalParameterList , FunctionRestParameter
  1. 引数 iteratorRecord, environmentFormalParameterList の IteratorBindingInitialization を ? 付きで実行する。
  2. 引数 iteratorRecord, environmentFunctionRestParameter の IteratorBindingInitialization を ? 付きで返す。
FormalParameterList : FormalParameterList , FormalParameter
  1. 引数 iteratorRecord, environmentFormalParameterList の IteratorBindingInitialization を ? 付きで実行する。
  2. 引数 iteratorRecord, environmentFormalParameter の IteratorBindingInitialization を ? 付きで返す。
ArrowParameters : BindingIdentifier
  1. vundefined とする。
  2. アサート: iteratorRecord.[[Done]]false
  3. next を ? IteratorStepValue(iteratorRecord) とする。
  4. nextdone でないなら
    1. vnext に設定する。
  5. 引数 v, environmentBindingIdentifier の BindingInitialization を ? 付きで返す。
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
  1. formalsCoverParenthesizedExpressionAndArrowParameterList により被覆される ArrowFormalParameters とする。
  2. 引数 iteratorRecord, environmentformals の IteratorBindingInitialization を ? 付きで返す。
AsyncArrowBindingIdentifier : BindingIdentifier
  1. vundefined とする。
  2. アサート: iteratorRecord.[[Done]]false
  3. next を ? IteratorStepValue(iteratorRecord) とする。
  4. nextdone でないなら
    1. vnext に設定する。
  5. 引数 v, environmentBindingIdentifier の BindingInitialization を ? 付きで返す。

8.6.4 静的意味論: AssignmentTargetType : simple, web-compat, または invalid

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

IdentifierReference : Identifier
  1. IsStrict(this IdentifierReference) が true かつ Identifier の StringValue が "eval" または "arguments" のいずれかなら invalid を返す。
  2. simple を返す。
IdentifierReference : yield await CallExpression : CallExpression [ Expression ] CallExpression . IdentifierName CallExpression . PrivateIdentifier MemberExpression : MemberExpression [ Expression ] MemberExpression . IdentifierName SuperProperty MemberExpression . PrivateIdentifier
  1. simple を返す。
PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
  1. exprCoverParenthesizedExpressionAndArrowParameterList によって被覆される ParenthesizedExpression とする。
  2. expr の AssignmentTargetType を返す。
CallExpression : CoverCallExpressionAndAsyncArrowHead CallExpression Arguments
  1. Normative Optional
    ホストが Web ブラウザ又は 関数呼び出し代入ターゲットの実行時エラー をサポートし、かつ IsStrict(this CallExpression) が false なら
    1. web-compat を返す。
  2. invalid を返す。
PrimaryExpression : this Literal ArrayLiteral ObjectLiteral FunctionExpression ClassExpression GeneratorExpression AsyncFunctionExpression AsyncGeneratorExpression RegularExpressionLiteral TemplateLiteral CallExpression : SuperCall ImportCall CallExpression TemplateLiteral NewExpression : new NewExpression MemberExpression : MemberExpression TemplateLiteral new MemberExpression Arguments NewTarget : new . target ImportMeta : import . meta LeftHandSideExpression : OptionalExpression UpdateExpression : LeftHandSideExpression ++ LeftHandSideExpression -- ++ UnaryExpression -- UnaryExpression UnaryExpression : delete UnaryExpression void UnaryExpression typeof UnaryExpression + UnaryExpression - UnaryExpression ~ UnaryExpression ! UnaryExpression AwaitExpression ExponentiationExpression : UpdateExpression ** ExponentiationExpression MultiplicativeExpression : MultiplicativeExpression MultiplicativeOperator ExponentiationExpression AdditiveExpression : AdditiveExpression + MultiplicativeExpression AdditiveExpression - MultiplicativeExpression ShiftExpression : ShiftExpression << AdditiveExpression ShiftExpression >> AdditiveExpression ShiftExpression >>> AdditiveExpression RelationalExpression : RelationalExpression < ShiftExpression RelationalExpression > ShiftExpression RelationalExpression <= ShiftExpression RelationalExpression >= ShiftExpression RelationalExpression instanceof ShiftExpression RelationalExpression in ShiftExpression PrivateIdentifier in ShiftExpression EqualityExpression : EqualityExpression == RelationalExpression EqualityExpression != RelationalExpression EqualityExpression === RelationalExpression EqualityExpression !== RelationalExpression BitwiseANDExpression : BitwiseANDExpression & EqualityExpression BitwiseXORExpression : BitwiseXORExpression ^ BitwiseANDExpression BitwiseORExpression : BitwiseORExpression | BitwiseXORExpression LogicalANDExpression : LogicalANDExpression && BitwiseORExpression LogicalORExpression : LogicalORExpression || LogicalANDExpression CoalesceExpression : CoalesceExpressionHead ?? BitwiseORExpression ConditionalExpression : ShortCircuitExpression ? AssignmentExpression : AssignmentExpression AssignmentExpression : YieldExpression ArrowFunction AsyncArrowFunction LeftHandSideExpression = AssignmentExpression LeftHandSideExpression AssignmentOperator AssignmentExpression LeftHandSideExpression &&= AssignmentExpression LeftHandSideExpression ||= AssignmentExpression LeftHandSideExpression ??= AssignmentExpression Expression : Expression , AssignmentExpression
  1. invalid を返す。

8.6.5 静的意味論: PropName : String または empty

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS. It is defined piecewise over the following productions:

PropertyDefinition : IdentifierReference
  1. IdentifierReference の StringValue を返す。
PropertyDefinition : ... AssignmentExpression
  1. empty を返す。
PropertyDefinition : PropertyName : AssignmentExpression
  1. PropertyName の PropName を返す。
LiteralPropertyName : IdentifierName AttributeKey : IdentifierName
  1. IdentifierName の StringValue を返す。
LiteralPropertyName : StringLiteral AttributeKey : StringLiteral
  1. StringLiteral の SV を返す。
LiteralPropertyName : NumericLiteral
  1. nbrNumericLiteral の NumericValue とする。
  2. ToString(nbr) を返す。
ComputedPropertyName : [ AssignmentExpression ]
  1. empty を返す。
MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody } get ClassElementName ( ) { FunctionBody } set ClassElementName ( PropertySetParameterList ) { FunctionBody }
  1. ClassElementName の PropName を返す。
GeneratorMethod : * ClassElementName ( UniqueFormalParameters ) { GeneratorBody }
  1. ClassElementName の PropName を返す。
AsyncGeneratorMethod : async * ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody }
  1. ClassElementName の PropName を返す。
ClassElement : ClassStaticBlock
  1. empty を返す。
ClassElement : ;
  1. empty を返す。
AsyncMethod : async ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody }
  1. ClassElementName の PropName を返す。
FieldDefinition : ClassElementName Initializeropt
  1. ClassElementName の PropName を返す。
ClassElementName : PrivateIdentifier
  1. empty を返す。