8 Syntax-Directed Operations

이 section에 정의된 것들 외에도, specialized syntax-directed operation은 이 명세 전반에 걸쳐 정의됩니다.

8.1 Runtime Semantics: Evaluation

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

Note
이 operation에 대한 definition은 이 명세의 “ECMAScript Language” section 전반에 분산되어 있습니다. 각 definition은 relevant production의 defining occurrence 뒤에 나타납니다.

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가 다른 name을 가지지 않을 때 그 synthetic name으로 사용됩니다. module의 [[Environment]] 안의 entry가 그 name으로 생성되어 corresponding value를 hold하며, module에 대해 ResolveExport ( exportName [ , resolveSet ] )를 호출하여 "default"라는 name의 export를 resolving하면 [[BindingName]]"*default*"ResolvedBinding Record가 반환되고, 이는 module의 [[Environment]] 안에서 위에서 언급한 value로 resolve됩니다. 이는 anonymous default export가 다른 export와 마찬가지로 resolve될 수 있도록 하기 위한 specification 편의를 위해서만 수행됩니다. 이 "*default*" string은 ECMAScript code나 module linking algorithm에서 결코 accessible하지 않습니다.

It is defined piecewise over the following productions:

BindingIdentifier : Identifier
  1. IdentifierStringValue를 sole element로 하는 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. 새 empty List를 반환한다.
ObjectBindingPattern : { BindingPropertyList , BindingRestProperty }
  1. names1BindingPropertyListBoundNames로 둔다.
  2. names2BindingRestPropertyBoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
ArrayBindingPattern : [ Elisionopt ]
  1. 새 empty 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. 새 empty List를 반환한다.
FormalParameters : FormalParameterList , FunctionRestParameter
  1. names1FormalParameterListBoundNames로 둔다.
  2. names2FunctionRestParameterBoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
FormalParameterList : FormalParameterList , FormalParameter
  1. names1FormalParameterListBoundNames로 둔다.
  2. names2FormalParameterBoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
  1. formalsCoverParenthesizedExpressionAndArrowParameterList가 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. headCoverCallExpressionAndAsyncArrowHead가 cover하는 AsyncArrowHead로 둔다.
  2. headBoundNames를 반환한다.
ImportDeclaration : import ImportClause FromClause WithClauseopt ;
  1. ImportClauseBoundNames를 반환한다.
ImportDeclaration : import ModuleSpecifier WithClauseopt ;
  1. 새 empty List를 반환한다.
ImportClause : ImportedDefaultBinding , NameSpaceImport
  1. names1ImportedDefaultBindingBoundNames로 둔다.
  2. names2NameSpaceImportBoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
ImportClause : ImportedDefaultBinding , NamedImports
  1. names1ImportedDefaultBindingBoundNames로 둔다.
  2. names2NamedImportsBoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
NamedImports : { }
  1. 새 empty 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. 새 empty List를 반환한다.
ExportDeclaration : export VariableStatement
  1. VariableStatementBoundNames를 반환한다.
ExportDeclaration : export Declaration
  1. DeclarationBoundNames를 반환한다.
ExportDeclaration : export default HoistableDeclaration
  1. declNamesHoistableDeclarationBoundNames로 둔다.
  2. declNames가 element "*default*"를 include하지 않으면, "*default*"declNames에 append한다.
  3. declNames를 반환한다.
ExportDeclaration : export default ClassDeclaration
  1. declNamesClassDeclarationBoundNames로 둔다.
  2. declNames가 element "*default*"를 include하지 않으면, "*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를 reference하는 데 사용되는 internal bound name에 assignment를 허용하는 syntax가 없기 때문입니다.

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. 새 empty List를 반환한다.
StatementList : StatementList StatementListItem
  1. names1StatementListLexicallyDeclaredNames로 둔다.
  2. names2StatementListItemLexicallyDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
StatementListItem : Statement
  1. Statement Statement : LabelledStatement 이면, LabelledStatementLexicallyDeclaredNames를 반환한다.
  2. 새 empty List를 반환한다.
StatementListItem : Declaration
  1. DeclarationBoundNames를 반환한다.
CaseBlock : { }
  1. 새 empty List를 반환한다.
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 첫 번째 CaseClauses가 present하면, names1을 첫 번째 CaseClausesLexicallyDeclaredNames로 둔다.
  2. 그렇지 않으면, names1을 새 empty List로 둔다.
  3. names2DefaultClauseLexicallyDeclaredNames로 둔다.
  4. 두 번째 CaseClauses가 present하면, names3을 두 번째 CaseClausesLexicallyDeclaredNames로 둔다.
  5. 그렇지 않으면, names3을 새 empty List로 둔다.
  6. names1, names2, names3list-concatenation을 반환한다.
CaseClauses : CaseClauses CaseClause
  1. names1CaseClausesLexicallyDeclaredNames로 둔다.
  2. names2CaseClauseLexicallyDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
CaseClause : case Expression : StatementListopt
  1. StatementList가 present하면, StatementListLexicallyDeclaredNames를 반환한다.
  2. 새 empty List를 반환한다.
DefaultClause : default : StatementListopt
  1. StatementList가 present하면, StatementListLexicallyDeclaredNames를 반환한다.
  2. 새 empty List를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItemLexicallyDeclaredNames를 반환한다.
LabelledItem : Statement
  1. 새 empty List를 반환한다.
LabelledItem : FunctionDeclaration
  1. FunctionDeclarationBoundNames를 반환한다.
FunctionStatementList : [empty]
  1. 새 empty List를 반환한다.
FunctionStatementList : StatementList
  1. StatementListTopLevelLexicallyDeclaredNames를 반환한다.
ClassStaticBlockStatementList : [empty]
  1. 새 empty List를 반환한다.
ClassStaticBlockStatementList : StatementList
  1. StatementListTopLevelLexicallyDeclaredNames를 반환한다.
ConciseBody : ExpressionBody
  1. 새 empty List를 반환한다.
AsyncConciseBody : ExpressionBody
  1. 새 empty List를 반환한다.
Script : [empty]
  1. 새 empty List를 반환한다.
ScriptBody : StatementList
  1. StatementListTopLevelLexicallyDeclaredNames를 반환한다.
Note 1

Script의 top level에서 function declaration은 lexical declaration처럼이 아니라 var declaration처럼 취급됩니다.

Note 2

Module의 LexicallyDeclaredNames에는 모든 imported binding의 name이 포함됩니다.

ModuleItemList : ModuleItemList ModuleItem
  1. names1ModuleItemListLexicallyDeclaredNames로 둔다.
  2. names2ModuleItemLexicallyDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
ModuleItem : ImportDeclaration
  1. ImportDeclarationBoundNames를 반환한다.
ModuleItem : ExportDeclaration
  1. ExportDeclarationexport VariableStatement이면, 새 empty List를 반환한다.
  2. ExportDeclarationBoundNames를 반환한다.
ModuleItem : StatementListItem
  1. StatementListItemLexicallyDeclaredNames를 반환한다.
Note 3

Module의 top level에서 function declaration은 var declaration처럼이 아니라 lexical declaration처럼 취급됩니다.

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. 새 empty List를 반환한다.
StatementListItem : Declaration
  1. DeclarationDeclarationPart를 sole element로 하는 List를 반환한다.
CaseBlock : { }
  1. 새 empty List를 반환한다.
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 첫 번째 CaseClauses가 present하면, decls1을 첫 번째 CaseClausesLexicallyScopedDeclarations로 둔다.
  2. 그렇지 않으면, decls1을 새 empty List로 둔다.
  3. decls2DefaultClauseLexicallyScopedDeclarations로 둔다.
  4. 두 번째 CaseClauses가 present하면, decls3을 두 번째 CaseClausesLexicallyScopedDeclarations로 둔다.
  5. 그렇지 않으면, decls3을 새 empty List로 둔다.
  6. decls1, decls2, decls3list-concatenation을 반환한다.
CaseClauses : CaseClauses CaseClause
  1. decls1CaseClausesLexicallyScopedDeclarations로 둔다.
  2. decls2CaseClauseLexicallyScopedDeclarations로 둔다.
  3. decls1decls2list-concatenation을 반환한다.
CaseClause : case Expression : StatementListopt
  1. StatementList가 present하면, StatementListLexicallyScopedDeclarations를 반환한다.
  2. 새 empty List를 반환한다.
DefaultClause : default : StatementListopt
  1. StatementList가 present하면, StatementListLexicallyScopedDeclarations를 반환한다.
  2. 새 empty List를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItemLexicallyScopedDeclarations를 반환한다.
LabelledItem : Statement
  1. 새 empty List를 반환한다.
LabelledItem : FunctionDeclaration
  1. « FunctionDeclaration »를 반환한다.
FunctionStatementList : [empty]
  1. 새 empty List를 반환한다.
FunctionStatementList : StatementList
  1. StatementListTopLevelLexicallyScopedDeclarations를 반환한다.
ClassStaticBlockStatementList : [empty]
  1. 새 empty List를 반환한다.
ClassStaticBlockStatementList : StatementList
  1. StatementListTopLevelLexicallyScopedDeclarations를 반환한다.
ConciseBody : ExpressionBody
  1. 새 empty List를 반환한다.
AsyncConciseBody : ExpressionBody
  1. 새 empty List를 반환한다.
Script : [empty]
  1. 새 empty List를 반환한다.
ScriptBody : StatementList
  1. StatementListTopLevelLexicallyScopedDeclarations를 반환한다.
Module : [empty]
  1. 새 empty List를 반환한다.
ModuleItemList : ModuleItemList ModuleItem
  1. decls1ModuleItemListLexicallyScopedDeclarations로 둔다.
  2. decls2ModuleItemLexicallyScopedDeclarations로 둔다.
  3. decls1decls2list-concatenation을 반환한다.
ModuleItem : ImportDeclaration
  1. 새 empty List를 반환한다.
ExportDeclaration : export ExportFromClause FromClause WithClauseopt ; export NamedExports ; export VariableStatement
  1. 새 empty List를 반환한다.
ExportDeclaration : export Declaration
  1. DeclarationDeclarationPart를 sole element로 하는 List를 반환한다.
ExportDeclaration : export default HoistableDeclaration
  1. HoistableDeclarationDeclarationPart를 sole element로 하는 List를 반환한다.
ExportDeclaration : export default ClassDeclaration
  1. ClassDeclaration을 sole element로 하는 List를 반환한다.
ExportDeclaration : export default AssignmentExpression ;
  1. this ExportDeclaration을 sole element로 하는 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. 새 empty List를 반환한다.
Block : { }
  1. 새 empty List를 반환한다.
StatementList : StatementList StatementListItem
  1. names1StatementListVarDeclaredNames로 둔다.
  2. names2StatementListItemVarDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
StatementListItem : Declaration
  1. 새 empty List를 반환한다.
VariableStatement : var VariableDeclarationList ;
  1. VariableDeclarationListBoundNames를 반환한다.
IfStatement : if ( Expression ) Statement else Statement
  1. names1을 첫 번째 StatementVarDeclaredNames로 둔다.
  2. names2를 두 번째 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

이 section은 Annex B.3.5에 의해 extended됩니다.

WithStatement : with ( Expression ) Statement
  1. StatementVarDeclaredNames를 반환한다.
SwitchStatement : switch ( Expression ) CaseBlock
  1. CaseBlockVarDeclaredNames를 반환한다.
CaseBlock : { }
  1. 새 empty List를 반환한다.
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 첫 번째 CaseClauses가 present하면, names1을 첫 번째 CaseClausesVarDeclaredNames로 둔다.
  2. 그렇지 않으면, names1을 새 empty List로 둔다.
  3. names2DefaultClauseVarDeclaredNames로 둔다.
  4. 두 번째 CaseClauses가 present하면, names3을 두 번째 CaseClausesVarDeclaredNames로 둔다.
  5. 그렇지 않으면, names3을 새 empty List로 둔다.
  6. names1, names2, names3list-concatenation을 반환한다.
CaseClauses : CaseClauses CaseClause
  1. names1CaseClausesVarDeclaredNames로 둔다.
  2. names2CaseClauseVarDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
CaseClause : case Expression : StatementListopt
  1. StatementList가 present하면, StatementListVarDeclaredNames를 반환한다.
  2. 새 empty List를 반환한다.
DefaultClause : default : StatementListopt
  1. StatementList가 present하면, StatementListVarDeclaredNames를 반환한다.
  2. 새 empty List를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItemVarDeclaredNames를 반환한다.
LabelledItem : FunctionDeclaration
  1. 새 empty 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. names1, names2, names3list-concatenation을 반환한다.
Catch : catch ( CatchParameter ) Block
  1. BlockVarDeclaredNames를 반환한다.
FunctionStatementList : [empty]
  1. 새 empty List를 반환한다.
FunctionStatementList : StatementList
  1. StatementListTopLevelVarDeclaredNames를 반환한다.
ClassStaticBlockStatementList : [empty]
  1. 새 empty List를 반환한다.
ClassStaticBlockStatementList : StatementList
  1. StatementListTopLevelVarDeclaredNames를 반환한다.
ConciseBody : ExpressionBody
  1. 새 empty List를 반환한다.
AsyncConciseBody : ExpressionBody
  1. 새 empty List를 반환한다.
Script : [empty]
  1. 새 empty List를 반환한다.
ScriptBody : StatementList
  1. StatementListTopLevelVarDeclaredNames를 반환한다.
ModuleItemList : ModuleItemList ModuleItem
  1. names1ModuleItemListVarDeclaredNames로 둔다.
  2. names2ModuleItemVarDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
ModuleItem : ImportDeclaration
  1. 새 empty List를 반환한다.
ModuleItem : ExportDeclaration
  1. ExportDeclarationexport VariableStatement이면, ExportDeclarationBoundNames를 반환한다.
  2. 새 empty 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. 새 empty List를 반환한다.
Block : { }
  1. 새 empty List를 반환한다.
StatementList : StatementList StatementListItem
  1. decls1StatementListVarScopedDeclarations로 둔다.
  2. decls2StatementListItemVarScopedDeclarations로 둔다.
  3. decls1decls2list-concatenation을 반환한다.
StatementListItem : Declaration
  1. 새 empty 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를 두 번째 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

이 section은 Annex B.3.5에 의해 extended됩니다.

WithStatement : with ( Expression ) Statement
  1. StatementVarScopedDeclarations를 반환한다.
SwitchStatement : switch ( Expression ) CaseBlock
  1. CaseBlockVarScopedDeclarations를 반환한다.
CaseBlock : { }
  1. 새 empty List를 반환한다.
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 첫 번째 CaseClauses가 present하면, decls1을 첫 번째 CaseClausesVarScopedDeclarations로 둔다.
  2. 그렇지 않으면, decls1을 새 empty List로 둔다.
  3. decls2DefaultClauseVarScopedDeclarations로 둔다.
  4. 두 번째 CaseClauses가 present하면, decls3을 두 번째 CaseClausesVarScopedDeclarations로 둔다.
  5. 그렇지 않으면, decls3을 새 empty List로 둔다.
  6. decls1, decls2, decls3list-concatenation을 반환한다.
CaseClauses : CaseClauses CaseClause
  1. decls1CaseClausesVarScopedDeclarations로 둔다.
  2. decls2CaseClauseVarScopedDeclarations로 둔다.
  3. decls1decls2list-concatenation을 반환한다.
CaseClause : case Expression : StatementListopt
  1. StatementList가 present하면, StatementListVarScopedDeclarations를 반환한다.
  2. 새 empty List를 반환한다.
DefaultClause : default : StatementListopt
  1. StatementList가 present하면, StatementListVarScopedDeclarations를 반환한다.
  2. 새 empty List를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItemVarScopedDeclarations를 반환한다.
LabelledItem : FunctionDeclaration
  1. 새 empty 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. decls1, decls2, decls3list-concatenation을 반환한다.
Catch : catch ( CatchParameter ) Block
  1. BlockVarScopedDeclarations를 반환한다.
FunctionStatementList : [empty]
  1. 새 empty List를 반환한다.
FunctionStatementList : StatementList
  1. StatementListTopLevelVarScopedDeclarations를 반환한다.
ClassStaticBlockStatementList : [empty]
  1. 새 empty List를 반환한다.
ClassStaticBlockStatementList : StatementList
  1. StatementListTopLevelVarScopedDeclarations를 반환한다.
ConciseBody : ExpressionBody
  1. 새 empty List를 반환한다.
AsyncConciseBody : ExpressionBody
  1. 새 empty List를 반환한다.
Script : [empty]
  1. 새 empty List를 반환한다.
ScriptBody : StatementList
  1. StatementListTopLevelVarScopedDeclarations를 반환한다.
Module : [empty]
  1. 새 empty List를 반환한다.
ModuleItemList : ModuleItemList ModuleItem
  1. decls1ModuleItemListVarScopedDeclarations로 둔다.
  2. decls2ModuleItemVarScopedDeclarations로 둔다.
  3. decls1decls2list-concatenation을 반환한다.
ModuleItem : ImportDeclaration
  1. 새 empty List를 반환한다.
ModuleItem : ExportDeclaration
  1. ExportDeclarationexport VariableStatement이면, VariableStatementVarScopedDeclarations를 반환한다.
  2. 새 empty 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. 새 empty List를 반환한다.
StatementListItem : Declaration
  1. Declaration Declaration : HoistableDeclaration 이면, 다음을 수행한다.
    1. 새 empty List를 반환한다.
  2. DeclarationBoundNames를 반환한다.
Note

function 또는 script의 top level에서 function declaration은 lexical declaration처럼이 아니라 var declaration처럼 취급됩니다.

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. 새 empty List를 반환한다.
StatementListItem : Declaration
  1. Declaration Declaration : HoistableDeclaration 이면, 다음을 수행한다.
    1. 새 empty 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. 새 empty List를 반환한다.
StatementListItem : Statement
  1. Statement Statement : LabelledStatement 이면, StatementTopLevelVarDeclaredNames를 반환한다.
  2. StatementVarDeclaredNames를 반환한다.
Note

function 또는 script의 top level에서 inner function declaration은 var declaration처럼 취급됩니다.

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. 새 empty List를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItemTopLevelVarScopedDeclarations를 반환한다.
LabelledItem : Statement
  1. Statement Statement : LabelledStatement 이면, StatementTopLevelVarScopedDeclarations를 반환한다.
  2. StatementVarScopedDeclarations를 반환한다.
LabelledItem : FunctionDeclaration
  1. « FunctionDeclaration »를 반환한다.

8.3 Labels

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를 argument labelSet를 가진 StatementListContainsDuplicateLabels로 둔다.
  2. hasDuplicatestrue이면, true를 반환한다.
  3. argument labelSet를 가진 StatementListItemContainsDuplicateLabels를 반환한다.
IfStatement : if ( Expression ) Statement else Statement
  1. hasDuplicate를 argument labelSet를 가진 첫 번째 StatementContainsDuplicateLabels로 둔다.
  2. hasDuplicatetrue이면, true를 반환한다.
  3. argument labelSet를 가진 두 번째 StatementContainsDuplicateLabels를 반환한다.
IfStatement : if ( Expression ) Statement
  1. argument labelSet를 가진 StatementContainsDuplicateLabels를 반환한다.
DoWhileStatement : do Statement while ( Expression ) ;
  1. argument labelSet를 가진 StatementContainsDuplicateLabels를 반환한다.
WhileStatement : while ( Expression ) Statement
  1. argument labelSet를 가진 StatementContainsDuplicateLabels를 반환한다.
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. argument 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. argument labelSet를 가진 StatementContainsDuplicateLabels를 반환한다.
Note

이 section은 Annex B.3.5에 의해 extended됩니다.

WithStatement : with ( Expression ) Statement
  1. argument labelSet를 가진 StatementContainsDuplicateLabels를 반환한다.
SwitchStatement : switch ( Expression ) CaseBlock
  1. argument labelSet를 가진 CaseBlockContainsDuplicateLabels를 반환한다.
CaseBlock : { }
  1. false를 반환한다.
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 첫 번째 CaseClauses가 present하면, 다음을 수행한다.
    1. argument labelSet를 가진 첫 번째 CaseClausesContainsDuplicateLabelstrue이면, true를 반환한다.
  2. argument labelSet를 가진 DefaultClauseContainsDuplicateLabelstrue이면, true를 반환한다.
  3. 두 번째 CaseClauses가 present하지 않으면, false를 반환한다.
  4. argument labelSet를 가진 두 번째 CaseClausesContainsDuplicateLabels를 반환한다.
CaseClauses : CaseClauses CaseClause
  1. hasDuplicates를 argument labelSet를 가진 CaseClausesContainsDuplicateLabels로 둔다.
  2. hasDuplicatestrue이면, true를 반환한다.
  3. argument labelSet를 가진 CaseClauseContainsDuplicateLabels를 반환한다.
CaseClause : case Expression : StatementListopt
  1. StatementList가 present하면, argument labelSet를 가진 StatementListContainsDuplicateLabels를 반환한다.
  2. false를 반환한다.
DefaultClause : default : StatementListopt
  1. StatementList가 present하면, argument labelSet를 가진 StatementListContainsDuplicateLabels를 반환한다.
  2. false를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. labelLabelIdentifierStringValue로 둔다.
  2. labelSetlabel을 contain하면, true를 반환한다.
  3. newLabelSetlabelSet와 « label »의 list-concatenation으로 둔다.
  4. argument newLabelSet를 가진 LabelledItemContainsDuplicateLabels를 반환한다.
LabelledItem : FunctionDeclaration
  1. false를 반환한다.
TryStatement : try Block Catch
  1. hasDuplicates를 argument labelSet를 가진 BlockContainsDuplicateLabels로 둔다.
  2. hasDuplicatestrue이면, true를 반환한다.
  3. argument labelSet를 가진 CatchContainsDuplicateLabels를 반환한다.
TryStatement : try Block Finally
  1. hasDuplicates를 argument labelSet를 가진 BlockContainsDuplicateLabels로 둔다.
  2. hasDuplicatestrue이면, true를 반환한다.
  3. argument labelSet를 가진 FinallyContainsDuplicateLabels를 반환한다.
TryStatement : try Block Catch Finally
  1. argument labelSet를 가진 BlockContainsDuplicateLabelstrue이면, true를 반환한다.
  2. argument labelSet를 가진 CatchContainsDuplicateLabelstrue이면, true를 반환한다.
  3. argument labelSet를 가진 FinallyContainsDuplicateLabels를 반환한다.
Catch : catch ( CatchParameter ) Block
  1. argument labelSet를 가진 BlockContainsDuplicateLabels를 반환한다.
FunctionStatementList : [empty]
  1. false를 반환한다.
ClassStaticBlockStatementList : [empty]
  1. false를 반환한다.
ModuleItemList : ModuleItemList ModuleItem
  1. hasDuplicates를 argument labelSet를 가진 ModuleItemListContainsDuplicateLabels로 둔다.
  2. hasDuplicatestrue이면, true를 반환한다.
  3. argument 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를 argument labelSet를 가진 StatementListContainsUndefinedBreakTarget으로 둔다.
  2. hasUndefinedLabelstrue이면, true를 반환한다.
  3. argument labelSet를 가진 StatementListItemContainsUndefinedBreakTarget을 반환한다.
IfStatement : if ( Expression ) Statement else Statement
  1. hasUndefinedLabels를 argument labelSet를 가진 첫 번째 StatementContainsUndefinedBreakTarget으로 둔다.
  2. hasUndefinedLabelstrue이면, true를 반환한다.
  3. argument labelSet를 가진 두 번째 StatementContainsUndefinedBreakTarget을 반환한다.
IfStatement : if ( Expression ) Statement
  1. argument labelSet를 가진 StatementContainsUndefinedBreakTarget을 반환한다.
DoWhileStatement : do Statement while ( Expression ) ;
  1. argument labelSet를 가진 StatementContainsUndefinedBreakTarget을 반환한다.
WhileStatement : while ( Expression ) Statement
  1. argument labelSet를 가진 StatementContainsUndefinedBreakTarget을 반환한다.
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. argument 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. argument labelSet를 가진 StatementContainsUndefinedBreakTarget을 반환한다.
Note

이 section은 Annex B.3.5에 의해 extended됩니다.

BreakStatement : break ;
  1. false를 반환한다.
BreakStatement : break LabelIdentifier ;
  1. labelSetLabelIdentifierStringValue를 contain하면, false를 반환한다.
  2. true를 반환한다.
WithStatement : with ( Expression ) Statement
  1. argument labelSet를 가진 StatementContainsUndefinedBreakTarget을 반환한다.
SwitchStatement : switch ( Expression ) CaseBlock
  1. argument labelSet를 가진 CaseBlockContainsUndefinedBreakTarget을 반환한다.
CaseBlock : { }
  1. false를 반환한다.
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 첫 번째 CaseClauses가 present하면, 다음을 수행한다.
    1. argument labelSet를 가진 첫 번째 CaseClausesContainsUndefinedBreakTargettrue이면, true를 반환한다.
  2. argument labelSet를 가진 DefaultClauseContainsUndefinedBreakTargettrue이면, true를 반환한다.
  3. 두 번째 CaseClauses가 present하지 않으면, false를 반환한다.
  4. argument labelSet를 가진 두 번째 CaseClausesContainsUndefinedBreakTarget을 반환한다.
CaseClauses : CaseClauses CaseClause
  1. hasUndefinedLabels를 argument labelSet를 가진 CaseClausesContainsUndefinedBreakTarget으로 둔다.
  2. hasUndefinedLabelstrue이면, true를 반환한다.
  3. argument labelSet를 가진 CaseClauseContainsUndefinedBreakTarget을 반환한다.
CaseClause : case Expression : StatementListopt
  1. StatementList가 present하면, argument labelSet를 가진 StatementListContainsUndefinedBreakTarget을 반환한다.
  2. false를 반환한다.
DefaultClause : default : StatementListopt
  1. StatementList가 present하면, argument labelSet를 가진 StatementListContainsUndefinedBreakTarget을 반환한다.
  2. false를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. labelLabelIdentifierStringValue로 둔다.
  2. newLabelSetlabelSet와 « label »의 list-concatenation으로 둔다.
  3. argument newLabelSet를 가진 LabelledItemContainsUndefinedBreakTarget을 반환한다.
LabelledItem : FunctionDeclaration
  1. false를 반환한다.
TryStatement : try Block Catch
  1. hasUndefinedLabels를 argument labelSet를 가진 BlockContainsUndefinedBreakTarget으로 둔다.
  2. hasUndefinedLabelstrue이면, true를 반환한다.
  3. argument labelSet를 가진 CatchContainsUndefinedBreakTarget을 반환한다.
TryStatement : try Block Finally
  1. hasUndefinedLabels를 argument labelSet를 가진 BlockContainsUndefinedBreakTarget으로 둔다.
  2. hasUndefinedLabelstrue이면, true를 반환한다.
  3. argument labelSet를 가진 FinallyContainsUndefinedBreakTarget을 반환한다.
TryStatement : try Block Catch Finally
  1. argument labelSet를 가진 BlockContainsUndefinedBreakTargettrue이면, true를 반환한다.
  2. argument labelSet를 가진 CatchContainsUndefinedBreakTargettrue이면, true를 반환한다.
  3. argument labelSet를 가진 FinallyContainsUndefinedBreakTarget을 반환한다.
Catch : catch ( CatchParameter ) Block
  1. argument labelSet를 가진 BlockContainsUndefinedBreakTarget을 반환한다.
FunctionStatementList : [empty]
  1. false를 반환한다.
ClassStaticBlockStatementList : [empty]
  1. false를 반환한다.
ModuleItemList : ModuleItemList ModuleItem
  1. hasUndefinedLabels를 argument labelSet를 가진 ModuleItemListContainsUndefinedBreakTarget으로 둔다.
  2. hasUndefinedLabelstrue이면, true를 반환한다.
  3. argument 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. arguments iterationSet와 « »를 가진 BlockStatementContainsUndefinedContinueTarget을 반환한다.
BreakableStatement : IterationStatement
  1. newIterationSetiterationSetlabelSetlist-concatenation으로 둔다.
  2. arguments newIterationSet와 « »를 가진 IterationStatementContainsUndefinedContinueTarget을 반환한다.
StatementList : StatementList StatementListItem
  1. hasUndefinedLabels를 arguments iterationSet와 « »를 가진 StatementListContainsUndefinedContinueTarget으로 둔다.
  2. hasUndefinedLabelstrue이면, true를 반환한다.
  3. arguments iterationSet와 « »를 가진 StatementListItemContainsUndefinedContinueTarget을 반환한다.
IfStatement : if ( Expression ) Statement else Statement
  1. hasUndefinedLabels를 arguments iterationSet와 « »를 가진 첫 번째 StatementContainsUndefinedContinueTarget으로 둔다.
  2. hasUndefinedLabelstrue이면, true를 반환한다.
  3. arguments iterationSet와 « »를 가진 두 번째 StatementContainsUndefinedContinueTarget을 반환한다.
IfStatement : if ( Expression ) Statement
  1. arguments iterationSet와 « »를 가진 StatementContainsUndefinedContinueTarget을 반환한다.
DoWhileStatement : do Statement while ( Expression ) ;
  1. arguments iterationSet와 « »를 가진 StatementContainsUndefinedContinueTarget을 반환한다.
WhileStatement : while ( Expression ) Statement
  1. arguments iterationSet와 « »를 가진 StatementContainsUndefinedContinueTarget을 반환한다.
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. arguments 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. arguments iterationSet와 « »를 가진 StatementContainsUndefinedContinueTarget을 반환한다.
Note

이 section은 Annex B.3.5에 의해 extended됩니다.

ContinueStatement : continue ;
  1. false를 반환한다.
ContinueStatement : continue LabelIdentifier ;
  1. iterationSetLabelIdentifierStringValue를 contain하면, false를 반환한다.
  2. true를 반환한다.
WithStatement : with ( Expression ) Statement
  1. arguments iterationSet와 « »를 가진 StatementContainsUndefinedContinueTarget을 반환한다.
SwitchStatement : switch ( Expression ) CaseBlock
  1. arguments iterationSet와 « »를 가진 CaseBlockContainsUndefinedContinueTarget을 반환한다.
CaseBlock : { }
  1. false를 반환한다.
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 첫 번째 CaseClauses가 present하면, 다음을 수행한다.
    1. arguments iterationSet와 « »를 가진 첫 번째 CaseClausesContainsUndefinedContinueTargettrue이면, true를 반환한다.
  2. arguments iterationSet와 « »를 가진 DefaultClauseContainsUndefinedContinueTargettrue이면, true를 반환한다.
  3. 두 번째 CaseClauses가 present하지 않으면, false를 반환한다.
  4. arguments iterationSet와 « »를 가진 두 번째 CaseClausesContainsUndefinedContinueTarget을 반환한다.
CaseClauses : CaseClauses CaseClause
  1. hasUndefinedLabels를 arguments iterationSet와 « »를 가진 CaseClausesContainsUndefinedContinueTarget으로 둔다.
  2. hasUndefinedLabelstrue이면, true를 반환한다.
  3. arguments iterationSet와 « »를 가진 CaseClauseContainsUndefinedContinueTarget을 반환한다.
CaseClause : case Expression : StatementListopt
  1. StatementList가 present하면, arguments iterationSet와 « »를 가진 StatementListContainsUndefinedContinueTarget을 반환한다.
  2. false를 반환한다.
DefaultClause : default : StatementListopt
  1. StatementList가 present하면, arguments iterationSet와 « »를 가진 StatementListContainsUndefinedContinueTarget을 반환한다.
  2. false를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. labelLabelIdentifierStringValue로 둔다.
  2. newLabelSetlabelSet와 « label »의 list-concatenation으로 둔다.
  3. arguments iterationSetnewLabelSet를 가진 LabelledItemContainsUndefinedContinueTarget을 반환한다.
LabelledItem : FunctionDeclaration
  1. false를 반환한다.
TryStatement : try Block Catch
  1. hasUndefinedLabels를 arguments iterationSet와 « »를 가진 BlockContainsUndefinedContinueTarget으로 둔다.
  2. hasUndefinedLabelstrue이면, true를 반환한다.
  3. arguments iterationSet와 « »를 가진 CatchContainsUndefinedContinueTarget을 반환한다.
TryStatement : try Block Finally
  1. hasUndefinedLabels를 arguments iterationSet와 « »를 가진 BlockContainsUndefinedContinueTarget으로 둔다.
  2. hasUndefinedLabelstrue이면, true를 반환한다.
  3. arguments iterationSet와 « »를 가진 FinallyContainsUndefinedContinueTarget을 반환한다.
TryStatement : try Block Catch Finally
  1. arguments iterationSet와 « »를 가진 BlockContainsUndefinedContinueTargettrue이면, true를 반환한다.
  2. arguments iterationSet와 « »를 가진 CatchContainsUndefinedContinueTargettrue이면, true를 반환한다.
  3. arguments iterationSet와 « »를 가진 FinallyContainsUndefinedContinueTarget을 반환한다.
Catch : catch ( CatchParameter ) Block
  1. arguments iterationSet와 « »를 가진 BlockContainsUndefinedContinueTarget을 반환한다.
FunctionStatementList : [empty]
  1. false를 반환한다.
ClassStaticBlockStatementList : [empty]
  1. false를 반환한다.
ModuleItemList : ModuleItemList ModuleItem
  1. hasUndefinedLabels를 arguments iterationSet와 « »를 가진 ModuleItemListContainsUndefinedContinueTarget으로 둔다.
  2. hasUndefinedLabelstrue이면, true를 반환한다.
  3. arguments iterationSet와 « »를 가진 ModuleItemContainsUndefinedContinueTarget을 반환한다.
ModuleItem : ImportDeclaration ExportDeclaration
  1. false를 반환한다.

8.4 Function Name Inference

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. exprCoverParenthesizedExpressionAndArrowParameterList가 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. exprCoverParenthesizedExpressionAndArrowParameterList가 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. argument가 name을 bind하지 않는 function definition인지 determine합니다. 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. exprCoverParenthesizedExpressionAndArrowParameterList가 cover하는 ParenthesizedExpression으로 둔다.
  2. argument name을 가진 exprNamedEvaluation을 ? 반환한다.
ParenthesizedExpression : ( Expression )
  1. Assert: IsAnonymousFunctionDefinition(Expression)은 true이다.
  2. argument name을 가진 ExpressionNamedEvaluation을 ? 반환한다.
FunctionExpression : function ( FormalParameters ) { FunctionBody }
  1. argument name을 가진 FunctionExpressionInstantiateOrdinaryFunctionExpression을 반환한다.
GeneratorExpression : function * ( FormalParameters ) { GeneratorBody }
  1. argument name을 가진 GeneratorExpressionInstantiateGeneratorFunctionExpression을 반환한다.
AsyncGeneratorExpression : async function * ( FormalParameters ) { AsyncGeneratorBody }
  1. argument name을 가진 AsyncGeneratorExpressionInstantiateAsyncGeneratorFunctionExpression을 반환한다.
AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
  1. argument name을 가진 AsyncFunctionExpressionInstantiateAsyncFunctionExpression을 반환한다.
ArrowFunction : ArrowParameters => ConciseBody
  1. argument name을 가진 ArrowFunctionInstantiateArrowFunctionExpression을 반환한다.
AsyncArrowFunction : async AsyncArrowBindingIdentifier => AsyncConciseBody CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
  1. argument name을 가진 AsyncArrowFunctionInstantiateAsyncArrowFunctionExpression을 반환한다.
ClassExpression : class ClassTail
  1. sourceTextClassExpression에 matched된 source text로 둔다.
  2. arguments undefined, name, 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.

아래에 listed되지 않은 이 명세의 모든 grammar production alternative는 implicitly 다음 default definition of Contains를 가집니다:

  1. Parse Node의 각 child node child에 대해, 다음을 수행한다.
    1. childsymbol의 instance이면, true를 반환한다.
    2. child가 nonterminal의 instance이면, 다음을 수행한다.
      1. containedchild Contains symbol의 result로 둔다.
      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

substructure에 depend하는 static semantic rule은 일반적으로 function definition 내부를 look into하지 않습니다.

ClassTail : ClassHeritageopt { ClassBody }
  1. symbolClassBody이면, true를 반환한다.
  2. symbolClassHeritage이면, 다음을 수행한다.
    1. ClassHeritage가 present하면, true를 반환한다.
    2. false를 반환한다.
  3. ClassHeritage가 present하면, 다음을 수행한다.
    1. ClassHeritage Contains symboltrue이면, true를 반환한다.
  4. argument symbol을 가진 ClassBodyComputedPropertyContains의 result를 반환한다.
Note 2

substructure에 depend하는 static semantic rule은 일반적으로 PropertyName을 제외하고 class body 내부를 look into하지 않습니다.

ClassStaticBlock : static { ClassStaticBlockBody }
  1. false를 반환한다.
Note 3

substructure에 depend하는 static semantic rule은 일반적으로 static initialization block 내부를 look into하지 않습니다.

ArrowFunction : ArrowParameters => ConciseBody
  1. symbolNewTarget, SuperProperty, SuperCall, super, 또는 this 중 하나가 아니면, false를 반환한다.
  2. ArrowParameters Contains symboltrue이면, true를 반환한다.
  3. ConciseBody Contains symbol을 반환한다.
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
  1. formalsCoverParenthesizedExpressionAndArrowParameterList가 cover하는 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가 cover하는 AsyncArrowHead로 둔다.
  3. head Contains symboltrue이면, true를 반환한다.
  4. AsyncConciseBody Contains symbol을 반환한다.
Note 4

Contains는 ArrowFunction 또는 AsyncArrowFunction 안에서 new.target, this, super usage를 detect하는 데 사용됩니다.

PropertyDefinition : MethodDefinition
  1. symbolMethodDefinition이면, true를 반환한다.
  2. argument symbol을 가진 MethodDefinitionComputedPropertyContains의 result를 반환한다.
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의 result를 반환한다.
MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody } get ClassElementName ( ) { FunctionBody } set ClassElementName ( PropertySetParameterList ) { FunctionBody }
  1. argument symbol을 가진 ClassElementNameComputedPropertyContains의 result를 반환한다.
GeneratorMethod : * ClassElementName ( UniqueFormalParameters ) { GeneratorBody }
  1. argument symbol을 가진 ClassElementNameComputedPropertyContains의 result를 반환한다.
AsyncGeneratorMethod : async * ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody }
  1. argument symbol을 가진 ClassElementNameComputedPropertyContains의 result를 반환한다.
ClassElementList : ClassElementList ClassElement
  1. inList를 argument symbol을 가진 ClassElementListComputedPropertyContains로 둔다.
  2. inListtrue이면, true를 반환한다.
  3. argument symbol을 가진 ClassElementComputedPropertyContains의 result를 반환한다.
ClassElement : ClassStaticBlock
  1. false를 반환한다.
ClassElement : ;
  1. false를 반환한다.
AsyncMethod : async ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody }
  1. argument symbol을 가진 ClassElementNameComputedPropertyContains의 result를 반환한다.
FieldDefinition : ClassElementName Initializeropt
  1. argument symbol을 가진 ClassElementNameComputedPropertyContains의 result를 반환한다.

8.6 Miscellaneous

이 operation들은 명세 전반의 여러 곳에서 사용됩니다.

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. arguments envRecordprivateEnv를 가진 FunctionDeclarationInstantiateOrdinaryFunctionObject를 반환한다.
GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } function * ( FormalParameters ) { GeneratorBody }
  1. arguments envRecordprivateEnv를 가진 GeneratorDeclarationInstantiateGeneratorFunctionObject를 반환한다.
AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } async function * ( FormalParameters ) { AsyncGeneratorBody }
  1. arguments envRecordprivateEnv를 가진 AsyncGeneratorDeclarationInstantiateAsyncGeneratorFunctionObject를 반환한다.
AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } async function ( FormalParameters ) { AsyncFunctionBody }
  1. arguments envRecordprivateEnv를 가진 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

undefined는 initialization value를 assign하기 위해 PutValue operation을 사용해야 함을 나타내기 위해 envRecord로 passed됩니다. 이는 var statement와 일부 non-strict function의 formal parameter list의 경우입니다(10.2.11 참조). 이러한 경우 lexical binding은 initializer의 evaluation 전에 hoisted되고 preinitialized됩니다.

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. arguments valueenvRecord를 가진 ObjectBindingPatternBindingInitialization을 ? 반환한다.
BindingPattern : ArrayBindingPattern
  1. iteratorRecord를 ? GetIterator(value, sync)로 둔다.
  2. result를 arguments iteratorRecordenvRecord를 가진 ArrayBindingPatternIteratorBindingInitializationCompletion으로 둔다.
  3. iteratorRecord.[[Done]]false이면, IteratorClose(iteratorRecord, result)를 ? 반환한다.
  4. result를 ? 반환한다.
ObjectBindingPattern : { }
  1. unused를 반환한다.
ObjectBindingPattern : { BindingPropertyList } { BindingPropertyList , }
  1. arguments valueenvRecord를 가진 BindingPropertyListPropertyBindingInitialization을 ? 수행한다.
  2. unused를 반환한다.
ObjectBindingPattern : { BindingRestProperty }
  1. excludedNames를 새 empty List로 둔다.
  2. arguments value, envRecord, excludedNames를 가진 BindingRestPropertyRestBindingInitialization을 ? 반환한다.
ObjectBindingPattern : { BindingPropertyList , BindingRestProperty }
  1. excludedNames를 arguments valueenvRecord를 가진 BindingPropertyListPropertyBindingInitialization으로 ? 둔다.
  2. arguments value, envRecord, 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

undefinedenvRecord로 passed되면 initialization value를 assign하기 위해 PutValue operation을 사용해야 함을 나타냅니다. 이는 non-strict function의 formal parameter list의 경우입니다. 그 경우 formal parameter binding은 같은 name을 가진 multiple parameter의 possibility를 처리하기 위해 preinitialized됩니다.

It is defined piecewise over the following productions:

ArrayBindingPattern : [ ]
  1. unused를 반환한다.
ArrayBindingPattern : [ Elision ]
  1. argument iteratorRecord를 가진 ElisionIteratorDestructuringAssignmentEvaluation을 ? 반환한다.
ArrayBindingPattern : [ Elisionopt BindingRestElement ]
  1. Elision이 present하면, 다음을 수행한다.
    1. argument iteratorRecord를 가진 ElisionIteratorDestructuringAssignmentEvaluation을 ? 수행한다.
  2. arguments iteratorRecordenvRecord를 가진 BindingRestElementIteratorBindingInitialization을 ? 반환한다.
ArrayBindingPattern : [ BindingElementList , Elision ]
  1. arguments iteratorRecordenvRecord를 가진 BindingElementListIteratorBindingInitialization을 ? 수행한다.
  2. argument iteratorRecord를 가진 ElisionIteratorDestructuringAssignmentEvaluation을 ? 반환한다.
ArrayBindingPattern : [ BindingElementList , Elisionopt BindingRestElement ]
  1. arguments iteratorRecordenvRecord를 가진 BindingElementListIteratorBindingInitialization을 ? 수행한다.
  2. Elision이 present하면, 다음을 수행한다.
    1. argument iteratorRecord를 가진 ElisionIteratorDestructuringAssignmentEvaluation을 ? 수행한다.
  3. arguments iteratorRecordenvRecord를 가진 BindingRestElementIteratorBindingInitialization을 ? 반환한다.
BindingElementList : BindingElementList , BindingElisionElement
  1. arguments iteratorRecordenvRecord를 가진 BindingElementListIteratorBindingInitialization을 ? 수행한다.
  2. arguments iteratorRecordenvRecord를 가진 BindingElisionElementIteratorBindingInitialization을 ? 반환한다.
BindingElisionElement : Elision BindingElement
  1. argument iteratorRecord를 가진 ElisionIteratorDestructuringAssignmentEvaluation을 ? 수행한다.
  2. arguments iteratorRecordenvRecord를 가진 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가 present하고 vundefined이면, 다음을 수행한다.
    1. IsAnonymousFunctionDefinition(Initializer)이 true이면, 다음을 수행한다.
      1. v를 argument 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가 present하고 vundefined이면, 다음을 수행한다.
    1. defaultValueInitializerEvaluation으로 ? 둔다.
    2. v를 ? GetValue(defaultValue)로 설정한다.
  4. arguments venvRecord를 가진 BindingPatternBindingInitialization을 ? 반환한다.
BindingRestElement : ... BindingIdentifier
  1. lhs를 ? ResolveBinding(BindingIdentifierStringValue, envRecord)로 둔다.
  2. array를 ! ArrayCreate(0)으로 둔다.
  3. n을 0으로 둔다.
  4. Repeat,
    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. Repeat,
    1. nextdone으로 둔다.
    2. iteratorRecord.[[Done]]false이면, 다음을 수행한다.
      1. next를 ? IteratorStepValue(iteratorRecord)로 설정한다.
    3. nextdone이면, 다음을 수행한다.
      1. arguments arrayenvRecord를 가진 BindingPatternBindingInitialization을 ? 반환한다.
    4. CreateDataPropertyOrThrow(array, ! ToString(𝔽(n)), next)를 수행한다.
    5. nn + 1로 설정한다.
FormalParameters : [empty]
  1. unused를 반환한다.
FormalParameters : FormalParameterList , FunctionRestParameter
  1. arguments iteratorRecordenvRecord를 가진 FormalParameterListIteratorBindingInitialization을 ? 수행한다.
  2. arguments iteratorRecordenvRecord를 가진 FunctionRestParameterIteratorBindingInitialization을 ? 반환한다.
FormalParameterList : FormalParameterList , FormalParameter
  1. arguments iteratorRecordenvRecord를 가진 FormalParameterListIteratorBindingInitialization을 ? 수행한다.
  2. arguments iteratorRecordenvRecord를 가진 FormalParameterIteratorBindingInitialization을 ? 반환한다.
ArrowParameters : BindingIdentifier
  1. vundefined로 둔다.
  2. Assert: iteratorRecord.[[Done]]false이다.
  3. next를 ? IteratorStepValue(iteratorRecord)로 둔다.
  4. nextdone이 아니면, 다음을 수행한다.
    1. vnext로 설정한다.
  5. arguments venvRecord를 가진 BindingIdentifierBindingInitialization을 ? 반환한다.
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
  1. formalsCoverParenthesizedExpressionAndArrowParameterList가 cover하는 ArrowFormalParameters로 둔다.
  2. arguments iteratorRecordenvRecord를 가진 formalsIteratorBindingInitialization을 ? 반환한다.
AsyncArrowBindingIdentifier : BindingIdentifier
  1. vundefined로 둔다.
  2. Assert: iteratorRecord.[[Done]]false이다.
  3. next를 ? IteratorStepValue(iteratorRecord)로 둔다.
  4. nextdone이 아니면, 다음을 수행한다.
    1. vnext로 설정한다.
  5. arguments venvRecord를 가진 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. exprCoverParenthesizedExpressionAndArrowParameterList가 cover하는 ParenthesizedExpression으로 둔다.
  2. exprAssignmentTargetType을 반환한다.
CallExpression : CoverCallExpressionAndAsyncArrowHead CallExpression Arguments
  1. host가 web browser이거나 그 밖에 Function Call Assignment Targets에 대한 Runtime Errors를 support하고 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를 반환한다.