8 構文指向操作

この節で定義されるものに加えて、特殊化された構文指向操作がこの仕様全体にわたって定義されます。

8.1 Runtime Semantics: Evaluation

The syntax-directed operation Evaluation takes no arguments and returns a Completion Record.

Note
この操作の定義は、この仕様の“ECMAScript Language”節全体に分散しています。各定義は、関連するproductionsの定義出現の後に現れます。

8.2 Scope Analysis

8.2.1 Static Semantics: BoundNames

The syntax-directed operation BoundNames takes no arguments and returns a List of Strings.

Note

"*default*"は、この仕様内で、moduleのdefault exportが別の名前を持たない場合の合成名として使用されます。moduleの[[Environment]]内にはその名前のentryが作成され、対応する値を保持します。また、そのmoduleについてResolveExport ( exportName [ , resolveSet ] )を呼び出して"default"という名前のexportを解決すると、[[BindingName]]"*default*"であるResolvedBinding Recordが返され、それがmoduleの[[Environment]]内で上記の値に解決されます。これは、anonymous default exportsを他のexportと同様に解決できるようにするための仕様上の便宜のためだけに行われます。この"*default*"文字列は、ECMAScriptコードにもmodule linking algorithmにも決してアクセス可能ではありません。

It is defined piecewise over the following productions:

BindingIdentifier : Identifier
  1. 唯一の要素がIdentifierStringValueであるListを返す。
BindingIdentifier : yield
  1. « "yield" »を返す。
BindingIdentifier : await
  1. « "await" »を返す。
LexicalDeclaration : LetOrConst BindingList ;
  1. BindingListBoundNames を返す。
UsingDeclaration : using BindingList ; AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
  1. BindingListBoundNamesを返す。
BindingList : BindingList , LexicalBinding
  1. names1BindingListBoundNamesとする。
  2. names2LexicalBindingBoundNamesとする。
  3. names1names2list-concatenationを返す。
LexicalBinding : BindingIdentifier Initializeropt
  1. BindingIdentifierBoundNamesを返す。
LexicalBinding : BindingPattern Initializer
  1. BindingPatternBoundNamesを返す。
VariableDeclarationList : VariableDeclarationList , VariableDeclaration
  1. names1VariableDeclarationListBoundNamesとする。
  2. names2VariableDeclarationBoundNamesとする。
  3. names1names2list-concatenationを返す。
VariableDeclaration : BindingIdentifier Initializeropt
  1. BindingIdentifierBoundNamesを返す。
VariableDeclaration : BindingPattern Initializer
  1. BindingPatternBoundNamesを返す。
ObjectBindingPattern : { }
  1. 新しい空のListを返す。
ObjectBindingPattern : { BindingPropertyList , BindingRestProperty }
  1. names1BindingPropertyListBoundNamesとする。
  2. names2BindingRestPropertyBoundNamesとする。
  3. names1names2list-concatenationを返す。
ArrayBindingPattern : [ Elisionopt ]
  1. 新しい空のListを返す。
ArrayBindingPattern : [ Elisionopt BindingRestElement ]
  1. BindingRestElementBoundNamesを返す。
ArrayBindingPattern : [ BindingElementList , Elisionopt ]
  1. BindingElementListBoundNamesを返す。
ArrayBindingPattern : [ BindingElementList , Elisionopt BindingRestElement ]
  1. names1BindingElementListBoundNamesとする。
  2. names2BindingRestElementBoundNamesとする。
  3. names1names2list-concatenationを返す。
BindingPropertyList : BindingPropertyList , BindingProperty
  1. names1BindingPropertyListBoundNamesとする。
  2. names2BindingPropertyBoundNamesとする。
  3. names1names2list-concatenationを返す。
BindingElementList : BindingElementList , BindingElisionElement
  1. names1BindingElementListBoundNamesとする。
  2. names2BindingElisionElementBoundNamesとする。
  3. names1names2list-concatenationを返す。
BindingElisionElement : Elisionopt BindingElement
  1. BindingElementBoundNamesを返す。
BindingProperty : PropertyName : BindingElement
  1. BindingElementBoundNamesを返す。
SingleNameBinding : BindingIdentifier Initializeropt
  1. BindingIdentifierBoundNamesを返す。
BindingElement : BindingPattern Initializeropt
  1. BindingPatternBoundNamesを返す。
ForDeclaration : LetOrConst ForBinding
  1. ForBindingBoundNamesを返す。
FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
  1. BindingIdentifierBoundNamesを返す。
FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
  1. « "*default*" »を返す。
FormalParameters : [empty]
  1. 新しい空のListを返す。
FormalParameters : FormalParameterList , FunctionRestParameter
  1. names1FormalParameterListBoundNamesとする。
  2. names2FunctionRestParameterBoundNamesとする。
  3. names1names2list-concatenationを返す。
FormalParameterList : FormalParameterList , FormalParameter
  1. names1FormalParameterListBoundNamesとする。
  2. names2FormalParameterBoundNamesとする。
  3. names1names2list-concatenationを返す。
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
  1. formalsを、CoverParenthesizedExpressionAndArrowParameterListによってcoverされるArrowFormalParametersとする。
  2. formalsBoundNamesを返す。
GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
  1. BindingIdentifierBoundNamesを返す。
GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
  1. « "*default*" »を返す。
AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
  1. BindingIdentifierBoundNamesを返す。
AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
  1. « "*default*" »を返す。
ClassDeclaration : class BindingIdentifier ClassTail
  1. BindingIdentifierBoundNamesを返す。
ClassDeclaration : class ClassTail
  1. « "*default*" »を返す。
AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
  1. BindingIdentifierBoundNamesを返す。
AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
  1. « "*default*" »を返す。
CoverCallExpressionAndAsyncArrowHead : MemberExpression Arguments
  1. headを、CoverCallExpressionAndAsyncArrowHeadによってcoverされるAsyncArrowHeadとする。
  2. headBoundNamesを返す。
ImportDeclaration : import ImportClause FromClause WithClauseopt ;
  1. ImportClauseBoundNamesを返す。
ImportDeclaration : import ModuleSpecifier WithClauseopt ;
  1. 新しい空のListを返す。
ImportClause : ImportedDefaultBinding , NameSpaceImport
  1. names1ImportedDefaultBindingBoundNamesとする。
  2. names2NameSpaceImportBoundNamesとする。
  3. names1names2list-concatenationを返す。
ImportClause : ImportedDefaultBinding , NamedImports
  1. names1ImportedDefaultBindingBoundNamesとする。
  2. names2NamedImportsBoundNamesとする。
  3. names1names2list-concatenationを返す。
NamedImports : { }
  1. 新しい空のListを返す。
ImportsList : ImportsList , ImportSpecifier
  1. names1ImportsListBoundNamesとする。
  2. names2ImportSpecifierBoundNamesとする。
  3. names1names2list-concatenationを返す。
ImportSpecifier : ModuleExportName as ImportedBinding
  1. ImportedBindingBoundNamesを返す。
ExportDeclaration : export ExportFromClause FromClause WithClauseopt ; export NamedExports ;
  1. 新しい空のListを返す。
ExportDeclaration : export VariableStatement
  1. VariableStatementBoundNamesを返す。
ExportDeclaration : export Declaration
  1. DeclarationBoundNamesを返す。
ExportDeclaration : export default HoistableDeclaration
  1. declNamesHoistableDeclarationBoundNamesとする。
  2. declNamesが要素"*default*"を含まないなら、"*default*"declNamesへappendする。
  3. declNamesを返す。
ExportDeclaration : export default ClassDeclaration
  1. declNamesClassDeclarationBoundNamesとする。
  2. declNamesが要素"*default*"を含まないなら、"*default*"declNamesへappendする。
  3. declNamesを返す。
ExportDeclaration : export default AssignmentExpression ;
  1. « "*default*" »を返す。

8.2.2 Static Semantics: DeclarationPart

The syntax-directed operation DeclarationPart takes no arguments and returns a Parse Node. 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 Static Semantics: IsConstantDeclaration

The syntax-directed operation IsConstantDeclaration takes no arguments and returns a Boolean. It is defined piecewise over the following productions:

LexicalDeclaration : LetOrConst BindingList ;
  1. LetOrConstIsConstantDeclarationを返す。
LetOrConst : let
  1. falseを返す。
LetOrConst : const
  1. true を返す。
UsingDeclaration : using BindingList ; AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
  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をconstant declarationとして扱う必要はありません。なぜなら、moduleのdefault objectを参照するために使用される内部束縛名への代入を許可する構文は存在しないからです。

8.2.4 Static Semantics: IsUsingDeclaration

The syntax-directed operation IsUsingDeclaration takes no arguments and returns Boolean. It is defined piecewise over the following productions:

LexicalDeclaration : LetOrConst BindingList ;
  1. false を返す。
UsingDeclaration : using BindingList ; AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
  1. true を返す。
ForDeclaration : LetOrConst ForBinding
  1. false を返す。
ForDeclaration : using ForBinding await using ForBinding
  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 を返す。

8.2.5 Static Semantics: IsAwaitUsingDeclaration

The syntax-directed operation IsAwaitUsingDeclaration takes no arguments and returns Boolean. It is defined piecewise over the following productions:

LexicalDeclaration : LetOrConst BindingList ;
  1. false を返す。
UsingDeclaration : using BindingList ;
  1. false を返す。
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
  1. true を返す。
ForDeclaration : LetOrConst ForBinding
  1. false を返す。
ForDeclaration : using ForBinding
  1. false を返す。
ForDeclaration : await using ForBinding
  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 を返す。

8.2.6 Static Semantics: LexicallyDeclaredNames

The syntax-directed operation LexicallyDeclaredNames takes no arguments and returns a List of Strings. It is defined piecewise over the following productions:

Block : { }
  1. 新しい空のListを返す。
StatementList : StatementList StatementListItem
  1. names1StatementListLexicallyDeclaredNamesとする。
  2. names2StatementListItemLexicallyDeclaredNamesとする。
  3. names1names2list-concatenationを返す。
StatementListItem : Statement
  1. Statement Statement : LabelledStatement であるなら、LabelledStatementLexicallyDeclaredNamesを返す。
  2. 新しい空のListを返す。
StatementListItem : Declaration
  1. DeclarationBoundNamesを返す。
CaseBlock : { }
  1. 新しい空のListを返す。
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 最初のCaseClausesが存在するなら、names1を最初のCaseClausesLexicallyDeclaredNamesとする。
  2. そうでなければ、names1を新しい空のListとする。
  3. names2DefaultClauseLexicallyDeclaredNamesとする。
  4. 2番目のCaseClausesが存在するなら、names3を2番目のCaseClausesLexicallyDeclaredNamesとする。
  5. そうでなければ、names3を新しい空のListとする。
  6. names1names2、およびnames3list-concatenationを返す。
CaseClauses : CaseClauses CaseClause
  1. names1CaseClausesLexicallyDeclaredNamesとする。
  2. names2CaseClauseLexicallyDeclaredNamesとする。
  3. names1names2list-concatenationを返す。
CaseClause : case Expression : StatementListopt
  1. StatementListが存在するなら、StatementListLexicallyDeclaredNamesを返す。
  2. 新しい空のListを返す。
DefaultClause : default : StatementListopt
  1. StatementListが存在するなら、StatementListLexicallyDeclaredNamesを返す。
  2. 新しい空のListを返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItemLexicallyDeclaredNamesを返す。
LabelledItem : Statement
  1. 新しい空のListを返す。
LabelledItem : FunctionDeclaration
  1. FunctionDeclarationBoundNamesを返す。
FunctionStatementList : [empty]
  1. 新しい空のListを返す。
FunctionStatementList : StatementList
  1. StatementListTopLevelLexicallyDeclaredNamesを返す。
ClassStaticBlockStatementList : [empty]
  1. 新しい空のListを返す。
ClassStaticBlockStatementList : StatementList
  1. StatementListTopLevelLexicallyDeclaredNamesを返す。
ConciseBody : ExpressionBody
  1. 新しい空のListを返す。
AsyncConciseBody : ExpressionBody
  1. 新しい空のListを返す。
Script : [empty]
  1. 新しい空のListを返す。
ScriptBody : StatementList
  1. StatementListTopLevelLexicallyDeclaredNamesを返す。
Note 1

Scriptのtop levelでは、function declarationsはlexical declarationsのようにではなく、var declarationsのように扱われます。

Note 2

ModuleのLexicallyDeclaredNamesには、そのすべてのimported bindingsの名前が含まれます。

ModuleItemList : ModuleItemList ModuleItem
  1. names1ModuleItemListLexicallyDeclaredNamesとする。
  2. names2ModuleItemLexicallyDeclaredNamesとする。
  3. names1names2list-concatenationを返す。
ModuleItem : ImportDeclaration
  1. ImportDeclarationBoundNamesを返す。
ModuleItem : ExportDeclaration
  1. ExportDeclarationexport VariableStatementであるなら、新しい空のListを返す。
  2. ExportDeclarationBoundNamesを返す。
ModuleItem : StatementListItem
  1. StatementListItemLexicallyDeclaredNamesを返す。
Note 3

Moduleのtop levelでは、function declarationsはvar declarationsのようにではなく、lexical declarationsのように扱われます。

8.2.7 Static Semantics: LexicallyScopedDeclarations

The syntax-directed operation LexicallyScopedDeclarations takes no arguments and returns a List of Parse Nodes. It is defined piecewise over the following productions:

StatementList : StatementList StatementListItem
  1. decls1StatementListLexicallyScopedDeclarationsとする。
  2. decls2StatementListItemLexicallyScopedDeclarationsとする。
  3. decls1decls2list-concatenationを返す。
StatementListItem : Statement
  1. Statement Statement : LabelledStatement であるなら、LabelledStatementLexicallyScopedDeclarationsを返す。
  2. 新しい空のListを返す。
StatementListItem : Declaration
  1. 唯一の要素がDeclarationDeclarationPartであるListを返す。
CaseBlock : { }
  1. 新しい空のListを返す。
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 最初のCaseClausesが存在するなら、decls1を最初のCaseClausesLexicallyScopedDeclarationsとする。
  2. そうでなければ、decls1を新しい空のListとする。
  3. decls2DefaultClauseLexicallyScopedDeclarationsとする。
  4. 2番目のCaseClausesが存在するなら、decls3を2番目のCaseClausesLexicallyScopedDeclarationsとする。
  5. そうでなければ、decls3を新しい空のListとする。
  6. decls1decls2、およびdecls3list-concatenationを返す。
CaseClauses : CaseClauses CaseClause
  1. decls1CaseClausesLexicallyScopedDeclarationsとする。
  2. decls2CaseClauseLexicallyScopedDeclarationsとする。
  3. decls1decls2list-concatenationを返す。
CaseClause : case Expression : StatementListopt
  1. StatementListが存在するなら、StatementListLexicallyScopedDeclarationsを返す。
  2. 新しい空のListを返す。
DefaultClause : default : StatementListopt
  1. StatementListが存在するなら、StatementListLexicallyScopedDeclarationsを返す。
  2. 新しい空のListを返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItemLexicallyScopedDeclarationsを返す。
LabelledItem : Statement
  1. 新しい空のListを返す。
LabelledItem : FunctionDeclaration
  1. « FunctionDeclaration »を返す。
FunctionStatementList : [empty]
  1. 新しい空のListを返す。
FunctionStatementList : StatementList
  1. StatementListTopLevelLexicallyScopedDeclarationsを返す。
ClassStaticBlockStatementList : [empty]
  1. 新しい空のListを返す。
ClassStaticBlockStatementList : StatementList
  1. StatementListTopLevelLexicallyScopedDeclarationsを返す。
ConciseBody : ExpressionBody
  1. 新しい空のListを返す。
AsyncConciseBody : ExpressionBody
  1. 新しい空のListを返す。
Script : [empty]
  1. 新しい空のListを返す。
ScriptBody : StatementList
  1. StatementListTopLevelLexicallyScopedDeclarationsを返す。
Module : [empty]
  1. 新しい空のListを返す。
ModuleItemList : ModuleItemList ModuleItem
  1. decls1ModuleItemListLexicallyScopedDeclarationsとする。
  2. decls2ModuleItemLexicallyScopedDeclarationsとする。
  3. decls1decls2list-concatenationを返す。
ModuleItem : ImportDeclaration
  1. 新しい空のListを返す。
ExportDeclaration : export ExportFromClause FromClause WithClauseopt ; export NamedExports ; export VariableStatement
  1. 新しい空のListを返す。
ExportDeclaration : export Declaration
  1. 唯一の要素がDeclarationDeclarationPartであるListを返す。
ExportDeclaration : export default HoistableDeclaration
  1. 唯一の要素がHoistableDeclarationDeclarationPartであるListを返す。
ExportDeclaration : export default ClassDeclaration
  1. 唯一の要素がClassDeclarationであるListを返す。
ExportDeclaration : export default AssignmentExpression ;
  1. 唯一の要素がこのExportDeclarationであるListを返す。

8.2.8 Static Semantics: VarDeclaredNames

The syntax-directed operation VarDeclaredNames takes no arguments and returns a List of Strings. 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. names1StatementListVarDeclaredNamesとする。
  2. names2StatementListItemVarDeclaredNamesとする。
  3. names1names2list-concatenationを返す。
StatementListItem : Declaration
  1. 新しい空のListを返す。
VariableStatement : var VariableDeclarationList ;
  1. VariableDeclarationListBoundNamesを返す。
IfStatement : if ( Expression ) Statement else Statement
  1. names1を最初のStatementVarDeclaredNamesとする。
  2. names2を2番目のStatementVarDeclaredNamesとする。
  3. names1names2list-concatenationを返す。
IfStatement : if ( Expression ) Statement
  1. StatementVarDeclaredNamesを返す。
DoWhileStatement : do Statement while ( Expression ) ;
  1. StatementVarDeclaredNamesを返す。
WhileStatement : while ( Expression ) Statement
  1. StatementVarDeclaredNamesを返す。
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement
  1. StatementVarDeclaredNamesを返す。
ForStatement : for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement
  1. names1VariableDeclarationListBoundNamesとする。
  2. names2StatementVarDeclaredNamesとする。
  3. names1names2list-concatenationを返す。
ForStatement : for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. StatementVarDeclaredNamesを返す。
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. StatementVarDeclaredNamesを返す。
ForInOfStatement : for ( var ForBinding in Expression ) Statement for ( var ForBinding of AssignmentExpression ) Statement for await ( var ForBinding of AssignmentExpression ) Statement
  1. names1ForBindingBoundNamesとする。
  2. names2StatementVarDeclaredNamesとする。
  3. names1names2list-concatenationを返す。
Note

この節はAnnex B.3.5によって拡張されます。

WithStatement : with ( Expression ) Statement
  1. StatementVarDeclaredNamesを返す。
SwitchStatement : switch ( Expression ) CaseBlock
  1. CaseBlockVarDeclaredNamesを返す。
CaseBlock : { }
  1. 新しい空のListを返す。
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 最初のCaseClausesが存在するなら、names1を最初のCaseClausesVarDeclaredNamesとする。
  2. そうでなければ、names1を新しい空のListとする。
  3. names2DefaultClauseVarDeclaredNamesとする。
  4. 2番目のCaseClausesが存在するなら、names3を2番目のCaseClausesVarDeclaredNamesとする。
  5. そうでなければ、names3を新しい空のListとする。
  6. names1names2、およびnames3list-concatenationを返す。
CaseClauses : CaseClauses CaseClause
  1. names1CaseClausesVarDeclaredNamesとする。
  2. names2CaseClauseVarDeclaredNamesとする。
  3. names1names2list-concatenationを返す。
CaseClause : case Expression : StatementListopt
  1. StatementListが存在するなら、StatementListVarDeclaredNamesを返す。
  2. 新しい空のListを返す。
DefaultClause : default : StatementListopt
  1. StatementListが存在するなら、StatementListVarDeclaredNamesを返す。
  2. 新しい空のListを返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItemVarDeclaredNamesを返す。
LabelledItem : FunctionDeclaration
  1. 新しい空のListを返す。
TryStatement : try Block Catch
  1. names1BlockVarDeclaredNamesとする。
  2. names2CatchVarDeclaredNamesとする。
  3. names1names2list-concatenationを返す。
TryStatement : try Block Finally
  1. names1BlockVarDeclaredNamesとする。
  2. names2FinallyVarDeclaredNamesとする。
  3. names1names2list-concatenationを返す。
TryStatement : try Block Catch Finally
  1. names1BlockVarDeclaredNamesとする。
  2. names2CatchVarDeclaredNamesとする。
  3. names3FinallyVarDeclaredNamesとする。
  4. names1names2、およびnames3list-concatenationを返す。
Catch : catch ( CatchParameter ) Block
  1. BlockVarDeclaredNamesを返す。
FunctionStatementList : [empty]
  1. 新しい空のListを返す。
FunctionStatementList : StatementList
  1. StatementListTopLevelVarDeclaredNamesを返す。
ClassStaticBlockStatementList : [empty]
  1. 新しい空のListを返す。
ClassStaticBlockStatementList : StatementList
  1. StatementListTopLevelVarDeclaredNamesを返す。
ConciseBody : ExpressionBody
  1. 新しい空のListを返す。
AsyncConciseBody : ExpressionBody
  1. 新しい空のListを返す。
Script : [empty]
  1. 新しい空のListを返す。
ScriptBody : StatementList
  1. StatementListTopLevelVarDeclaredNamesを返す。
ModuleItemList : ModuleItemList ModuleItem
  1. names1ModuleItemListVarDeclaredNamesとする。
  2. names2ModuleItemVarDeclaredNamesとする。
  3. names1names2list-concatenationを返す。
ModuleItem : ImportDeclaration
  1. 新しい空のListを返す。
ModuleItem : ExportDeclaration
  1. ExportDeclarationexport VariableStatementであるなら、ExportDeclarationBoundNamesを返す。
  2. 新しい空のListを返す。

8.2.9 Static Semantics: VarScopedDeclarations

The syntax-directed operation VarScopedDeclarations takes no arguments and returns a List of Parse Nodes. 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. decls1StatementListVarScopedDeclarationsとする。
  2. decls2StatementListItemVarScopedDeclarationsとする。
  3. decls1decls2list-concatenationを返す。
StatementListItem : Declaration
  1. 新しい空のListを返す。
VariableDeclarationList : VariableDeclaration
  1. « VariableDeclaration »を返す。
VariableDeclarationList : VariableDeclarationList , VariableDeclaration
  1. decls1VariableDeclarationListVarScopedDeclarationsとする。
  2. decls1と« VariableDeclaration »のlist-concatenationを返す。
IfStatement : if ( Expression ) Statement else Statement
  1. decls1を最初のStatementVarScopedDeclarationsとする。
  2. decls2を2番目のStatementVarScopedDeclarationsとする。
  3. decls1decls2list-concatenationを返す。
IfStatement : if ( Expression ) Statement
  1. StatementVarScopedDeclarationsを返す。
DoWhileStatement : do Statement while ( Expression ) ;
  1. StatementVarScopedDeclarationsを返す。
WhileStatement : while ( Expression ) Statement
  1. StatementVarScopedDeclarationsを返す。
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement
  1. StatementVarScopedDeclarationsを返す。
ForStatement : for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement
  1. decls1VariableDeclarationListVarScopedDeclarationsとする。
  2. decls2StatementVarScopedDeclarationsとする。
  3. decls1decls2list-concatenationを返す。
ForStatement : for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. StatementVarScopedDeclarationsを返す。
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. StatementVarScopedDeclarationsを返す。
ForInOfStatement : for ( var ForBinding in Expression ) Statement for ( var ForBinding of AssignmentExpression ) Statement for await ( var ForBinding of AssignmentExpression ) Statement
  1. decls1を« ForBinding »とする。
  2. decls2StatementVarScopedDeclarationsとする。
  3. decls1decls2list-concatenationを返す。
Note

この節はAnnex B.3.5によって拡張されます。

WithStatement : with ( Expression ) Statement
  1. StatementVarScopedDeclarationsを返す。
SwitchStatement : switch ( Expression ) CaseBlock
  1. CaseBlockVarScopedDeclarationsを返す。
CaseBlock : { }
  1. 新しい空のListを返す。
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 最初のCaseClausesが存在するなら、decls1を最初のCaseClausesVarScopedDeclarationsとする。
  2. そうでなければ、decls1を新しい空のListとする。
  3. decls2DefaultClauseVarScopedDeclarationsとする。
  4. 2番目のCaseClausesが存在するなら、decls3を2番目のCaseClausesVarScopedDeclarationsとする。
  5. そうでなければ、decls3を新しい空のListとする。
  6. decls1decls2、およびdecls3list-concatenationを返す。
CaseClauses : CaseClauses CaseClause
  1. decls1CaseClausesVarScopedDeclarationsとする。
  2. decls2CaseClauseVarScopedDeclarationsとする。
  3. decls1decls2list-concatenationを返す。
CaseClause : case Expression : StatementListopt
  1. StatementListが存在するなら、StatementListVarScopedDeclarationsを返す。
  2. 新しい空のListを返す。
DefaultClause : default : StatementListopt
  1. StatementListが存在するなら、StatementListVarScopedDeclarationsを返す。
  2. 新しい空のListを返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItemVarScopedDeclarationsを返す。
LabelledItem : FunctionDeclaration
  1. 新しい空のListを返す。
TryStatement : try Block Catch
  1. decls1BlockVarScopedDeclarationsとする。
  2. decls2CatchVarScopedDeclarationsとする。
  3. decls1decls2list-concatenationを返す。
TryStatement : try Block Finally
  1. decls1BlockVarScopedDeclarationsとする。
  2. decls2FinallyVarScopedDeclarationsとする。
  3. decls1decls2list-concatenationを返す。
TryStatement : try Block Catch Finally
  1. decls1BlockVarScopedDeclarationsとする。
  2. decls2CatchVarScopedDeclarationsとする。
  3. decls3FinallyVarScopedDeclarationsとする。
  4. decls1decls2、およびdecls3list-concatenationを返す。
Catch : catch ( CatchParameter ) Block
  1. BlockVarScopedDeclarationsを返す。
FunctionStatementList : [empty]
  1. 新しい空のListを返す。
FunctionStatementList : StatementList
  1. StatementListTopLevelVarScopedDeclarationsを返す。
ClassStaticBlockStatementList : [empty]
  1. 新しい空のListを返す。
ClassStaticBlockStatementList : StatementList
  1. StatementListTopLevelVarScopedDeclarationsを返す。
ConciseBody : ExpressionBody
  1. 新しい空のListを返す。
AsyncConciseBody : ExpressionBody
  1. 新しい空のListを返す。
Script : [empty]
  1. 新しい空のListを返す。
ScriptBody : StatementList
  1. StatementListTopLevelVarScopedDeclarationsを返す。
Module : [empty]
  1. 新しい空のListを返す。
ModuleItemList : ModuleItemList ModuleItem
  1. decls1ModuleItemListVarScopedDeclarationsとする。
  2. decls2ModuleItemVarScopedDeclarationsとする。
  3. decls1decls2list-concatenationを返す。
ModuleItem : ImportDeclaration
  1. 新しい空のListを返す。
ExportDeclaration : export ExportFromClause FromClause WithClauseopt ; export NamedExports ; export VariableStatement
  1. 新しい空のListを返す。
ExportDeclaration : export Declaration
  1. 唯一の要素がDeclarationDeclarationPartであるListを返す。
ExportDeclaration : export default HoistableDeclaration
  1. 唯一の要素がHoistableDeclarationDeclarationPartであるListを返す。
ExportDeclaration : export default ClassDeclaration
  1. 唯一の要素がClassDeclarationであるListを返す。
ExportDeclaration : export default AssignmentExpression ;
  1. 唯一の要素がこのExportDeclarationであるListを返す。

8.2.10 Static Semantics: TopLevelLexicallyDeclaredNames

The syntax-directed operation TopLevelLexicallyDeclaredNames takes no arguments and returns a List of Strings. It is defined piecewise over the following productions:

StatementList : StatementList StatementListItem
  1. names1StatementListTopLevelLexicallyDeclaredNamesとする。
  2. names2StatementListItemTopLevelLexicallyDeclaredNamesとする。
  3. names1names2list-concatenationを返す。
StatementListItem : Statement
  1. 新しい空のListを返す。
StatementListItem : Declaration
  1. Declaration Declaration : HoistableDeclaration であるなら、
    1. 新しい空のListを返す。
  2. DeclarationBoundNamesを返す。
Note

functionまたはscriptのtop levelでは、function declarationsはlexical declarationsのようにではなく、var declarationsのように扱われます。

8.2.11 Static Semantics: TopLevelLexicallyScopedDeclarations

The syntax-directed operation TopLevelLexicallyScopedDeclarations takes no arguments and returns a List of Parse Nodes. It is defined piecewise over the following productions:

StatementList : StatementList StatementListItem
  1. decls1StatementListTopLevelLexicallyScopedDeclarationsとする。
  2. decls2StatementListItemTopLevelLexicallyScopedDeclarationsとする。
  3. decls1decls2list-concatenationを返す。
StatementListItem : Statement
  1. 新しい空のListを返す。
StatementListItem : Declaration
  1. Declaration Declaration : HoistableDeclaration であるなら、
    1. 新しい空のListを返す。
  2. « Declaration »を返す。

8.2.12 Static Semantics: TopLevelVarDeclaredNames

The syntax-directed operation TopLevelVarDeclaredNames takes no arguments and returns a List of Strings. It is defined piecewise over the following productions:

StatementList : StatementList StatementListItem
  1. names1StatementListTopLevelVarDeclaredNamesとする。
  2. names2StatementListItemTopLevelVarDeclaredNamesとする。
  3. names1names2list-concatenationを返す。
StatementListItem : Declaration
  1. Declaration Declaration : HoistableDeclaration であるなら、
    1. HoistableDeclarationBoundNamesを返す。
  2. 新しい空のListを返す。
StatementListItem : Statement
  1. Statement Statement : LabelledStatement であるなら、StatementTopLevelVarDeclaredNamesを返す。
  2. StatementVarDeclaredNamesを返す。
Note

functionまたはscriptのtop levelでは、inner function declarationsはvar declarationsのように扱われます。

LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItemTopLevelVarDeclaredNamesを返す。
LabelledItem : Statement
  1. Statement Statement : LabelledStatement であるなら、StatementTopLevelVarDeclaredNamesを返す。
  2. StatementVarDeclaredNamesを返す。
LabelledItem : FunctionDeclaration
  1. FunctionDeclarationBoundNamesを返す。

8.2.13 Static Semantics: TopLevelVarScopedDeclarations

The syntax-directed operation TopLevelVarScopedDeclarations takes no arguments and returns a List of Parse Nodes. It is defined piecewise over the following productions:

StatementList : StatementList StatementListItem
  1. decls1StatementListTopLevelVarScopedDeclarationsとする。
  2. decls2StatementListItemTopLevelVarScopedDeclarationsとする。
  3. decls1decls2list-concatenationを返す。
StatementListItem : Statement
  1. Statement Statement : LabelledStatement であるなら、StatementTopLevelVarScopedDeclarationsを返す。
  2. StatementVarScopedDeclarationsを返す。
StatementListItem : Declaration
  1. Declaration Declaration : HoistableDeclaration であるなら、
    1. declHoistableDeclarationDeclarationPartとする。
    2. « decl »を返す。
  2. 新しい空のListを返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItemTopLevelVarScopedDeclarationsを返す。
LabelledItem : Statement
  1. Statement Statement : LabelledStatement であるなら、StatementTopLevelVarScopedDeclarationsを返す。
  2. StatementVarScopedDeclarationsを返す。
LabelledItem : FunctionDeclaration
  1. « FunctionDeclaration »を返す。

8.3 ラベル

8.3.1 Static Semantics: ContainsDuplicateLabels

The syntax-directed operation ContainsDuplicateLabels takes argument labelSet (a List of Strings) and returns a Boolean. 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. hasDuplicatesを、引数labelSetを伴うStatementListContainsDuplicateLabelsとする。
  2. hasDuplicatestrueなら、trueを返す。
  3. 引数labelSetを伴うStatementListItemContainsDuplicateLabelsを返す。
IfStatement : if ( Expression ) Statement else Statement
  1. hasDuplicateを、引数labelSetを伴う最初のStatementContainsDuplicateLabelsとする。
  2. hasDuplicatetrueなら、trueを返す。
  3. 引数labelSetを伴う2番目のStatementContainsDuplicateLabelsを返す。
IfStatement : if ( Expression ) Statement
  1. 引数labelSetを伴うStatementContainsDuplicateLabelsを返す。
DoWhileStatement : do Statement while ( Expression ) ;
  1. 引数labelSetを伴うStatementContainsDuplicateLabelsを返す。
WhileStatement : while ( Expression ) Statement
  1. 引数labelSetを伴うStatementContainsDuplicateLabelsを返す。
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. 引数labelSetを伴うStatementContainsDuplicateLabelsを返す。
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. 引数labelSetを伴うStatementContainsDuplicateLabelsを返す。
Note

この節はAnnex B.3.5によって拡張されます。

WithStatement : with ( Expression ) Statement
  1. 引数labelSetを伴うStatementContainsDuplicateLabelsを返す。
SwitchStatement : switch ( Expression ) CaseBlock
  1. 引数labelSetを伴うCaseBlockContainsDuplicateLabelsを返す。
CaseBlock : { }
  1. falseを返す。
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 最初のCaseClausesが存在するなら、
    1. 引数labelSetを伴う最初のCaseClausesContainsDuplicateLabelstrueなら、trueを返す。
  2. 引数labelSetを伴うDefaultClauseContainsDuplicateLabelstrueなら、trueを返す。
  3. 2番目のCaseClausesが存在しないなら、falseを返す。
  4. 引数labelSetを伴う2番目のCaseClausesContainsDuplicateLabelsを返す。
CaseClauses : CaseClauses CaseClause
  1. hasDuplicatesを、引数labelSetを伴うCaseClausesContainsDuplicateLabelsとする。
  2. hasDuplicatestrueなら、trueを返す。
  3. 引数labelSetを伴うCaseClauseContainsDuplicateLabelsを返す。
CaseClause : case Expression : StatementListopt
  1. StatementListが存在するなら、引数labelSetを伴うStatementListContainsDuplicateLabelsを返す。
  2. falseを返す。
DefaultClause : default : StatementListopt
  1. StatementListが存在するなら、引数labelSetを伴うStatementListContainsDuplicateLabelsを返す。
  2. falseを返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. labelLabelIdentifierStringValueとする。
  2. labelSetlabelを含むなら、trueを返す。
  3. newLabelSetlabelSetと« label »のlist-concatenationとする。
  4. 引数newLabelSetを伴うLabelledItemContainsDuplicateLabelsを返す。
LabelledItem : FunctionDeclaration
  1. falseを返す。
TryStatement : try Block Catch
  1. hasDuplicatesを、引数labelSetを伴うBlockContainsDuplicateLabelsとする。
  2. hasDuplicatestrueなら、trueを返す。
  3. 引数labelSetを伴うCatchContainsDuplicateLabelsを返す。
TryStatement : try Block Finally
  1. hasDuplicatesを、引数labelSetを伴うBlockContainsDuplicateLabelsとする。
  2. hasDuplicatestrueなら、trueを返す。
  3. 引数labelSetを伴うFinallyContainsDuplicateLabelsを返す。
TryStatement : try Block Catch Finally
  1. 引数labelSetを伴うBlockContainsDuplicateLabelstrueなら、trueを返す。
  2. 引数labelSetを伴うCatchContainsDuplicateLabelstrueなら、trueを返す。
  3. 引数labelSetを伴うFinallyContainsDuplicateLabelsを返す。
Catch : catch ( CatchParameter ) Block
  1. 引数labelSetを伴うBlockContainsDuplicateLabelsを返す。
FunctionStatementList : [empty]
  1. falseを返す。
ClassStaticBlockStatementList : [empty]
  1. falseを返す。
ModuleItemList : ModuleItemList ModuleItem
  1. hasDuplicatesを、引数labelSetを伴うModuleItemListContainsDuplicateLabelsとする。
  2. hasDuplicatestrueなら、trueを返す。
  3. 引数labelSetを伴うModuleItemContainsDuplicateLabelsを返す。
ModuleItem : ImportDeclaration ExportDeclaration
  1. falseを返す。

8.3.2 Static Semantics: ContainsUndefinedBreakTarget

The syntax-directed operation ContainsUndefinedBreakTarget takes argument labelSet (a List of Strings) and returns a Boolean. 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. hasUndefinedLabelsを、引数labelSetを伴うStatementListContainsUndefinedBreakTargetとする。
  2. hasUndefinedLabelstrueなら、trueを返す。
  3. 引数labelSetを伴うStatementListItemContainsUndefinedBreakTargetを返す。
IfStatement : if ( Expression ) Statement else Statement
  1. hasUndefinedLabelsを、引数labelSetを伴う最初のStatementContainsUndefinedBreakTargetとする。
  2. hasUndefinedLabelstrueなら、trueを返す。
  3. 引数labelSetを伴う2番目のStatementContainsUndefinedBreakTargetを返す。
IfStatement : if ( Expression ) Statement
  1. 引数labelSetを伴うStatementContainsUndefinedBreakTargetを返す。
DoWhileStatement : do Statement while ( Expression ) ;
  1. 引数labelSetを伴うStatementContainsUndefinedBreakTargetを返す。
WhileStatement : while ( Expression ) Statement
  1. 引数labelSetを伴うStatementContainsUndefinedBreakTargetを返す。
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. 引数labelSetを伴うStatementContainsUndefinedBreakTargetを返す。
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. 引数labelSetを伴うStatementContainsUndefinedBreakTargetを返す。
Note

この節はAnnex B.3.5によって拡張されます。

BreakStatement : break ;
  1. falseを返す。
BreakStatement : break LabelIdentifier ;
  1. labelSetLabelIdentifierStringValueを含むなら、falseを返す。
  2. trueを返す。
WithStatement : with ( Expression ) Statement
  1. 引数labelSetを伴うStatementContainsUndefinedBreakTargetを返す。
SwitchStatement : switch ( Expression ) CaseBlock
  1. 引数labelSetを伴うCaseBlockContainsUndefinedBreakTargetを返す。
CaseBlock : { }
  1. falseを返す。
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 最初のCaseClausesが存在するなら、
    1. 引数labelSetを伴う最初のCaseClausesContainsUndefinedBreakTargettrueなら、trueを返す。
  2. 引数labelSetを伴うDefaultClauseContainsUndefinedBreakTargettrueなら、trueを返す。
  3. 2番目のCaseClausesが存在しないなら、falseを返す。
  4. 引数labelSetを伴う2番目のCaseClausesContainsUndefinedBreakTargetを返す。
CaseClauses : CaseClauses CaseClause
  1. hasUndefinedLabelsを、引数labelSetを伴うCaseClausesContainsUndefinedBreakTargetとする。
  2. hasUndefinedLabelstrueなら、trueを返す。
  3. 引数labelSetを伴うCaseClauseContainsUndefinedBreakTargetを返す。
CaseClause : case Expression : StatementListopt
  1. StatementListが存在するなら、引数labelSetを伴うStatementListContainsUndefinedBreakTargetを返す。
  2. falseを返す。
DefaultClause : default : StatementListopt
  1. StatementListが存在するなら、引数labelSetを伴うStatementListContainsUndefinedBreakTargetを返す。
  2. falseを返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. labelLabelIdentifierStringValueとする。
  2. newLabelSetlabelSetと« label »のlist-concatenationとする。
  3. 引数newLabelSetを伴うLabelledItemContainsUndefinedBreakTargetを返す。
LabelledItem : FunctionDeclaration
  1. falseを返す。
TryStatement : try Block Catch
  1. hasUndefinedLabelsを、引数labelSetを伴うBlockContainsUndefinedBreakTargetとする。
  2. hasUndefinedLabelstrueなら、trueを返す。
  3. 引数labelSetを伴うCatchContainsUndefinedBreakTargetを返す。
TryStatement : try Block Finally
  1. hasUndefinedLabelsを、引数labelSetを伴うBlockContainsUndefinedBreakTargetとする。
  2. hasUndefinedLabelstrueなら、trueを返す。
  3. 引数labelSetを伴うFinallyContainsUndefinedBreakTargetを返す。
TryStatement : try Block Catch Finally
  1. 引数labelSetを伴うBlockContainsUndefinedBreakTargettrueなら、trueを返す。
  2. 引数labelSetを伴うCatchContainsUndefinedBreakTargettrueなら、trueを返す。
  3. 引数labelSetを伴うFinallyContainsUndefinedBreakTargetを返す。
Catch : catch ( CatchParameter ) Block
  1. 引数labelSetを伴うBlockContainsUndefinedBreakTargetを返す。
FunctionStatementList : [empty]
  1. falseを返す。
ClassStaticBlockStatementList : [empty]
  1. falseを返す。
ModuleItemList : ModuleItemList ModuleItem
  1. hasUndefinedLabelsを、引数labelSetを伴うModuleItemListContainsUndefinedBreakTargetとする。
  2. hasUndefinedLabelstrueなら、trueを返す。
  3. 引数labelSetを伴うModuleItemContainsUndefinedBreakTargetを返す。
ModuleItem : ImportDeclaration ExportDeclaration
  1. falseを返す。

8.3.3 Static Semantics: ContainsUndefinedContinueTarget

The syntax-directed operation ContainsUndefinedContinueTarget takes arguments iterationSet (a List of Strings) and labelSet (a List of Strings) and returns a Boolean. It is defined piecewise over the following productions:

Statement : VariableStatement EmptyStatement ExpressionStatement BreakStatement ReturnStatement ThrowStatement DebuggerStatement Block : { } StatementListItem : Declaration
  1. falseを返す。
Statement : BlockStatement
  1. 引数iterationSetおよび« »を伴うBlockStatementContainsUndefinedContinueTargetを返す。
BreakableStatement : IterationStatement
  1. newIterationSetiterationSetlabelSetlist-concatenationとする。
  2. 引数newIterationSetおよび« »を伴うIterationStatementContainsUndefinedContinueTargetを返す。
StatementList : StatementList StatementListItem
  1. hasUndefinedLabelsを、引数iterationSetおよび« »を伴うStatementListContainsUndefinedContinueTargetとする。
  2. hasUndefinedLabelstrueなら、trueを返す。
  3. 引数iterationSetおよび« »を伴うStatementListItemContainsUndefinedContinueTargetを返す。
IfStatement : if ( Expression ) Statement else Statement
  1. hasUndefinedLabelsを、引数iterationSetおよび« »を伴う最初のStatementContainsUndefinedContinueTargetとする。
  2. hasUndefinedLabelstrueなら、trueを返す。
  3. 引数iterationSetおよび« »を伴う2番目のStatementContainsUndefinedContinueTargetを返す。
IfStatement : if ( Expression ) Statement
  1. 引数iterationSetおよび« »を伴うStatementContainsUndefinedContinueTargetを返す。
DoWhileStatement : do Statement while ( Expression ) ;
  1. 引数iterationSetおよび« »を伴うStatementContainsUndefinedContinueTargetを返す。
WhileStatement : while ( Expression ) Statement
  1. 引数iterationSetおよび« »を伴うStatementContainsUndefinedContinueTargetを返す。
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. 引数iterationSetおよび« »を伴うStatementContainsUndefinedContinueTargetを返す。
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. 引数iterationSetおよび« »を伴うStatementContainsUndefinedContinueTargetを返す。
Note

この節はAnnex B.3.5によって拡張されます。

ContinueStatement : continue ;
  1. falseを返す。
ContinueStatement : continue LabelIdentifier ;
  1. iterationSetLabelIdentifierStringValueを含むなら、falseを返す。
  2. trueを返す。
WithStatement : with ( Expression ) Statement
  1. 引数iterationSetおよび« »を伴うStatementContainsUndefinedContinueTargetを返す。
SwitchStatement : switch ( Expression ) CaseBlock
  1. 引数iterationSetおよび« »を伴うCaseBlockContainsUndefinedContinueTargetを返す。
CaseBlock : { }
  1. falseを返す。
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 最初のCaseClausesが存在するなら、
    1. 引数iterationSetおよび« »を伴う最初のCaseClausesContainsUndefinedContinueTargettrueなら、trueを返す。
  2. 引数iterationSetおよび« »を伴うDefaultClauseContainsUndefinedContinueTargettrueなら、trueを返す。
  3. 2番目のCaseClausesが存在しないなら、falseを返す。
  4. 引数iterationSetおよび« »を伴う2番目のCaseClausesContainsUndefinedContinueTargetを返す。
CaseClauses : CaseClauses CaseClause
  1. hasUndefinedLabelsを、引数iterationSetおよび« »を伴うCaseClausesContainsUndefinedContinueTargetとする。
  2. hasUndefinedLabelstrueなら、trueを返す。
  3. 引数iterationSetおよび« »を伴うCaseClauseContainsUndefinedContinueTargetを返す。
CaseClause : case Expression : StatementListopt
  1. StatementListが存在するなら、引数iterationSetおよび« »を伴うStatementListContainsUndefinedContinueTargetを返す。
  2. falseを返す。
DefaultClause : default : StatementListopt
  1. StatementListが存在するなら、引数iterationSetおよび« »を伴うStatementListContainsUndefinedContinueTargetを返す。
  2. falseを返す。
LabelledStatement : LabelIdentifier : LabelledItem
  1. labelLabelIdentifierStringValueとする。
  2. newLabelSetlabelSetと« label »のlist-concatenationとする。
  3. 引数iterationSetおよびnewLabelSetを伴うLabelledItemContainsUndefinedContinueTargetを返す。
LabelledItem : FunctionDeclaration
  1. falseを返す。
TryStatement : try Block Catch
  1. hasUndefinedLabelsを、引数iterationSetおよび« »を伴うBlockContainsUndefinedContinueTargetとする。
  2. hasUndefinedLabelstrueなら、trueを返す。
  3. 引数iterationSetおよび« »を伴うCatchContainsUndefinedContinueTargetを返す。
TryStatement : try Block Finally
  1. hasUndefinedLabelsを、引数iterationSetおよび« »を伴うBlockContainsUndefinedContinueTargetとする。
  2. hasUndefinedLabelstrueなら、trueを返す。
  3. 引数iterationSetおよび« »を伴うFinallyContainsUndefinedContinueTargetを返す。
TryStatement : try Block Catch Finally
  1. 引数iterationSetおよび« »を伴うBlockContainsUndefinedContinueTargettrueなら、trueを返す。
  2. 引数iterationSetおよび« »を伴うCatchContainsUndefinedContinueTargettrueなら、trueを返す。
  3. 引数iterationSetおよび« »を伴うFinallyContainsUndefinedContinueTargetを返す。
Catch : catch ( CatchParameter ) Block
  1. 引数iterationSetおよび« »を伴うBlockContainsUndefinedContinueTargetを返す。
FunctionStatementList : [empty]
  1. falseを返す。
ClassStaticBlockStatementList : [empty]
  1. falseを返す。
ModuleItemList : ModuleItemList ModuleItem
  1. hasUndefinedLabelsを、引数iterationSetおよび« »を伴うModuleItemListContainsUndefinedContinueTargetとする。
  2. hasUndefinedLabelstrueなら、trueを返す。
  3. 引数iterationSetおよび« »を伴うModuleItemContainsUndefinedContinueTargetを返す。
ModuleItem : ImportDeclaration ExportDeclaration
  1. falseを返す。

8.4 関数名推論

8.4.1 Static Semantics: HasName

The syntax-directed operation HasName takes no arguments and returns a Boolean. It is defined piecewise over the following productions:

PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
  1. exprを、CoverParenthesizedExpressionAndArrowParameterListによってcoverされるParenthesizedExpressionとする。
  2. exprIsFunctionDefinitionfalseなら、falseを返す。
  3. exprHasNameを返す。
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 Static Semantics: IsFunctionDefinition

The syntax-directed operation IsFunctionDefinition takes no arguments and returns a Boolean. It is defined piecewise over the following productions:

PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
  1. exprを、CoverParenthesizedExpressionAndArrowParameterListによってcoverされるParenthesizedExpressionとする。
  2. exprIsFunctionDefinitionを返す。
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 CoverAwaitExpressionAndAwaitUsingDeclarationHead 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 Static Semantics: IsAnonymousFunctionDefinition ( expr )

The abstract operation IsAnonymousFunctionDefinition takes argument expr (an AssignmentExpression Parse Node, an Initializer Parse Node, or an Expression Parse Node) and returns a Boolean. これは、その引数が名前を束縛しない関数定義であるかどうかを決定します。 It performs the following steps when called:

  1. exprIsFunctionDefinitionfalseなら、falseを返す。
  2. hasNameexprHasNameとする。
  3. hasNametrueなら、falseを返す。
  4. trueを返す。

8.4.4 Static Semantics: IsIdentifierRef

The syntax-directed operation IsIdentifierRef takes no arguments and returns a Boolean. 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 Runtime Semantics: NamedEvaluation

The syntax-directed operation NamedEvaluation takes argument name (a property key or a Private Name) and returns either a normal completion containing a function object or an abrupt completion. It is defined piecewise over the following productions:

PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
  1. exprを、CoverParenthesizedExpressionAndArrowParameterListによってcoverされるParenthesizedExpressionとする。
  2. 引数nameを伴うexprNamedEvaluationを ? で返す。
ParenthesizedExpression : ( Expression )
  1. Assert: IsAnonymousFunctionDefinition(Expression)はtrueである。
  2. 引数nameを伴うExpressionNamedEvaluationを ? で返す。
FunctionExpression : function ( FormalParameters ) { FunctionBody }
  1. 引数nameを伴うFunctionExpressionInstantiateOrdinaryFunctionExpressionを返す。
GeneratorExpression : function * ( FormalParameters ) { GeneratorBody }
  1. 引数nameを伴うGeneratorExpressionInstantiateGeneratorFunctionExpressionを返す。
AsyncGeneratorExpression : async function * ( FormalParameters ) { AsyncGeneratorBody }
  1. 引数nameを伴うAsyncGeneratorExpressionInstantiateAsyncGeneratorFunctionExpressionを返す。
AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
  1. 引数nameを伴うAsyncFunctionExpressionInstantiateAsyncFunctionExpressionを返す。
ArrowFunction : ArrowParameters => ConciseBody
  1. 引数nameを伴うArrowFunctionInstantiateArrowFunctionExpressionを返す。
AsyncArrowFunction : async AsyncArrowBindingIdentifier => AsyncConciseBody CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
  1. 引数nameを伴うAsyncArrowFunctionInstantiateAsyncArrowFunctionExpressionを返す。
ClassExpression : class ClassTail
  1. sourceTextを、ClassExpressionに一致したsource textとする。
  2. 引数undefinedname、およびsourceTextを伴うClassTailClassDefinitionEvaluationを ? で返す。

8.5 Contains

8.5.1 Static Semantics: Contains

The syntax-directed operation Contains takes argument symbol (a grammar symbol) and returns a Boolean.

以下に列挙されていない、この仕様内のすべてのgrammar production alternativeは、暗黙的に次のContainsのデフォルト定義を持ちます:

  1. このParse Nodeの各child node childについて、以下を行う
    1. childsymbolのinstanceなら、trueを返す。
    2. childがnonterminalのinstanceなら、
      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を返す。
    2. falseを返す。
  3. ClassHeritageが存在するなら、
    1. ClassHeritage Contains symboltrueなら、trueを返す。
  4. 引数symbolを伴うClassBodyComputedPropertyContainsの結果を返す。
Note 2

部分構造に依存する静的意味規則は、PropertyNameを除いて、一般にclass bodiesの内部を見ません。

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

部分構造に依存する静的意味規則は、一般にstatic初期化ブロックの内部を見ません。

ArrowFunction : ArrowParameters => ConciseBody
  1. symbolNewTargetSuperPropertySuperCallsuper、またはthisのいずれでもないなら、falseを返す。
  2. ArrowParameters Contains symboltrueなら、trueを返す。
  3. ConciseBody Contains symbolを返す。
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
  1. formalsを、CoverParenthesizedExpressionAndArrowParameterListによってcoverされるArrowFormalParametersとする。
  2. formals Contains symbolを返す。
AsyncArrowFunction : async AsyncArrowBindingIdentifier => AsyncConciseBody
  1. symbolNewTargetSuperPropertySuperCallsuper、またはthisのいずれでもないなら、falseを返す。
  2. AsyncConciseBody Contains symbolを返す。
AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
  1. symbolNewTargetSuperPropertySuperCallsuper、またはthisのいずれでもないなら、falseを返す。
  2. headを、CoverCallExpressionAndAsyncArrowHeadによってcoverされるAsyncArrowHeadとする。
  3. head Contains symboltrueなら、trueを返す。
  4. AsyncConciseBody Contains symbolを返す。
Note 4

Containsは、ArrowFunctionまたはAsyncArrowFunction内でのnew.targetthis、およびsuperの使用を検出するために使用されます。

PropertyDefinition : MethodDefinition
  1. symbolMethodDefinitionなら、trueを返す。
  2. 引数symbolを伴うMethodDefinitionComputedPropertyContainsの結果を返す。
LiteralPropertyName : IdentifierName
  1. falseを返す。
MemberExpression : MemberExpression . IdentifierName
  1. MemberExpression Contains symboltrueなら、trueを返す。
  2. falseを返す。
SuperProperty : super . IdentifierName
  1. symbolReservedWord 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 Static Semantics: ComputedPropertyContains

The syntax-directed operation ComputedPropertyContains takes argument symbol (a grammar symbol) and returns a Boolean. 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. 引数symbolを伴うClassElementNameComputedPropertyContainsの結果を返す。
GeneratorMethod : * ClassElementName ( UniqueFormalParameters ) { GeneratorBody }
  1. 引数symbolを伴うClassElementNameComputedPropertyContainsの結果を返す。
AsyncGeneratorMethod : async * ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody }
  1. 引数symbolを伴うClassElementNameComputedPropertyContainsの結果を返す。
ClassElementList : ClassElementList ClassElement
  1. inListを、引数symbolを伴うClassElementListComputedPropertyContainsとする。
  2. inListtrueなら、trueを返す。
  3. 引数symbolを伴うClassElementComputedPropertyContainsの結果を返す。
ClassElement : ClassStaticBlock
  1. falseを返す。
ClassElement : ;
  1. falseを返す。
AsyncMethod : async ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody }
  1. 引数symbolを伴うClassElementNameComputedPropertyContainsの結果を返す。
FieldDefinition : ClassElementName Initializeropt
  1. 引数symbolを伴うClassElementNameComputedPropertyContainsの結果を返す。

8.6 その他

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

8.6.1 Runtime Semantics: InstantiateFunctionObject

The syntax-directed operation InstantiateFunctionObject takes arguments envRecord (an Environment Record) and privateEnv (a PrivateEnvironment Record or null) and returns an ECMAScript function object. It is defined piecewise over the following productions:

FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody } function ( FormalParameters ) { FunctionBody }
  1. 引数envRecordおよびprivateEnvを伴うFunctionDeclarationInstantiateOrdinaryFunctionObjectを返す。
GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } function * ( FormalParameters ) { GeneratorBody }
  1. 引数envRecordおよびprivateEnvを伴うGeneratorDeclarationInstantiateGeneratorFunctionObjectを返す。
AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } async function * ( FormalParameters ) { AsyncGeneratorBody }
  1. 引数envRecordおよびprivateEnvを伴うAsyncGeneratorDeclarationInstantiateAsyncGeneratorFunctionObjectを返す。
AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } async function ( FormalParameters ) { AsyncFunctionBody }
  1. 引数envRecordおよびprivateEnvを伴うAsyncFunctionDeclarationInstantiateAsyncFunctionObjectを返す。

8.6.2 Runtime Semantics: BindingInitialization

The syntax-directed operation BindingInitialization takes arguments value (an ECMAScript language value) and envRecord (an Environment Record or undefined) and returns either a normal completion containing unused or an abrupt completion.

Note

envRecordundefinedが渡されることは、初期化値を代入するためにPutValue操作を使用すべきであることを示します。これはvar statementsおよび一部のnon-strict functionsのformal parameter listsの場合に該当します(10.2.11を参照)。それらの場合、lexical bindingは、そのinitializerの評価に先立ってhoistされ、事前初期化されます。

It is defined piecewise over the following productions:

BindingIdentifier : Identifier
  1. nameIdentifierStringValueとする。
  2. InitializeBoundName(name, value, envRecord)を ? で返す。
BindingIdentifier : yield
  1. InitializeBoundName("yield", value, envRecord)を ? で返す。
BindingIdentifier : await
  1. InitializeBoundName("await", value, envRecord)を ? で返す。
BindingPattern : ObjectBindingPattern
  1. RequireObjectCoercible(value)を ? で実行する。
  2. 引数valueおよびenvRecordを伴うObjectBindingPatternBindingInitializationを ? で返す。
BindingPattern : ArrayBindingPattern
  1. iteratorRecordを ? GetIterator(value, sync) とする。
  2. resultを、引数iteratorRecordおよびenvRecordを伴うArrayBindingPatternIteratorBindingInitializationCompletionとする。
  3. iteratorRecord.[[Done]]falseなら、IteratorClose(iteratorRecord, result)を ? で返す。
  4. resultを ? で返す。
ObjectBindingPattern : { }
  1. unusedを返す。
ObjectBindingPattern : { BindingPropertyList } { BindingPropertyList , }
  1. 引数valueおよびenvRecordを伴うBindingPropertyListPropertyBindingInitializationを ? で実行する。
  2. unusedを返す。
ObjectBindingPattern : { BindingRestProperty }
  1. excludedNamesを新しい空のListとする。
  2. 引数valueenvRecord、およびexcludedNamesを伴うBindingRestPropertyRestBindingInitializationを ? で返す。
ObjectBindingPattern : { BindingPropertyList , BindingRestProperty }
  1. excludedNamesを、引数valueおよびenvRecordを伴うBindingPropertyListPropertyBindingInitializationの ? 結果とする。
  2. 引数valueenvRecord、およびexcludedNamesを伴うBindingRestPropertyRestBindingInitializationを ? で返す。

8.6.2.1 InitializeBoundName ( name, value, envRecord )

The abstract operation InitializeBoundName takes arguments name (a String), value (an ECMAScript language value), and envRecord (an Environment Record or undefined) and returns either a normal completion containing unused or an abrupt completion. It performs the following steps when called:

  1. envRecordundefinedでないなら、
    1. envRecord.InitializeBinding(name, value)を ! で実行する。
    2. unusedを返す。
  2. lhsを ? ResolveBinding(name) とする。
  3. PutValue(lhs, value)を ? で返す。

8.6.3 Runtime Semantics: IteratorBindingInitialization

The syntax-directed operation IteratorBindingInitialization takes arguments iteratorRecord (an Iterator Record) and envRecord (an Environment Record or undefined) and returns either a normal completion containing unused or an abrupt completion.

Note

envRecordundefinedが渡される場合、それは初期化値を代入するためにPutValue操作を使用すべきであることを示します。これはnon-strict functionsのformal parameter listsの場合に該当します。その場合、同じ名前を持つ複数のparametersの可能性に対処するため、formal parameter bindingsは事前初期化されます。

It is defined piecewise over the following productions:

ArrayBindingPattern : [ ]
  1. unusedを返す。
ArrayBindingPattern : [ Elision ]
  1. 引数iteratorRecordを伴うElisionIteratorDestructuringAssignmentEvaluationを ? で返す。
ArrayBindingPattern : [ Elisionopt BindingRestElement ]
  1. Elisionが存在するなら、
    1. 引数iteratorRecordを伴うElisionIteratorDestructuringAssignmentEvaluationを ? で実行する。
  2. 引数iteratorRecordおよびenvRecordを伴うBindingRestElementIteratorBindingInitializationを ? で返す。
ArrayBindingPattern : [ BindingElementList , Elision ]
  1. 引数iteratorRecordおよびenvRecordを伴うBindingElementListIteratorBindingInitializationを ? で実行する。
  2. 引数iteratorRecordを伴うElisionIteratorDestructuringAssignmentEvaluationを ? で返す。
ArrayBindingPattern : [ BindingElementList , Elisionopt BindingRestElement ]
  1. 引数iteratorRecordおよびenvRecordを伴うBindingElementListIteratorBindingInitializationを ? で実行する。
  2. Elisionが存在するなら、
    1. 引数iteratorRecordを伴うElisionIteratorDestructuringAssignmentEvaluationを ? で実行する。
  3. 引数iteratorRecordおよびenvRecordを伴うBindingRestElementIteratorBindingInitializationを ? で返す。
BindingElementList : BindingElementList , BindingElisionElement
  1. 引数iteratorRecordおよびenvRecordを伴うBindingElementListIteratorBindingInitializationを ? で実行する。
  2. 引数iteratorRecordおよびenvRecordを伴うBindingElisionElementIteratorBindingInitializationを ? で返す。
BindingElisionElement : Elision BindingElement
  1. 引数iteratorRecordを伴うElisionIteratorDestructuringAssignmentEvaluationを ? で実行する。
  2. 引数iteratorRecordおよびenvRecordを伴うBindingElementIteratorBindingInitializationを ? で返す。
SingleNameBinding : BindingIdentifier Initializeropt
  1. bindingIdBindingIdentifierStringValueとする。
  2. lhsを ? ResolveBinding(bindingId, envRecord) とする。
  3. vundefinedとする。
  4. iteratorRecord.[[Done]]falseなら、
    1. nextを ? IteratorStepValue(iteratorRecord) とする。
    2. nextdoneでないなら、
      1. vnextに設定する。
  5. Initializerが存在し、かつvundefinedなら、
    1. IsAnonymousFunctionDefinition(Initializer)がtrueなら、
      1. vを、引数bindingIdを伴うInitializerNamedEvaluationの ? 結果に設定する。
    2. そうでなければ、
      1. defaultValueInitializerEvaluationの ? 結果とする。
      2. vを ? GetValue(defaultValue) に設定する。
  6. envRecordundefinedなら、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. defaultValueInitializerEvaluationの ? 結果とする。
    2. vを ? GetValue(defaultValue) に設定する。
  4. 引数vおよびenvRecordを伴うBindingPatternBindingInitializationを ? で返す。
BindingRestElement : ... BindingIdentifier
  1. lhsを ? ResolveBinding(StringValue of BindingIdentifier, envRecord) とする。
  2. arrayを ! ArrayCreate(0) とする。
  3. nを0とする。
  4. 繰り返す
    1. nextdoneとする。
    2. iteratorRecord.[[Done]]falseなら、
      1. nextを ? IteratorStepValue(iteratorRecord) に設定する。
    3. nextdoneなら、
      1. envRecordundefinedなら、PutValue(lhs, array)を ? で返す。
      2. InitializeReferencedBinding(lhs, array)を ? で返す。
    4. CreateDataPropertyOrThrow(array, ! ToString(𝔽(n)), next)を ! で実行する。
    5. nn + 1に設定する。
BindingRestElement : ... BindingPattern
  1. arrayを ! ArrayCreate(0) とする。
  2. nを0とする。
  3. 繰り返す
    1. nextdoneとする。
    2. iteratorRecord.[[Done]]falseなら、
      1. nextを ? IteratorStepValue(iteratorRecord) に設定する。
    3. nextdoneなら、
      1. 引数arrayおよびenvRecordを伴うBindingPatternBindingInitializationを ? で返す。
    4. CreateDataPropertyOrThrow(array, ! ToString(𝔽(n)), next)を ! で実行する。
    5. nn + 1に設定する。
FormalParameters : [empty]
  1. unusedを返す。
FormalParameters : FormalParameterList , FunctionRestParameter
  1. 引数iteratorRecordおよびenvRecordを伴うFormalParameterListIteratorBindingInitializationを ? で実行する。
  2. 引数iteratorRecordおよびenvRecordを伴うFunctionRestParameterIteratorBindingInitializationを ? で返す。
FormalParameterList : FormalParameterList , FormalParameter
  1. 引数iteratorRecordおよびenvRecordを伴うFormalParameterListIteratorBindingInitializationを ? で実行する。
  2. 引数iteratorRecordおよびenvRecordを伴うFormalParameterIteratorBindingInitializationを ? で返す。
ArrowParameters : BindingIdentifier
  1. vundefinedとする。
  2. Assert: iteratorRecord.[[Done]]falseである。
  3. nextを ? IteratorStepValue(iteratorRecord) とする。
  4. nextdoneでないなら、
    1. vnextに設定する。
  5. 引数vおよびenvRecordを伴うBindingIdentifierBindingInitializationを ? で返す。
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
  1. formalsを、CoverParenthesizedExpressionAndArrowParameterListによってcoverされるArrowFormalParametersとする。
  2. 引数iteratorRecordおよびenvRecordを伴うformalsIteratorBindingInitializationを ? で返す。
AsyncArrowBindingIdentifier : BindingIdentifier
  1. vundefinedとする。
  2. Assert: iteratorRecord.[[Done]]falseである。
  3. nextを ? IteratorStepValue(iteratorRecord) とする。
  4. nextdoneでないなら、
    1. vnextに設定する。
  5. 引数vおよびenvRecordを伴うBindingIdentifierBindingInitializationを ? で返す。

8.6.4 Static Semantics: AssignmentTargetType

The syntax-directed operation AssignmentTargetType takes no arguments and returns simple, web-compat, or invalid. It is defined piecewise over the following productions:

IdentifierReference : Identifier
  1. IsStrict(this IdentifierReference)がtrueであり、かつIdentifierStringValue"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. exprを、CoverParenthesizedExpressionAndArrowParameterListによってcoverされるParenthesizedExpressionとする。
  2. exprAssignmentTargetTypeを返す。
CallExpression : CoverCallExpressionAndAsyncArrowHead CallExpression Arguments
  1. hostがweb browserであるか、または他の方法でFunction Call Assignment Targetsに対するRuntime Errorsをサポートしており、かつ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 CoverAwaitExpressionAndAwaitUsingDeclarationHead 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 Static Semantics: PropName

The syntax-directed operation PropName takes no arguments and returns a String or empty. It is defined piecewise over the following productions:

PropertyDefinition : IdentifierReference
  1. IdentifierReferenceStringValueを返す。
PropertyDefinition : ... AssignmentExpression
  1. emptyを返す。
PropertyDefinition : PropertyName : AssignmentExpression
  1. PropertyNamePropNameを返す。
LiteralPropertyName : IdentifierName AttributeKey : IdentifierName
  1. IdentifierNameStringValueを返す。
LiteralPropertyName : StringLiteral AttributeKey : StringLiteral
  1. StringLiteralSVを返す。
LiteralPropertyName : NumericLiteral
  1. numberNumericLiteralNumericValueとする。
  2. ToString(number)を返す。
ComputedPropertyName : [ AssignmentExpression ]
  1. emptyを返す。
MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody } get ClassElementName ( ) { FunctionBody } set ClassElementName ( PropertySetParameterList ) { FunctionBody }
  1. ClassElementNamePropNameを返す。
GeneratorMethod : * ClassElementName ( UniqueFormalParameters ) { GeneratorBody }
  1. ClassElementNamePropNameを返す。
AsyncGeneratorMethod : async * ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody }
  1. ClassElementNamePropNameを返す。
ClassElement : ClassStaticBlock
  1. emptyを返す。
ClassElement : ;
  1. emptyを返す。
AsyncMethod : async ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody }
  1. ClassElementNamePropNameを返す。
FieldDefinition : ClassElementName Initializeropt
  1. ClassElementNamePropNameを返す。
ClassElementName : PrivateIdentifier
  1. emptyを返す。

8.6.6 Static Semantics: ContainsUsing

The syntax-directed operation ContainsUsing takes no arguments and returns Boolean. It is defined piecewise over the following productions:

StatementList : StatementList StatementListItem
  1. 派生した StatementListContainsUsingtrue である場合、true を返す。
  2. StatementListItemContainsUsingtrue である場合、true を返す。
  3. false を返す。
StatementListItem : Statement
  1. false を返す。
StatementListItem : Declaration
  1. DeclarationIsUsingDeclarationtrue である場合、true を返す。
  2. DeclarationIsAwaitUsingDeclarationtrue である場合、true を返す。
  3. false を返す。