8 구문 지향 연산(Syntax-Directed Operations)

이 절에서 정의된 것들 외에도, 특수화된 구문 지향 연산들이 이 명세 전반에 걸쳐 정의된다.

8.1 런타임 의미론: Evaluation : Completion Record

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS.

Note
이 연산의 정의는 이 명세의 "ECMAScript Language" 절들에 분산되어 있다. 각 정의는 관련 생성규칙(production)이 정의적으로 등장한 직후에 나타난다.

8.2 스코프 분석(Scope Analysis)

8.2.1 정적 의미론: BoundNames : 문자열들의 List

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS.

Note

"*default*" 문자열은 모듈의 기본(default) export가 다른 이름을 가지지 않을 때 그 모듈의 기본 export를 위한 합성된 이름으로 이 명세 내부에서 사용된다. 모듈의 [[Environment]] 내에 그 이름으로 항목이 생성되어 해당 값을 보유하고, 모듈에 대해 ResolveExport ( exportName [ , resolveSet ] )를 호출하여 "default"라는 export를 해석하면 [[BindingName]]"*default*"ResolvedBinding Record를 반환하며, 이는 모듈 [[Environment]]에서 상술한 값으로 다시 해석된다. 이는 명세 편의를 위한 것이며, 익명 기본 export도 다른 export와 동일하게 해석될 수 있도록 한다. 이 "*default*" 문자열은 ECMAScript 코드나 모듈 링크 알고리즘에서 접근될 수 없다.

It is defined piecewise over the following productions:

BindingIdentifier : Identifier
  1. Identifier의 StringValue만을 요소로 갖는 List를 반환한다.
BindingIdentifier : yield
  1. « "yield" » 를 반환한다.
BindingIdentifier : await
  1. « "await" » 를 반환한다.
LexicalDeclaration : LetOrConst BindingList ;
  1. BindingList의 BoundNames를 반환한다.
BindingList : BindingList , LexicalBinding
  1. names1BindingList의 BoundNames로 둔다.
  2. names2LexicalBinding의 BoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
LexicalBinding : BindingIdentifier Initializeropt
  1. BindingIdentifier의 BoundNames를 반환한다.
LexicalBinding : BindingPattern Initializer
  1. BindingPattern의 BoundNames를 반환한다.
VariableDeclarationList : VariableDeclarationList , VariableDeclaration
  1. names1VariableDeclarationList의 BoundNames로 둔다.
  2. names2VariableDeclaration의 BoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
VariableDeclaration : BindingIdentifier Initializeropt
  1. BindingIdentifier의 BoundNames를 반환한다.
VariableDeclaration : BindingPattern Initializer
  1. BindingPattern의 BoundNames를 반환한다.
ObjectBindingPattern : { }
  1. 새 빈 List를 반환한다.
ObjectBindingPattern : { BindingPropertyList , BindingRestProperty }
  1. names1BindingPropertyList의 BoundNames로 둔다.
  2. names2BindingRestProperty의 BoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
ArrayBindingPattern : [ Elisionopt ]
  1. 새 빈 List를 반환한다.
ArrayBindingPattern : [ Elisionopt BindingRestElement ]
  1. BindingRestElement의 BoundNames를 반환한다.
ArrayBindingPattern : [ BindingElementList , Elisionopt ]
  1. BindingElementList의 BoundNames를 반환한다.
ArrayBindingPattern : [ BindingElementList , Elisionopt BindingRestElement ]
  1. names1BindingElementList의 BoundNames로 둔다.
  2. names2BindingRestElement의 BoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
BindingPropertyList : BindingPropertyList , BindingProperty
  1. names1BindingPropertyList의 BoundNames로 둔다.
  2. names2BindingProperty의 BoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
BindingElementList : BindingElementList , BindingElisionElement
  1. names1BindingElementList의 BoundNames로 둔다.
  2. names2BindingElisionElement의 BoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
BindingElisionElement : Elisionopt BindingElement
  1. BindingElement의 BoundNames를 반환한다.
BindingProperty : PropertyName : BindingElement
  1. BindingElement의 BoundNames를 반환한다.
SingleNameBinding : BindingIdentifier Initializeropt
  1. BindingIdentifier의 BoundNames를 반환한다.
BindingElement : BindingPattern Initializeropt
  1. BindingPattern의 BoundNames를 반환한다.
ForDeclaration : LetOrConst ForBinding
  1. ForBinding의 BoundNames를 반환한다.
FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
  1. BindingIdentifier의 BoundNames를 반환한다.
FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
  1. « "*default*" » 를 반환한다.
FormalParameters : [empty]
  1. 새 빈 List를 반환한다.
FormalParameters : FormalParameterList , FunctionRestParameter
  1. names1FormalParameterList의 BoundNames로 둔다.
  2. names2FunctionRestParameter의 BoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
FormalParameterList : FormalParameterList , FormalParameter
  1. names1FormalParameterList의 BoundNames로 둔다.
  2. names2FormalParameter의 BoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
  1. formalsCoverParenthesizedExpressionAndArrowParameterList가 커버하는 ArrowFormalParameters로 둔다.
  2. formals의 BoundNames를 반환한다.
GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
  1. BindingIdentifier의 BoundNames를 반환한다.
GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
  1. « "*default*" » 를 반환한다.
AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
  1. BindingIdentifier의 BoundNames를 반환한다.
AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
  1. « "*default*" » 를 반환한다.
ClassDeclaration : class BindingIdentifier ClassTail
  1. BindingIdentifier의 BoundNames를 반환한다.
ClassDeclaration : class ClassTail
  1. « "*default*" » 를 반환한다.
AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
  1. BindingIdentifier의 BoundNames를 반환한다.
AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
  1. « "*default*" » 를 반환한다.
CoverCallExpressionAndAsyncArrowHead : MemberExpression Arguments
  1. headCoverCallExpressionAndAsyncArrowHead가 커버하는 AsyncArrowHead로 둔다.
  2. head의 BoundNames를 반환한다.
ImportDeclaration : import ImportClause FromClause WithClauseopt ;
  1. ImportClause의 BoundNames를 반환한다.
ImportDeclaration : import ModuleSpecifier WithClauseopt ;
  1. 새 빈 List를 반환한다.
ImportClause : ImportedDefaultBinding , NameSpaceImport
  1. names1ImportedDefaultBinding의 BoundNames로 둔다.
  2. names2NameSpaceImport의 BoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
ImportClause : ImportedDefaultBinding , NamedImports
  1. names1ImportedDefaultBinding의 BoundNames로 둔다.
  2. names2NamedImports의 BoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
NamedImports : { }
  1. 새 빈 List를 반환한다.
ImportsList : ImportsList , ImportSpecifier
  1. names1ImportsList의 BoundNames로 둔다.
  2. names2ImportSpecifier의 BoundNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
ImportSpecifier : ModuleExportName as ImportedBinding
  1. ImportedBinding의 BoundNames를 반환한다.
ExportDeclaration : export ExportFromClause FromClause WithClauseopt ; export NamedExports ;
  1. 새 빈 List를 반환한다.
ExportDeclaration : export VariableStatement
  1. VariableStatement의 BoundNames를 반환한다.
ExportDeclaration : export Declaration
  1. Declaration의 BoundNames를 반환한다.
ExportDeclaration : export default HoistableDeclaration
  1. declarationNamesHoistableDeclaration의 BoundNames로 둔다.
  2. declarationNames"*default*" 요소가 없으면 "*default*"declarationNames에 추가한다.
  3. declarationNames를 반환한다.
ExportDeclaration : export default ClassDeclaration
  1. declarationNamesClassDeclaration의 BoundNames로 둔다.
  2. declarationNames"*default*" 요소가 없으면 "*default*"declarationNames에 추가한다.
  3. declarationNames를 반환한다.
ExportDeclaration : export default AssignmentExpression ;
  1. « "*default*" » 를 반환한다.

8.2.2 정적 의미론: DeclarationPart : Parse Node

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

HoistableDeclaration : FunctionDeclaration
  1. FunctionDeclaration을 반환한다.
HoistableDeclaration : GeneratorDeclaration
  1. GeneratorDeclaration을 반환한다.
HoistableDeclaration : AsyncFunctionDeclaration
  1. AsyncFunctionDeclaration을 반환한다.
HoistableDeclaration : AsyncGeneratorDeclaration
  1. AsyncGeneratorDeclaration을 반환한다.
Declaration : ClassDeclaration
  1. ClassDeclaration을 반환한다.
Declaration : LexicalDeclaration
  1. LexicalDeclaration을 반환한다.

8.2.3 정적 의미론: IsConstantDeclaration : Boolean

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

LexicalDeclaration : LetOrConst BindingList ;
  1. LetOrConst의 IsConstantDeclaration을 반환한다.
LetOrConst : let
  1. false를 반환한다.
LetOrConst : const
  1. true를 반환한다.
FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody } function ( FormalParameters ) { FunctionBody } GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } function * ( FormalParameters ) { GeneratorBody } AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } async function * ( FormalParameters ) { AsyncGeneratorBody } AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } async function ( FormalParameters ) { AsyncFunctionBody }
  1. false를 반환한다.
ClassDeclaration : class BindingIdentifier ClassTail class ClassTail
  1. false를 반환한다.
ExportDeclaration : export ExportFromClause FromClause ; export NamedExports ; export default AssignmentExpression ;
  1. false를 반환한다.
Note

export default AssignmentExpression을 상수 선언으로 다룰 필요는 없다. 이는 모듈의 기본 객체를 참조하는 내부 바운드 이름에 대입을 허용하는 구문이 존재하지 않기 때문이다.

8.2.4 정적 의미론: LexicallyDeclaredNames : 문자열들의 List

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

Block : { }
  1. 새 빈 List를 반환한다.
StatementList : StatementList StatementListItem
  1. names1StatementList의 LexicallyDeclaredNames로 둔다.
  2. names2StatementListItem의 LexicallyDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
StatementListItem : Statement
  1. Statement Statement : LabelledStatement 이면 LabelledStatement의 LexicallyDeclaredNames를 반환한다.
  2. 새 빈 List를 반환한다.
StatementListItem : Declaration
  1. Declaration의 BoundNames를 반환한다.
CaseBlock : { }
  1. 새 빈 List를 반환한다.
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 첫 번째 CaseClauses가 존재하면 names1을 그 LexicallyDeclaredNames로 둔다.
  2. 아니면 names1을 새 빈 List로 둔다.
  3. names2DefaultClause의 LexicallyDeclaredNames로 둔다.
  4. 두 번째 CaseClauses가 존재하면 names3을 그 LexicallyDeclaredNames로 둔다.
  5. 아니면 names3을 새 빈 List로 둔다.
  6. names1, names2, names3list-concatenation을 반환한다.
CaseClauses : CaseClauses CaseClause
  1. names1CaseClauses의 LexicallyDeclaredNames로 둔다.
  2. names2CaseClause의 LexicallyDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
CaseClause : case Expression : StatementListopt
  1. StatementList가 존재하면 StatementList의 LexicallyDeclaredNames를 반환한다.
  2. 새 빈 List를 반환한다.
DefaultClause : default : StatementListopt
  1. StatementList가 존재하면 StatementList의 LexicallyDeclaredNames를 반환한다.
  2. 새 빈 List를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItem의 LexicallyDeclaredNames를 반환한다.
LabelledItem : Statement
  1. 새 빈 List를 반환한다.
LabelledItem : FunctionDeclaration
  1. FunctionDeclaration의 BoundNames를 반환한다.
FunctionStatementList : [empty]
  1. 새 빈 List를 반환한다.
FunctionStatementList : StatementList
  1. StatementList의 TopLevelLexicallyDeclaredNames를 반환한다.
ClassStaticBlockStatementList : [empty]
  1. 새 빈 List를 반환한다.
ClassStaticBlockStatementList : StatementList
  1. StatementList의 TopLevelLexicallyDeclaredNames를 반환한다.
ConciseBody : ExpressionBody
  1. 새 빈 List를 반환한다.
AsyncConciseBody : ExpressionBody
  1. 새 빈 List를 반환한다.
Script : [empty]
  1. 새 빈 List를 반환한다.
ScriptBody : StatementList
  1. StatementList의 TopLevelLexicallyDeclaredNames를 반환한다.
Note 1

Script의 최상위(top level)에서 함수 선언은 lexical 선언이 아닌 var 선언처럼 다루어진다.

Note 2

Module의 LexicallyDeclaredNames에는 모든 import된 바인딩의 이름이 포함된다.

ModuleItemList : ModuleItemList ModuleItem
  1. names1ModuleItemList의 LexicallyDeclaredNames로 둔다.
  2. names2ModuleItem의 LexicallyDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
ModuleItem : ImportDeclaration
  1. ImportDeclaration의 BoundNames를 반환한다.
ModuleItem : ExportDeclaration
  1. ExportDeclarationexport VariableStatement이면 새 빈 List를 반환한다.
  2. ExportDeclaration의 BoundNames를 반환한다.
ModuleItem : StatementListItem
  1. StatementListItem의 LexicallyDeclaredNames를 반환한다.
Note 3

Module의 최상위에서는 함수 선언이 var 선언이 아닌 lexical 선언처럼 다루어진다.

8.2.5 정적 의미론: LexicallyScopedDeclarations : Parse Node들의 List

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

StatementList : StatementList StatementListItem
  1. declarations1StatementList의 LexicallyScopedDeclarations로 둔다.
  2. declarations2StatementListItem의 LexicallyScopedDeclarations로 둔다.
  3. declarations1declarations2list-concatenation을 반환한다.
StatementListItem : Statement
  1. Statement Statement : LabelledStatement 이면 LabelledStatement의 LexicallyScopedDeclarations를 반환한다.
  2. 새 빈 List를 반환한다.
StatementListItem : Declaration
  1. Declaration의 DeclarationPart만을 요소로 갖는 List를 반환한다.
CaseBlock : { }
  1. 새 빈 List를 반환한다.
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 첫 번째 CaseClauses가 존재하면 declarations1을 그 LexicallyScopedDeclarations로 둔다.
  2. 아니면 declarations1을 새 빈 List로 둔다.
  3. declarations2DefaultClause의 LexicallyScopedDeclarations로 둔다.
  4. 두 번째 CaseClauses가 존재하면 declarations3을 그 LexicallyScopedDeclarations로 둔다.
  5. 아니면 declarations3을 새 빈 List로 둔다.
  6. declarations1, declarations2, declarations3list-concatenation을 반환한다.
CaseClauses : CaseClauses CaseClause
  1. declarations1CaseClauses의 LexicallyScopedDeclarations로 둔다.
  2. declarations2CaseClause의 LexicallyScopedDeclarations로 둔다.
  3. declarations1declarations2list-concatenation을 반환한다.
CaseClause : case Expression : StatementListopt
  1. StatementList가 존재하면 StatementList의 LexicallyScopedDeclarations를 반환한다.
  2. 새 빈 List를 반환한다.
DefaultClause : default : StatementListopt
  1. StatementList가 존재하면 StatementList의 LexicallyScopedDeclarations를 반환한다.
  2. 새 빈 List를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItem의 LexicallyScopedDeclarations를 반환한다.
LabelledItem : Statement
  1. 새 빈 List를 반환한다.
LabelledItem : FunctionDeclaration
  1. « FunctionDeclaration » 를 반환한다.
FunctionStatementList : [empty]
  1. 새 빈 List를 반환한다.
FunctionStatementList : StatementList
  1. StatementList의 TopLevelLexicallyScopedDeclarations를 반환한다.
ClassStaticBlockStatementList : [empty]
  1. 새 빈 List를 반환한다.
ClassStaticBlockStatementList : StatementList
  1. StatementList의 TopLevelLexicallyScopedDeclarations를 반환한다.
ConciseBody : ExpressionBody
  1. 새 빈 List를 반환한다.
AsyncConciseBody : ExpressionBody
  1. 새 빈 List를 반환한다.
Script : [empty]
  1. 새 빈 List를 반환한다.
ScriptBody : StatementList
  1. StatementList의 TopLevelLexicallyScopedDeclarations를 반환한다.
Module : [empty]
  1. 새 빈 List를 반환한다.
ModuleItemList : ModuleItemList ModuleItem
  1. declarations1ModuleItemList의 LexicallyScopedDeclarations로 둔다.
  2. declarations2ModuleItem의 LexicallyScopedDeclarations로 둔다.
  3. declarations1declarations2list-concatenation을 반환한다.
ModuleItem : ImportDeclaration
  1. 새 빈 List를 반환한다.
ExportDeclaration : export ExportFromClause FromClause WithClauseopt ; export NamedExports ; export VariableStatement
  1. 새 빈 List를 반환한다.
ExportDeclaration : export Declaration
  1. Declaration의 DeclarationPart만을 요소로 갖는 List를 반환한다.
ExportDeclaration : export default HoistableDeclaration
  1. HoistableDeclaration의 DeclarationPart만을 요소로 갖는 List를 반환한다.
ExportDeclaration : export default ClassDeclaration
  1. ClassDeclaration만을 요소로 갖는 List를 반환한다.
ExportDeclaration : export default AssignmentExpression ;
  1. ExportDeclaration만을 요소로 갖는 List를 반환한다.

8.2.6 정적 의미론: VarDeclaredNames : 문자열들의 List

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

Statement : EmptyStatement ExpressionStatement ContinueStatement BreakStatement ReturnStatement ThrowStatement DebuggerStatement
  1. 새 빈 List를 반환한다.
Block : { }
  1. 새 빈 List를 반환한다.
StatementList : StatementList StatementListItem
  1. names1StatementList의 VarDeclaredNames로 둔다.
  2. names2StatementListItem의 VarDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
StatementListItem : Declaration
  1. 새 빈 List를 반환한다.
VariableStatement : var VariableDeclarationList ;
  1. VariableDeclarationList의 BoundNames를 반환한다.
IfStatement : if ( Expression ) Statement else Statement
  1. names1을 첫 번째 Statement의 VarDeclaredNames로 둔다.
  2. names2를 두 번째 Statement의 VarDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
IfStatement : if ( Expression ) Statement
  1. Statement의 VarDeclaredNames를 반환한다.
DoWhileStatement : do Statement while ( Expression ) ;
  1. Statement의 VarDeclaredNames를 반환한다.
WhileStatement : while ( Expression ) Statement
  1. Statement의 VarDeclaredNames를 반환한다.
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement
  1. Statement의 VarDeclaredNames를 반환한다.
ForStatement : for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement
  1. names1VariableDeclarationList의 BoundNames로 둔다.
  2. names2Statement의 VarDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
ForStatement : for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. Statement의 VarDeclaredNames를 반환한다.
ForInOfStatement : for ( LeftHandSideExpression in Expression ) Statement for ( ForDeclaration in Expression ) Statement for ( LeftHandSideExpression of AssignmentExpression ) Statement for ( ForDeclaration of AssignmentExpression ) Statement for await ( LeftHandSideExpression of AssignmentExpression ) Statement for await ( ForDeclaration of AssignmentExpression ) Statement
  1. Statement의 VarDeclaredNames를 반환한다.
ForInOfStatement : for ( var ForBinding in Expression ) Statement for ( var ForBinding of AssignmentExpression ) Statement for await ( var ForBinding of AssignmentExpression ) Statement
  1. names1을 « ForBinding »으로 둔다.
  2. names2Statement의 VarDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
Note

이 절은 부록(Annex) B.3.5에 의해 확장된다.

WithStatement : with ( Expression ) Statement
  1. Statement의 VarDeclaredNames를 반환한다.
SwitchStatement : switch ( Expression ) CaseBlock
  1. CaseBlock의 VarDeclaredNames를 반환한다.
CaseBlock : { }
  1. 새 빈 List를 반환한다.
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 첫 번째 CaseClauses가 존재하면 names1을 그 VarDeclaredNames로 둔다.
  2. 아니면 names1을 새 빈 List로 둔다.
  3. names2DefaultClause의 VarDeclaredNames로 둔다.
  4. 두 번째 CaseClauses가 존재하면 names3을 그 VarDeclaredNames로 둔다.
  5. 아니면 names3을 새 빈 List로 둔다.
  6. names1, names2, names3list-concatenation을 반환한다.
CaseClauses : CaseClauses CaseClause
  1. names1CaseClauses의 VarDeclaredNames로 둔다.
  2. names2CaseClause의 VarDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
CaseClause : case Expression : StatementListopt
  1. StatementList가 존재하면 StatementList의 VarDeclaredNames를 반환한다.
  2. 새 빈 List를 반환한다.
DefaultClause : default : StatementListopt
  1. StatementList가 존재하면 StatementList의 VarDeclaredNames를 반환한다.
  2. 새 빈 List를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItem의 VarDeclaredNames를 반환한다.
LabelledItem : FunctionDeclaration
  1. 새 빈 List를 반환한다.
TryStatement : try Block Catch
  1. names1Block의 VarDeclaredNames로 둔다.
  2. names2Catch의 VarDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
TryStatement : try Block Finally
  1. names1Block의 VarDeclaredNames로 둔다.
  2. names2Finally의 VarDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
TryStatement : try Block Catch Finally
  1. names1Block의 VarDeclaredNames로 둔다.
  2. names2Catch의 VarDeclaredNames로 둔다.
  3. names3Finally의 VarDeclaredNames로 둔다.
  4. names1, names2, names3list-concatenation을 반환한다.
Catch : catch ( CatchParameter ) Block
  1. Block의 VarDeclaredNames를 반환한다.
FunctionStatementList : [empty]
  1. 새 빈 List를 반환한다.
FunctionStatementList : StatementList
  1. StatementList의 TopLevelVarDeclaredNames를 반환한다.
ClassStaticBlockStatementList : [empty]
  1. 새 빈 List를 반환한다.
ClassStaticBlockStatementList : StatementList
  1. StatementList의 TopLevelVarDeclaredNames를 반환한다.
ConciseBody : ExpressionBody
  1. 새 빈 List를 반환한다.
AsyncConciseBody : ExpressionBody
  1. 새 빈 List를 반환한다.
Script : [empty]
  1. 새 빈 List를 반환한다.
ScriptBody : StatementList
  1. StatementList의 TopLevelVarDeclaredNames를 반환한다.
ModuleItemList : ModuleItemList ModuleItem
  1. names1ModuleItemList의 VarDeclaredNames로 둔다.
  2. names2ModuleItem의 VarDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
ModuleItem : ImportDeclaration
  1. 새 빈 List를 반환한다.
ModuleItem : ExportDeclaration
  1. ExportDeclarationexport VariableStatement이면 ExportDeclaration의 BoundNames를 반환한다.
  2. 새 빈 List를 반환한다.

8.2.7 정적 의미론: VarScopedDeclarations : Parse Node들의 List

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

Statement : EmptyStatement ExpressionStatement ContinueStatement BreakStatement ReturnStatement ThrowStatement DebuggerStatement
  1. 새 빈 List를 반환한다.
Block : { }
  1. 새 빈 List를 반환한다.
StatementList : StatementList StatementListItem
  1. declarations1StatementList의 VarScopedDeclarations로 둔다.
  2. declarations2StatementListItem의 VarScopedDeclarations로 둔다.
  3. declarations1declarations2list-concatenation을 반환한다.
StatementListItem : Declaration
  1. 새 빈 List를 반환한다.
VariableDeclarationList : VariableDeclaration
  1. « VariableDeclaration » 를 반환한다.
VariableDeclarationList : VariableDeclarationList , VariableDeclaration
  1. declarations1VariableDeclarationList의 VarScopedDeclarations로 둔다.
  2. declarations1과 « VariableDeclaration »의 list-concatenation을 반환한다.
IfStatement : if ( Expression ) Statement else Statement
  1. declarations1을 첫 번째 Statement의 VarScopedDeclarations로 둔다.
  2. declarations2를 두 번째 Statement의 VarScopedDeclarations로 둔다.
  3. declarations1declarations2list-concatenation을 반환한다.
IfStatement : if ( Expression ) Statement
  1. Statement의 VarScopedDeclarations를 반환한다.
DoWhileStatement : do Statement while ( Expression ) ;
  1. Statement의 VarScopedDeclarations를 반환한다.
WhileStatement : while ( Expression ) Statement
  1. Statement의 VarScopedDeclarations를 반환한다.
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement
  1. Statement의 VarScopedDeclarations를 반환한다.
ForStatement : for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement
  1. declarations1VariableDeclarationList의 VarScopedDeclarations로 둔다.
  2. declarations2Statement의 VarScopedDeclarations로 둔다.
  3. declarations1declarations2list-concatenation을 반환한다.
ForStatement : for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. Statement의 VarScopedDeclarations를 반환한다.
ForInOfStatement : for ( LeftHandSideExpression in Expression ) Statement for ( ForDeclaration in Expression ) Statement for ( LeftHandSideExpression of AssignmentExpression ) Statement for ( ForDeclaration of AssignmentExpression ) Statement for await ( LeftHandSideExpression of AssignmentExpression ) Statement for await ( ForDeclaration of AssignmentExpression ) Statement
  1. Statement의 VarScopedDeclarations를 반환한다.
ForInOfStatement : for ( var ForBinding in Expression ) Statement for ( var ForBinding of AssignmentExpression ) Statement for await ( var ForBinding of AssignmentExpression ) Statement
  1. declarations1을 « ForBinding »으로 둔다.
  2. declarations2Statement의 VarScopedDeclarations로 둔다.
  3. declarations1declarations2list-concatenation을 반환한다.
Note

이 절은 부록(Annex) B.3.5에 의해 확장된다.

WithStatement : with ( Expression ) Statement
  1. Statement의 VarScopedDeclarations를 반환한다.
SwitchStatement : switch ( Expression ) CaseBlock
  1. CaseBlock의 VarScopedDeclarations를 반환한다.
CaseBlock : { }
  1. 새 빈 List를 반환한다.
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 첫 번째 CaseClauses가 존재하면 declarations1을 그 VarScopedDeclarations로 둔다.
  2. 아니면 declarations1을 새 빈 List로 둔다.
  3. declarations2DefaultClause의 VarScopedDeclarations로 둔다.
  4. 두 번째 CaseClauses가 존재하면 declarations3을 그 VarScopedDeclarations로 둔다.
  5. 아니면 declarations3을 새 빈 List로 둔다.
  6. declarations1, declarations2, declarations3list-concatenation을 반환한다.
CaseClauses : CaseClauses CaseClause
  1. declarations1CaseClauses의 VarScopedDeclarations로 둔다.
  2. declarations2CaseClause의 VarScopedDeclarations로 둔다.
  3. declarations1declarations2list-concatenation을 반환한다.
CaseClause : case Expression : StatementListopt
  1. StatementList가 존재하면 StatementList의 VarScopedDeclarations를 반환한다.
  2. 새 빈 List를 반환한다.
DefaultClause : default : StatementListopt
  1. StatementList가 존재하면 StatementList의 VarScopedDeclarations를 반환한다.
  2. 새 빈 List를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItem의 VarScopedDeclarations를 반환한다.
LabelledItem : Statement
  1. 새 빈 List를 반환한다.
TryStatement : try Block Catch
  1. declarations1Block의 VarScopedDeclarations로 둔다.
  2. declarations2Catch의 VarScopedDeclarations로 둔다.
  3. declarations1declarations2list-concatenation을 반환한다.
TryStatement : try Block Finally
  1. declarations1Block의 VarScopedDeclarations로 둔다.
  2. declarations2Finally의 VarScopedDeclarations로 둔다.
  3. declarations1declarations2list-concatenation을 반환한다.
TryStatement : try Block Catch Finally
  1. declarations1Block의 VarScopedDeclarations로 둔다.
  2. declarations2Catch의 VarScopedDeclarations로 둔다.
  3. declarations3Finally의 VarScopedDeclarations로 둔다.
  4. declarations1, declarations2, declarations3list-concatenation을 반환한다.
Catch : catch ( CatchParameter ) Block
  1. Block의 VarScopedDeclarations를 반환한다.
FunctionStatementList : [empty]
  1. 새 빈 List를 반환한다.
FunctionStatementList : StatementList
  1. StatementList의 TopLevelVarScopedDeclarations를 반환한다.
ClassStaticBlockStatementList : [empty]
  1. 새 빈 List를 반환한다.
ClassStaticBlockStatementList : StatementList
  1. StatementList의 TopLevelVarScopedDeclarations를 반환한다.
ConciseBody : ExpressionBody
  1. 새 빈 List를 반환한다.
AsyncConciseBody : ExpressionBody
  1. 새 빈 List를 반환한다.
Script : [empty]
  1. 새 빈 List를 반환한다.
ScriptBody : StatementList
  1. StatementList의 TopLevelVarScopedDeclarations를 반환한다.
Module : [empty]
  1. 새 빈 List를 반환한다.
ModuleItemList : ModuleItemList ModuleItem
  1. declarations1ModuleItemList의 VarScopedDeclarations로 둔다.
  2. declarations2ModuleItem의 VarScopedDeclarations로 둔다.
  3. declarations1declarations2list-concatenation을 반환한다.
ModuleItem : ImportDeclaration
  1. 새 빈 List를 반환한다.
ModuleItem : ExportDeclaration
  1. ExportDeclarationexport VariableStatement이면 VariableStatement의 VarScopedDeclarations를 반환한다.
  2. 새 빈 List를 반환한다.

8.2.8 정적 의미론: TopLevelLexicallyDeclaredNames : 문자열들의 List

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

StatementList : StatementList StatementListItem
  1. names1StatementList의 TopLevelLexicallyDeclaredNames로 둔다.
  2. names2StatementListItem의 TopLevelLexicallyDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
StatementListItem : Statement
  1. 새 빈 List를 반환한다.
StatementListItem : Declaration
  1. Declaration Declaration : HoistableDeclaration 이면
    1. 새 빈 List를 반환한다.
  2. Declaration의 BoundNames를 반환한다.
Note

함수나 스크립트의 최상위에서는 함수 선언이 lexical 선언이 아닌 var 선언처럼 취급된다.

8.2.9 정적 의미론: TopLevelLexicallyScopedDeclarations : Parse Node들의 List

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

StatementList : StatementList StatementListItem
  1. declarations1StatementList의 TopLevelLexicallyScopedDeclarations로 둔다.
  2. declarations2StatementListItem의 TopLevelLexicallyScopedDeclarations로 둔다.
  3. declarations1declarations2list-concatenation을 반환한다.
StatementListItem : Statement
  1. 새 빈 List를 반환한다.
StatementListItem : Declaration
  1. Declaration Declaration : HoistableDeclaration 이면
    1. 새 빈 List를 반환한다.
  2. « Declaration » 를 반환한다.

8.2.10 정적 의미론: TopLevelVarDeclaredNames : 문자열들의 List

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

StatementList : StatementList StatementListItem
  1. names1StatementList의 TopLevelVarDeclaredNames로 둔다.
  2. names2StatementListItem의 TopLevelVarDeclaredNames로 둔다.
  3. names1names2list-concatenation을 반환한다.
StatementListItem : Declaration
  1. Declaration Declaration : HoistableDeclaration 이면
    1. HoistableDeclaration의 BoundNames를 반환한다.
  2. 새 빈 List를 반환한다.
StatementListItem : Statement
  1. Statement Statement : LabelledStatement 이면 Statement의 TopLevelVarDeclaredNames를 반환한다.
  2. Statement의 VarDeclaredNames를 반환한다.
Note

함수나 스크립트의 최상위에서 내부 함수 선언은 var 선언처럼 다루어진다.

LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItem의 TopLevelVarDeclaredNames를 반환한다.
LabelledItem : Statement
  1. Statement Statement : LabelledStatement 이면 Statement의 TopLevelVarDeclaredNames를 반환한다.
  2. Statement의 VarDeclaredNames를 반환한다.
LabelledItem : FunctionDeclaration
  1. FunctionDeclaration의 BoundNames를 반환한다.

8.2.11 정적 의미론: TopLevelVarScopedDeclarations : Parse Node들의 List

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

StatementList : StatementList StatementListItem
  1. declarations1StatementList의 TopLevelVarScopedDeclarations로 둔다.
  2. declarations2StatementListItem의 TopLevelVarScopedDeclarations로 둔다.
  3. declarations1declarations2list-concatenation을 반환한다.
StatementListItem : Statement
  1. Statement Statement : LabelledStatement 이면 Statement의 TopLevelVarScopedDeclarations를 반환한다.
  2. Statement의 VarScopedDeclarations를 반환한다.
StatementListItem : Declaration
  1. Declaration Declaration : HoistableDeclaration 이면
    1. declarationHoistableDeclaration의 DeclarationPart로 둔다.
    2. « declaration » 를 반환한다.
  2. 새 빈 List를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. LabelledItem의 TopLevelVarScopedDeclarations를 반환한다.
LabelledItem : Statement
  1. Statement Statement : LabelledStatement 이면 Statement의 TopLevelVarScopedDeclarations를 반환한다.
  2. Statement의 VarScopedDeclarations를 반환한다.
LabelledItem : FunctionDeclaration
  1. « FunctionDeclaration » 를 반환한다.

8.3 레이블(Labels)

8.3.1 정적 의미론: ContainsDuplicateLabels : Boolean

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

Statement : VariableStatement EmptyStatement ExpressionStatement ContinueStatement BreakStatement ReturnStatement ThrowStatement DebuggerStatement Block : { } StatementListItem : Declaration
  1. false를 반환한다.
StatementList : StatementList StatementListItem
  1. hasDuplicatesStatementList의 ContainsDuplicateLabels(labelSet)로 둔다.
  2. hasDuplicatestrue이면 true를 반환한다.
  3. StatementListItem의 ContainsDuplicateLabels(labelSet)를 반환한다.
IfStatement : if ( Expression ) Statement else Statement
  1. hasDuplicate를 첫 번째 Statement의 ContainsDuplicateLabels(labelSet)로 둔다.
  2. hasDuplicatetrue이면 true를 반환한다.
  3. 두 번째 Statement의 ContainsDuplicateLabels(labelSet)를 반환한다.
IfStatement : if ( Expression ) Statement
  1. Statement의 ContainsDuplicateLabels(labelSet)를 반환한다.
DoWhileStatement : do Statement while ( Expression ) ;
  1. Statement의 ContainsDuplicateLabels(labelSet)를 반환한다.
WhileStatement : while ( Expression ) Statement
  1. Statement의 ContainsDuplicateLabels(labelSet)를 반환한다.
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. Statement의 ContainsDuplicateLabels(labelSet)를 반환한다.
ForInOfStatement : for ( LeftHandSideExpression in Expression ) Statement for ( var ForBinding in Expression ) Statement for ( ForDeclaration in Expression ) Statement for ( LeftHandSideExpression of AssignmentExpression ) Statement for ( var ForBinding of AssignmentExpression ) Statement for ( ForDeclaration of AssignmentExpression ) Statement for await ( LeftHandSideExpression of AssignmentExpression ) Statement for await ( var ForBinding of AssignmentExpression ) Statement for await ( ForDeclaration of AssignmentExpression ) Statement
  1. Statement의 ContainsDuplicateLabels(labelSet)를 반환한다.
Note

이 절은 부록(Annex) B.3.5에 의해 확장된다.

WithStatement : with ( Expression ) Statement
  1. Statement의 ContainsDuplicateLabels(labelSet)를 반환한다.
SwitchStatement : switch ( Expression ) CaseBlock
  1. CaseBlock의 ContainsDuplicateLabels(labelSet)를 반환한다.
CaseBlock : { }
  1. false를 반환한다.
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 첫 번째 CaseClauses가 존재하면
    1. 첫 번째 CaseClauses의 ContainsDuplicateLabels(labelSet)가 true이면 true를 반환한다.
  2. DefaultClause의 ContainsDuplicateLabels(labelSet)가 true이면 true를 반환한다.
  3. 두 번째 CaseClauses가 존재하지 않으면 false를 반환한다.
  4. 두 번째 CaseClauses의 ContainsDuplicateLabels(labelSet)를 반환한다.
CaseClauses : CaseClauses CaseClause
  1. hasDuplicatesCaseClauses의 ContainsDuplicateLabels(labelSet)로 둔다.
  2. hasDuplicatestrue이면 true를 반환한다.
  3. CaseClause의 ContainsDuplicateLabels(labelSet)를 반환한다.
CaseClause : case Expression : StatementListopt
  1. StatementList가 존재하면 StatementList의 ContainsDuplicateLabels(labelSet)를 반환한다.
  2. false를 반환한다.
DefaultClause : default : StatementListopt
  1. StatementList가 존재하면 StatementList의 ContainsDuplicateLabels(labelSet)를 반환한다.
  2. false를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. labelLabelIdentifier의 StringValue로 둔다.
  2. labelSetlabel을 포함하면 true를 반환한다.
  3. newLabelSetlabelSet과 « label »의 list-concatenation으로 둔다.
  4. LabelledItem의 ContainsDuplicateLabels(newLabelSet)를 반환한다.
LabelledItem : FunctionDeclaration
  1. false를 반환한다.
TryStatement : try Block Catch
  1. hasDuplicatesBlock의 ContainsDuplicateLabels(labelSet)로 둔다.
  2. hasDuplicatestrue이면 true를 반환한다.
  3. Catch의 ContainsDuplicateLabels(labelSet)를 반환한다.
TryStatement : try Block Finally
  1. hasDuplicatesBlock의 ContainsDuplicateLabels(labelSet)로 둔다.
  2. hasDuplicatestrue이면 true를 반환한다.
  3. Finally의 ContainsDuplicateLabels(labelSet)를 반환한다.
TryStatement : try Block Catch Finally
  1. Block의 ContainsDuplicateLabels(labelSet)가 true이면 true를 반환한다.
  2. Catch의 ContainsDuplicateLabels(labelSet)가 true이면 true를 반환한다.
  3. Finally의 ContainsDuplicateLabels(labelSet)를 반환한다.
Catch : catch ( CatchParameter ) Block
  1. Block의 ContainsDuplicateLabels(labelSet)를 반환한다.
FunctionStatementList : [empty]
  1. false를 반환한다.
ClassStaticBlockStatementList : [empty]
  1. false를 반환한다.
ModuleItemList : ModuleItemList ModuleItem
  1. hasDuplicatesModuleItemList의 ContainsDuplicateLabels(labelSet)로 둔다.
  2. hasDuplicatestrue이면 true를 반환한다.
  3. ModuleItem의 ContainsDuplicateLabels(labelSet)를 반환한다.
ModuleItem : ImportDeclaration ExportDeclaration
  1. false를 반환한다.

8.3.2 정적 의미론: ContainsUndefinedBreakTarget : Boolean

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

Statement : VariableStatement EmptyStatement ExpressionStatement ContinueStatement ReturnStatement ThrowStatement DebuggerStatement Block : { } StatementListItem : Declaration
  1. false를 반환한다.
StatementList : StatementList StatementListItem
  1. hasUndefinedLabelsStatementList의 ContainsUndefinedBreakTarget(labelSet)로 둔다.
  2. hasUndefinedLabelstrue이면 true를 반환한다.
  3. StatementListItem의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
IfStatement : if ( Expression ) Statement else Statement
  1. hasUndefinedLabels를 첫 번째 Statement의 ContainsUndefinedBreakTarget(labelSet)로 둔다.
  2. hasUndefinedLabelstrue이면 true를 반환한다.
  3. 두 번째 Statement의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
IfStatement : if ( Expression ) Statement
  1. Statement의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
DoWhileStatement : do Statement while ( Expression ) ;
  1. Statement의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
WhileStatement : while ( Expression ) Statement
  1. Statement의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. Statement의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
ForInOfStatement : for ( LeftHandSideExpression in Expression ) Statement for ( var ForBinding in Expression ) Statement for ( ForDeclaration in Expression ) Statement for ( LeftHandSideExpression of AssignmentExpression ) Statement for ( var ForBinding of AssignmentExpression ) Statement for ( ForDeclaration of AssignmentExpression ) Statement for await ( LeftHandSideExpression of AssignmentExpression ) Statement for await ( var ForBinding of AssignmentExpression ) Statement for await ( ForDeclaration of AssignmentExpression ) Statement
  1. Statement의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
Note

이 절은 부록(Annex) B.3.5에 의해 확장된다.

BreakStatement : break ;
  1. false를 반환한다.
BreakStatement : break LabelIdentifier ;
  1. labelSetLabelIdentifier의 StringValue를 포함하지 않으면 true를 반환한다.
  2. false를 반환한다.
WithStatement : with ( Expression ) Statement
  1. Statement의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
SwitchStatement : switch ( Expression ) CaseBlock
  1. CaseBlock의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
CaseBlock : { }
  1. false를 반환한다.
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 첫 번째 CaseClauses가 존재하면
    1. 첫 번째 CaseClauses의 ContainsUndefinedBreakTarget(labelSet)가 true이면 true를 반환한다.
  2. DefaultClause의 ContainsUndefinedBreakTarget(labelSet)가 true이면 true를 반환한다.
  3. 두 번째 CaseClauses가 존재하지 않으면 false를 반환한다.
  4. 두 번째 CaseClauses의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
CaseClauses : CaseClauses CaseClause
  1. hasUndefinedLabelsCaseClauses의 ContainsUndefinedBreakTarget(labelSet)로 둔다.
  2. hasUndefinedLabelstrue이면 true를 반환한다.
  3. CaseClause의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
CaseClause : case Expression : StatementListopt
  1. StatementList가 존재하면 StatementList의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
  2. false를 반환한다.
DefaultClause : default : StatementListopt
  1. StatementList가 존재하면 StatementList의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
  2. false를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. labelLabelIdentifier의 StringValue로 둔다.
  2. newLabelSetlabelSet과 « label »의 list-concatenation으로 둔다.
  3. LabelledItem의 ContainsUndefinedBreakTarget(newLabelSet)를 반환한다.
LabelledItem : FunctionDeclaration
  1. false를 반환한다.
TryStatement : try Block Catch
  1. hasUndefinedLabelsBlock의 ContainsUndefinedBreakTarget(labelSet)로 둔다.
  2. hasUndefinedLabelstrue이면 true를 반환한다.
  3. Catch의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
TryStatement : try Block Finally
  1. hasUndefinedLabelsBlock의 ContainsUndefinedBreakTarget(labelSet)로 둔다.
  2. hasUndefinedLabelstrue이면 true를 반환한다.
  3. Finally의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
TryStatement : try Block Catch Finally
  1. Block의 ContainsUndefinedBreakTarget(labelSet)가 true이면 true를 반환한다.
  2. Catch의 ContainsUndefinedBreakTarget(labelSet)가 true이면 true를 반환한다.
  3. Finally의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
Catch : catch ( CatchParameter ) Block
  1. Block의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
FunctionStatementList : [empty]
  1. false를 반환한다.
ClassStaticBlockStatementList : [empty]
  1. false를 반환한다.
ModuleItemList : ModuleItemList ModuleItem
  1. hasUndefinedLabelsModuleItemList의 ContainsUndefinedBreakTarget(labelSet)로 둔다.
  2. hasUndefinedLabelstrue이면 true를 반환한다.
  3. ModuleItem의 ContainsUndefinedBreakTarget(labelSet)를 반환한다.
ModuleItem : ImportDeclaration ExportDeclaration
  1. false를 반환한다.

8.3.3 정적 의미론: ContainsUndefinedContinueTarget : Boolean

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

Statement : VariableStatement EmptyStatement ExpressionStatement BreakStatement ReturnStatement ThrowStatement DebuggerStatement Block : { } StatementListItem : Declaration
  1. false를 반환한다.
Statement : BlockStatement
  1. BlockStatement의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
BreakableStatement : IterationStatement
  1. newIterationSetiterationSetlabelSetlist-concatenation으로 둔다.
  2. IterationStatement의 ContainsUndefinedContinueTarget(newIterationSet, « »)을 반환한다.
StatementList : StatementList StatementListItem
  1. hasUndefinedLabelsStatementList의 ContainsUndefinedContinueTarget(iterationSet, « »)로 둔다.
  2. hasUndefinedLabelstrue이면 true를 반환한다.
  3. StatementListItem의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
IfStatement : if ( Expression ) Statement else Statement
  1. hasUndefinedLabels를 첫 번째 Statement의 ContainsUndefinedContinueTarget(iterationSet, « »)로 둔다.
  2. hasUndefinedLabelstrue이면 true를 반환한다.
  3. 두 번째 Statement의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
IfStatement : if ( Expression ) Statement
  1. Statement의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
DoWhileStatement : do Statement while ( Expression ) ;
  1. Statement의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
WhileStatement : while ( Expression ) Statement
  1. Statement의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
ForStatement : for ( Expressionopt ; Expressionopt ; Expressionopt ) Statement for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
  1. Statement의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
ForInOfStatement : for ( LeftHandSideExpression in Expression ) Statement for ( var ForBinding in Expression ) Statement for ( ForDeclaration in Expression ) Statement for ( LeftHandSideExpression of AssignmentExpression ) Statement for ( var ForBinding of AssignmentExpression ) Statement for ( ForDeclaration of AssignmentExpression ) Statement for await ( LeftHandSideExpression of AssignmentExpression ) Statement for await ( var ForBinding of AssignmentExpression ) Statement for await ( ForDeclaration of AssignmentExpression ) Statement
  1. Statement의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
Note

이 절은 부록(Annex) B.3.5에 의해 확장된다.

ContinueStatement : continue ;
  1. false를 반환한다.
ContinueStatement : continue LabelIdentifier ;
  1. iterationSetLabelIdentifier의 StringValue를 포함하지 않으면 true를 반환한다.
  2. false를 반환한다.
WithStatement : with ( Expression ) Statement
  1. Statement의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
SwitchStatement : switch ( Expression ) CaseBlock
  1. CaseBlock의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
CaseBlock : { }
  1. false를 반환한다.
CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt }
  1. 첫 번째 CaseClauses가 존재하면
    1. 첫 번째 CaseClauses의 ContainsUndefinedContinueTarget(iterationSet, « »)이 true이면 true를 반환한다.
  2. DefaultClause의 ContainsUndefinedContinueTarget(iterationSet, « »)이 true이면 true를 반환한다.
  3. 두 번째 CaseClauses가 존재하지 않으면 false를 반환한다.
  4. 두 번째 CaseClauses의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
CaseClauses : CaseClauses CaseClause
  1. hasUndefinedLabelsCaseClauses의 ContainsUndefinedContinueTarget(iterationSet, « »)로 둔다.
  2. hasUndefinedLabelstrue이면 true를 반환한다.
  3. CaseClause의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
CaseClause : case Expression : StatementListopt
  1. StatementList가 존재하면 StatementList의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
  2. false를 반환한다.
DefaultClause : default : StatementListopt
  1. StatementList가 존재하면 StatementList의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
  2. false를 반환한다.
LabelledStatement : LabelIdentifier : LabelledItem
  1. labelLabelIdentifier의 StringValue로 둔다.
  2. newLabelSetlabelSet과 « label »의 list-concatenation으로 둔다.
  3. LabelledItem의 ContainsUndefinedContinueTarget(iterationSet, newLabelSet)을 반환한다.
LabelledItem : FunctionDeclaration
  1. false를 반환한다.
TryStatement : try Block Catch
  1. hasUndefinedLabelsBlock의 ContainsUndefinedContinueTarget(iterationSet, « »)로 둔다.
  2. hasUndefinedLabelstrue이면 true를 반환한다.
  3. Catch의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
TryStatement : try Block Finally
  1. hasUndefinedLabelsBlock의 ContainsUndefinedContinueTarget(iterationSet, « »)로 둔다.
  2. hasUndefinedLabelstrue이면 true를 반환한다.
  3. Finally의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
TryStatement : try Block Catch Finally
  1. Block의 ContainsUndefinedContinueTarget(iterationSet, « »)이 true이면 true를 반환한다.
  2. Catch의 ContainsUndefinedContinueTarget(iterationSet, « »)이 true이면 true를 반환한다.
  3. Finally의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
Catch : catch ( CatchParameter ) Block
  1. Block의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
FunctionStatementList : [empty]
  1. false를 반환한다.
ClassStaticBlockStatementList : [empty]
  1. false를 반환한다.
ModuleItemList : ModuleItemList ModuleItem
  1. hasUndefinedLabelsModuleItemList의 ContainsUndefinedContinueTarget(iterationSet, « »)로 둔다.
  2. hasUndefinedLabelstrue이면 true를 반환한다.
  3. ModuleItem의 ContainsUndefinedContinueTarget(iterationSet, « »)을 반환한다.
ModuleItem : ImportDeclaration ExportDeclaration
  1. false를 반환한다.

8.4 함수 이름 추론(Function Name Inference)

8.4.1 정적 의미론: HasName : Boolean

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

PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
  1. exprCoverParenthesizedExpressionAndArrowParameterList가 커버하는 ParenthesizedExpression으로 둔다.
  2. IsFunctionDefinition of exprfalse이면 false를 반환한다.
  3. HasName of expr을 반환한다.
FunctionExpression : function ( FormalParameters ) { FunctionBody } GeneratorExpression : function * ( FormalParameters ) { GeneratorBody } AsyncGeneratorExpression : async function * ( FormalParameters ) { AsyncGeneratorBody } AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody } ArrowFunction : ArrowParameters => ConciseBody AsyncArrowFunction : async AsyncArrowBindingIdentifier => AsyncConciseBody CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody ClassExpression : class ClassTail
  1. false를 반환한다.
FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody } GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } ClassExpression : class BindingIdentifier ClassTail
  1. true를 반환한다.

8.4.2 정적 의미론: IsFunctionDefinition : Boolean

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

PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
  1. exprCoverParenthesizedExpressionAndArrowParameterList가 커버하는 ParenthesizedExpression으로 둔다.
  2. IsFunctionDefinition of expr을 반환한다.
PrimaryExpression : this IdentifierReference Literal ArrayLiteral ObjectLiteral RegularExpressionLiteral TemplateLiteral MemberExpression : MemberExpression [ Expression ] MemberExpression . IdentifierName MemberExpression TemplateLiteral SuperProperty MetaProperty new MemberExpression Arguments MemberExpression . PrivateIdentifier NewExpression : new NewExpression LeftHandSideExpression : CallExpression OptionalExpression UpdateExpression : LeftHandSideExpression ++ LeftHandSideExpression -- ++ UnaryExpression -- UnaryExpression UnaryExpression : delete UnaryExpression void UnaryExpression typeof UnaryExpression + UnaryExpression - UnaryExpression ~ UnaryExpression ! UnaryExpression AwaitExpression ExponentiationExpression : UpdateExpression ** ExponentiationExpression MultiplicativeExpression : MultiplicativeExpression MultiplicativeOperator ExponentiationExpression AdditiveExpression : AdditiveExpression + MultiplicativeExpression AdditiveExpression - MultiplicativeExpression ShiftExpression : ShiftExpression << AdditiveExpression ShiftExpression >> AdditiveExpression ShiftExpression >>> AdditiveExpression RelationalExpression : RelationalExpression < ShiftExpression RelationalExpression > ShiftExpression RelationalExpression <= ShiftExpression RelationalExpression >= ShiftExpression RelationalExpression instanceof ShiftExpression RelationalExpression in ShiftExpression PrivateIdentifier in ShiftExpression EqualityExpression : EqualityExpression == RelationalExpression EqualityExpression != RelationalExpression EqualityExpression === RelationalExpression EqualityExpression !== RelationalExpression BitwiseANDExpression : BitwiseANDExpression & EqualityExpression BitwiseXORExpression : BitwiseXORExpression ^ BitwiseANDExpression BitwiseORExpression : BitwiseORExpression | BitwiseXORExpression LogicalANDExpression : LogicalANDExpression && BitwiseORExpression LogicalORExpression : LogicalORExpression || LogicalANDExpression CoalesceExpression : CoalesceExpressionHead ?? BitwiseORExpression ConditionalExpression : ShortCircuitExpression ? AssignmentExpression : AssignmentExpression AssignmentExpression : YieldExpression LeftHandSideExpression = AssignmentExpression LeftHandSideExpression AssignmentOperator AssignmentExpression LeftHandSideExpression &&= AssignmentExpression LeftHandSideExpression ||= AssignmentExpression LeftHandSideExpression ??= AssignmentExpression Expression : Expression , AssignmentExpression
  1. false를 반환한다.
AssignmentExpression : ArrowFunction AsyncArrowFunction FunctionExpression : function BindingIdentifieropt ( FormalParameters ) { FunctionBody } GeneratorExpression : function * BindingIdentifieropt ( FormalParameters ) { GeneratorBody } AsyncGeneratorExpression : async function * BindingIdentifieropt ( FormalParameters ) { AsyncGeneratorBody } AsyncFunctionExpression : async function BindingIdentifieropt ( FormalParameters ) { AsyncFunctionBody } ClassExpression : class BindingIdentifieropt ClassTail
  1. true를 반환한다.

8.4.3 정적 의미론: IsAnonymousFunctionDefinition ( expr: AssignmentExpression Parse Node, Initializer Parse Node, 또는 Expression Parse Node, ): Boolean

The abstract operation UNKNOWN takes UNPARSEABLE ARGUMENTS. 인수가 이름을 바인딩하지 않는 함수 정의인지 판정한다. It performs the following steps when called:

  1. IsFunctionDefinition of exprfalse이면 false를 반환한다.
  2. hasName을 HasName of expr으로 둔다.
  3. hasNametrue이면 false를 반환한다.
  4. true를 반환한다.

8.4.4 정적 의미론: IsIdentifierRef : Boolean

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

PrimaryExpression : IdentifierReference
  1. true를 반환한다.
PrimaryExpression : this Literal ArrayLiteral ObjectLiteral FunctionExpression ClassExpression GeneratorExpression AsyncFunctionExpression AsyncGeneratorExpression RegularExpressionLiteral TemplateLiteral CoverParenthesizedExpressionAndArrowParameterList MemberExpression : MemberExpression [ Expression ] MemberExpression . IdentifierName MemberExpression TemplateLiteral SuperProperty MetaProperty new MemberExpression Arguments MemberExpression . PrivateIdentifier NewExpression : new NewExpression LeftHandSideExpression : CallExpression OptionalExpression
  1. false를 반환한다.

8.4.5 런타임 의미론: NamedEvaluation : 함수 객체를 담는 normal completion 또는 abrupt completion

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

PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
  1. exprCoverParenthesizedExpressionAndArrowParameterList가 커버하는 ParenthesizedExpression으로 둔다.
  2. name 인수를 사용하여 expr의 NamedEvaluation을 ?로 반환한다.
ParenthesizedExpression : ( Expression )
  1. 단언: IsAnonymousFunctionDefinition(Expression)은 true이다.
  2. name 인수를 사용하여 Expression의 NamedEvaluation을 ?로 반환한다.
FunctionExpression : function ( FormalParameters ) { FunctionBody }
  1. name 인수를 사용하여 FunctionExpression의 InstantiateOrdinaryFunctionExpression을 반환한다.
GeneratorExpression : function * ( FormalParameters ) { GeneratorBody }
  1. name 인수를 사용하여 GeneratorExpression의 InstantiateGeneratorFunctionExpression을 반환한다.
AsyncGeneratorExpression : async function * ( FormalParameters ) { AsyncGeneratorBody }
  1. name 인수를 사용하여 AsyncGeneratorExpression의 InstantiateAsyncGeneratorFunctionExpression을 반환한다.
AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
  1. name 인수를 사용하여 AsyncFunctionExpression의 InstantiateAsyncFunctionExpression을 반환한다.
ArrowFunction : ArrowParameters => ConciseBody
  1. name 인수를 사용하여 ArrowFunction의 InstantiateArrowFunctionExpression을 반환한다.
AsyncArrowFunction : async AsyncArrowBindingIdentifier => AsyncConciseBody CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
  1. name 인수를 사용하여 AsyncArrowFunction의 InstantiateAsyncArrowFunctionExpression을 반환한다.
ClassExpression : class ClassTail
  1. sourceTextClassExpression이 매치한 소스 텍스트로 둔다.
  2. undefined, name, sourceText 인수로 ClassTail의 ClassDefinitionEvaluation을 ?로 반환한다.

8.5 Contains

8.5.1 정적 의미론: Contains : Boolean

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS.

아래에 나열되지 않은 명세의 모든 문법 생성 규칙 대안은 암묵적으로 다음 기본 Contains 정의를 갖는다:

  1. 이 Parse Node의 각 자식 노드 child에 대해
    1. childsymbol의 인스턴스이면 true를 반환한다.
    2. child가 비종결(nonterminal) 인스턴스이면
      1. containedchild Contains symbol의 결과로 둔다.
      2. containedtrue이면 true를 반환한다.
  2. false를 반환한다.
FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody } function ( FormalParameters ) { FunctionBody } FunctionExpression : function BindingIdentifieropt ( FormalParameters ) { FunctionBody } GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } function * ( FormalParameters ) { GeneratorBody } GeneratorExpression : function * BindingIdentifieropt ( FormalParameters ) { GeneratorBody } AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } async function * ( FormalParameters ) { AsyncGeneratorBody } AsyncGeneratorExpression : async function * BindingIdentifieropt ( FormalParameters ) { AsyncGeneratorBody } AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } async function ( FormalParameters ) { AsyncFunctionBody } AsyncFunctionExpression : async function BindingIdentifieropt ( FormalParameters ) { AsyncFunctionBody }
  1. false를 반환한다.
Note 1

부분 구조에 의존하는 정적 의미 규칙은 일반적으로 함수 정의 내부를 들여다보지 않는다.

ClassTail : ClassHeritageopt { ClassBody }
  1. symbolClassBody이면 true를 반환한다.
  2. symbolClassHeritage이면
    1. ClassHeritage가 존재하면 true, 아니면 false를 반환한다.
  3. ClassHeritage가 존재하면
    1. ClassHeritage Contains symboltrue이면 true를 반환한다.
  4. ClassBody에 대해 symbol 인수를 사용한 ComputedPropertyContains 결과를 반환한다.
Note 2

부분 구조에 의존하는 정적 의미 규칙은 일반적으로 PropertyName을 제외하고 클래스 본문 내부를 들여다보지 않는다.

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

부분 구조에 의존하는 정적 의미 규칙은 일반적으로 static 초기화 블록 내부를 들여다보지 않는다.

ArrowFunction : ArrowParameters => ConciseBody
  1. symbolNewTarget, SuperProperty, SuperCall, super, this 중 하나가 아니면 false를 반환한다.
  2. ArrowParameters Contains symboltrue이면 true를 반환한다.
  3. ConciseBody Contains symbol을 반환한다.
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
  1. formalsCoverParenthesizedExpressionAndArrowParameterList가 커버하는 ArrowFormalParameters로 둔다.
  2. formals Contains symbol을 반환한다.
AsyncArrowFunction : async AsyncArrowBindingIdentifier => AsyncConciseBody
  1. symbolNewTarget, SuperProperty, SuperCall, super, this 중 하나가 아니면 false를 반환한다.
  2. AsyncConciseBody Contains symbol을 반환한다.
AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
  1. symbolNewTarget, SuperProperty, SuperCall, super, this 중 하나가 아니면 false를 반환한다.
  2. headCoverCallExpressionAndAsyncArrowHead가 커버하는 AsyncArrowHead로 둔다.
  3. head Contains symboltrue이면 true를 반환한다.
  4. AsyncConciseBody Contains symbol을 반환한다.
Note 4

Contains는 ArrowFunction 또는 AsyncArrowFunction 내에서 new.target, this, super 사용을 탐지하는 데 사용된다.

PropertyDefinition : MethodDefinition
  1. symbolMethodDefinition이면 true를 반환한다.
  2. MethodDefinition에 대해 symbol 인수를 사용한 ComputedPropertyContains 결과를 반환한다.
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 정적 의미론: ComputedPropertyContains : Boolean

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

ClassElementName : PrivateIdentifier PropertyName : LiteralPropertyName
  1. false를 반환한다.
PropertyName : ComputedPropertyName
  1. ComputedPropertyName Contains symbol의 결과를 반환한다.
MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody } get ClassElementName ( ) { FunctionBody } set ClassElementName ( PropertySetParameterList ) { FunctionBody }
  1. ClassElementName에 대해 symbol 인수를 사용한 ComputedPropertyContains 결과를 반환한다.
GeneratorMethod : * ClassElementName ( UniqueFormalParameters ) { GeneratorBody }
  1. ClassElementName에 대해 symbol 인수를 사용한 ComputedPropertyContains 결과를 반환한다.
AsyncGeneratorMethod : async * ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody }
  1. ClassElementName에 대해 symbol 인수를 사용한 ComputedPropertyContains 결과를 반환한다.
ClassElementList : ClassElementList ClassElement
  1. inListClassElementList에 대해 symbol 인수를 사용한 ComputedPropertyContains 결과로 둔다.
  2. inListtrue이면 true를 반환한다.
  3. ClassElement에 대해 symbol 인수를 사용한 ComputedPropertyContains 결과를 반환한다.
ClassElement : ClassStaticBlock
  1. false를 반환한다.
ClassElement : ;
  1. false를 반환한다.
AsyncMethod : async ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody }
  1. ClassElementName에 대해 symbol 인수를 사용한 ComputedPropertyContains 결과를 반환한다.
FieldDefinition : ClassElementName Initializeropt
  1. ClassElementName에 대해 symbol 인수를 사용한 ComputedPropertyContains 결과를 반환한다.

8.6 기타(Miscellaneous)

이 연산들은 명세 전반 여러 위치에서 사용된다.

8.6.1 런타임 의미론: InstantiateFunctionObject : ECMAScript 함수 객체

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

FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody } function ( FormalParameters ) { FunctionBody }
  1. env, privateEnv 인수로 FunctionDeclaration의 InstantiateOrdinaryFunctionObject를 반환한다.
GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } function * ( FormalParameters ) { GeneratorBody }
  1. env, privateEnv 인수로 GeneratorDeclaration의 InstantiateGeneratorFunctionObject를 반환한다.
AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } async function * ( FormalParameters ) { AsyncGeneratorBody }
  1. env, privateEnv 인수로 AsyncGeneratorDeclaration의 InstantiateAsyncGeneratorFunctionObject를 반환한다.
AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } async function ( FormalParameters ) { AsyncFunctionBody }
  1. env, privateEnv 인수로 AsyncFunctionDeclaration의 InstantiateAsyncFunctionObject를 반환한다.

8.6.2 런타임 의미론: BindingInitialization : unused를 담는 normal completion 또는 abrupt completion

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS.

Note

environmentundefined가 전달되면 초기화 값을 할당하는 데 PutValue 연산을 사용해야 함을 나타낸다. 이는 var 문 및 일부 non-strict 함수의 매개변수 목록( 10.2.11 참조)에 해당한다. 이 경우 렉시컬 바인딩은 초기화자 평가 전에 호이스팅되어 사전 초기화된다.

It is defined piecewise over the following productions:

BindingIdentifier : Identifier
  1. nameIdentifier의 StringValue로 둔다.
  2. InitializeBoundName(name, value, environment)를 반환한다.
BindingIdentifier : yield
  1. InitializeBoundName("yield", value, environment)를 반환한다.
BindingIdentifier : await
  1. InitializeBoundName("await", value, environment)를 반환한다.
BindingPattern : ObjectBindingPattern
  1. RequireObjectCoercible(value)를 수행한다.
  2. value, environment 인수로 ObjectBindingPattern의 BindingInitialization을 ?로 반환한다.
BindingPattern : ArrayBindingPattern
  1. iteratorRecord를 ? GetIterator(value, sync)로 둔다.
  2. result를 (ArrayBindingPattern의 IteratorBindingInitialization(iteratorRecord, environment))의 Completion으로 둔다.
  3. iteratorRecord.[[Done]]false이면 ? IteratorClose(iteratorRecord, result)를 반환한다.
  4. result를 반환한다.
ObjectBindingPattern : { }
  1. unused를 반환한다.
ObjectBindingPattern : { BindingPropertyList } { BindingPropertyList , }
  1. value, environment 인수로 BindingPropertyList의 PropertyBindingInitialization을 ? 수행한다.
  2. unused를 반환한다.
ObjectBindingPattern : { BindingRestProperty }
  1. excludedNames를 새 빈 List로 둔다.
  2. value, environment, excludedNames 인수로 BindingRestProperty의 RestBindingInitialization을 ?로 반환한다.
ObjectBindingPattern : { BindingPropertyList , BindingRestProperty }
  1. excludedNamesvalue, environment 인수로 BindingPropertyList의 PropertyBindingInitialization 결과로 둔다.
  2. value, environment, excludedNames 인수로 BindingRestProperty의 RestBindingInitialization을 ?로 반환한다.

8.6.2.1 InitializeBoundName ( name, value, environment )

The abstract operation InitializeBoundName takes arguments name (String), value (ECMAScript 언어 값), and environment (Environment Record 또는 undefined) and returns unused를 담는 normal completion 또는 abrupt completion. It performs the following steps when called:

  1. environmentundefined가 아니면
    1. environment.InitializeBinding(name, value)를 수행한다.
    2. unused를 반환한다.
  2. Else,
    1. lhs를 ? ResolveBinding(name)으로 둔다.
    2. PutValue(lhs, value)를 반환한다.

8.6.3 런타임 의미론: IteratorBindingInitialization : unused를 담는 normal completion 또는 abrupt completion

The syntax-directed operation UNKNOWN takes UNPARSEABLE ARGUMENTS.

Note

environmentundefined가 전달되면 초기화 값 할당에 PutValue 연산을 사용해야 함을 나타낸다. 이는 non-strict 함수의 매개변수 목록에 해당한다. 그 경우 동일 이름 매개변수 가능성 때문에 사전 초기화된다.

It is defined piecewise over the following productions:

ArrayBindingPattern : [ ]
  1. unused를 반환한다.
ArrayBindingPattern : [ Elision ]
  1. Elision의 IteratorDestructuringAssignmentEvaluation(iteratorRecord)을 ?로 반환한다.
ArrayBindingPattern : [ Elisionopt BindingRestElement ]
  1. Elision이 존재하면
    1. Elision의 IteratorDestructuringAssignmentEvaluation(iteratorRecord)을 ? 수행한다.
  2. BindingRestElement의 IteratorBindingInitialization(iteratorRecord, environment)을 ?로 반환한다.
ArrayBindingPattern : [ BindingElementList , Elision ]
  1. BindingElementList의 IteratorBindingInitialization(iteratorRecord, environment)을 ? 수행한다.
  2. Elision의 IteratorDestructuringAssignmentEvaluation(iteratorRecord)을 ?로 반환한다.
ArrayBindingPattern : [ BindingElementList , Elisionopt BindingRestElement ]
  1. BindingElementList의 IteratorBindingInitialization(iteratorRecord, environment)을 ? 수행한다.
  2. Elision이 존재하면
    1. Elision의 IteratorDestructuringAssignmentEvaluation(iteratorRecord)을 ? 수행한다.
  3. BindingRestElement의 IteratorBindingInitialization(iteratorRecord, environment)을 ?로 반환한다.
BindingElementList : BindingElementList , BindingElisionElement
  1. BindingElementList의 IteratorBindingInitialization(iteratorRecord, environment)을 ? 수행한다.
  2. BindingElisionElement의 IteratorBindingInitialization(iteratorRecord, environment)을 ?로 반환한다.
BindingElisionElement : Elision BindingElement
  1. Elision의 IteratorDestructuringAssignmentEvaluation(iteratorRecord)을 ? 수행한다.
  2. BindingElement의 IteratorBindingInitialization(iteratorRecord, environment)을 ?로 반환한다.
SingleNameBinding : BindingIdentifier Initializeropt
  1. bindingIdBindingIdentifier의 StringValue로 둔다.
  2. lhs를 ? ResolveBinding(bindingId, environment)로 둔다.
  3. vundefined로 둔다.
  4. iteratorRecord.[[Done]]false이면
    1. next를 ? IteratorStepValue(iteratorRecord)로 둔다.
    2. nextdone이 아니면 vnext로 둔다.
  5. Initializer가 존재하고 vundefined이면
    1. IsAnonymousFunctionDefinition(Initializer)이 true이면
      1. v를 ? NamedEvaluation(Initializer, bindingId)로 둔다.
    2. Else
      1. defaultValue를 ? Evaluation(Initializer)로 둔다.
      2. v를 ? GetValue(defaultValue)로 둔다.
  6. environmentundefined이면 ? PutValue(lhs, v)를 반환한다.
  7. InitializeReferencedBinding(lhs, v)를 반환한다.
BindingElement : BindingPattern Initializeropt
  1. vundefined로 둔다.
  2. iteratorRecord.[[Done]]false이면
    1. next를 ? IteratorStepValue(iteratorRecord)로 둔다.
    2. nextdone이 아니면 vnext로 둔다.
  3. Initializer가 존재하고 vundefined이면
    1. defaultValue를 ? Evaluation(Initializer)로 둔다.
    2. v를 ? GetValue(defaultValue)로 둔다.
  4. BindingPattern의 BindingInitialization(v, environment)을 ?로 반환한다.
BindingRestElement : ... BindingIdentifier
  1. lhs를 ? ResolveBinding(StringValue of BindingIdentifier, environment)로 둔다.
  2. A를 ! ArrayCreate(0)로 둔다.
  3. n을 0으로 둔다.
  4. 반복,
    1. nextdone으로 둔다.
    2. iteratorRecord.[[Done]]false이면
      1. next를 ? IteratorStepValue(iteratorRecord)로 둔다.
    3. nextdone이면
      1. environmentundefined이면 ? PutValue(lhs, A)를 반환한다.
      2. InitializeReferencedBinding(lhs, A)를 반환한다.
    4. CreateDataPropertyOrThrow(A, ! ToString(𝔽(n)), next)를 수행한다.
    5. nn + 1로 둔다.
BindingRestElement : ... BindingPattern
  1. A를 ! ArrayCreate(0)로 둔다.
  2. n을 0으로 둔다.
  3. 반복,
    1. nextdone으로 둔다.
    2. iteratorRecord.[[Done]]false이면
      1. next를 ? IteratorStepValue(iteratorRecord)로 둔다.
    3. nextdone이면
      1. BindingPattern의 BindingInitialization(A, environment)을 ?로 반환한다.
    4. CreateDataPropertyOrThrow(A, ! ToString(𝔽(n)), next)를 수행한다.
    5. nn + 1로 둔다.
FormalParameters : [empty]
  1. unused를 반환한다.
FormalParameters : FormalParameterList , FunctionRestParameter
  1. FormalParameterList의 IteratorBindingInitialization(iteratorRecord, environment)을 ? 수행한다.
  2. FunctionRestParameter의 IteratorBindingInitialization(iteratorRecord, environment)을 ?로 반환한다.
FormalParameterList : FormalParameterList , FormalParameter
  1. FormalParameterList의 IteratorBindingInitialization(iteratorRecord, environment)을 ? 수행한다.
  2. FormalParameter의 IteratorBindingInitialization(iteratorRecord, environment)을 ?로 반환한다.
ArrowParameters : BindingIdentifier
  1. vundefined로 둔다.
  2. 단언: iteratorRecord.[[Done]]false이다.
  3. next를 ? IteratorStepValue(iteratorRecord)로 둔다.
  4. nextdone이 아니면 vnext로 둔다.
  5. BindingIdentifier의 BindingInitialization(v, environment)을 ?로 반환한다.
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
  1. formalsCoverParenthesizedExpressionAndArrowParameterList가 커버하는 ArrowFormalParameters로 둔다.
  2. formals의 IteratorBindingInitialization(iteratorRecord, environment)을 ?로 반환한다.
AsyncArrowBindingIdentifier : BindingIdentifier
  1. vundefined로 둔다.
  2. 단언: iteratorRecord.[[Done]]false이다.
  3. next를 ? IteratorStepValue(iteratorRecord)로 둔다.
  4. nextdone이 아니면 vnext로 둔다.
  5. BindingIdentifier의 BindingInitialization(v, environment)을 ?로 반환한다.

8.6.4 정적 의미론: AssignmentTargetType : simple, web-compat, 또는 invalid

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

IdentifierReference : Identifier
  1. IsStrict(this IdentifierReference)가 true이고 Identifier의 StringValue가 "eval", "arguments" 중 하나이면 invalid를 반환한다.
  2. simple을 반환한다.
IdentifierReference : yield await CallExpression : CallExpression [ Expression ] CallExpression . IdentifierName CallExpression . PrivateIdentifier MemberExpression : MemberExpression [ Expression ] MemberExpression . IdentifierName SuperProperty MemberExpression . PrivateIdentifier
  1. simple을 반환한다.
PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
  1. exprCoverParenthesizedExpressionAndArrowParameterList가 커버하는 ParenthesizedExpression으로 둔다.
  2. expr의 AssignmentTargetType을 반환한다.
CallExpression : CoverCallExpressionAndAsyncArrowHead CallExpression Arguments
  1. Normative Optional
    호스트가 웹 브라우저이거나 함수 호출 대입 대상으로 인한 런타임 에러를 지원하고 IsStrict(this CallExpression)이 false이면
    1. web-compat을 반환한다.
  2. invalid를 반환한다.
PrimaryExpression : this Literal ArrayLiteral ObjectLiteral FunctionExpression ClassExpression GeneratorExpression AsyncFunctionExpression AsyncGeneratorExpression RegularExpressionLiteral TemplateLiteral CallExpression : SuperCall ImportCall CallExpression TemplateLiteral NewExpression : new NewExpression MemberExpression : MemberExpression TemplateLiteral new MemberExpression Arguments NewTarget : new . target ImportMeta : import . meta LeftHandSideExpression : OptionalExpression UpdateExpression : LeftHandSideExpression ++ LeftHandSideExpression -- ++ UnaryExpression -- UnaryExpression UnaryExpression : delete UnaryExpression void UnaryExpression typeof UnaryExpression + UnaryExpression - UnaryExpression ~ UnaryExpression ! UnaryExpression AwaitExpression ExponentiationExpression : UpdateExpression ** ExponentiationExpression MultiplicativeExpression : MultiplicativeExpression MultiplicativeOperator ExponentiationExpression AdditiveExpression : AdditiveExpression + MultiplicativeExpression AdditiveExpression - MultiplicativeExpression ShiftExpression : ShiftExpression << AdditiveExpression ShiftExpression >> AdditiveExpression ShiftExpression >>> AdditiveExpression RelationalExpression : RelationalExpression < ShiftExpression RelationalExpression > ShiftExpression RelationalExpression <= ShiftExpression RelationalExpression >= ShiftExpression RelationalExpression instanceof ShiftExpression RelationalExpression in ShiftExpression PrivateIdentifier in ShiftExpression EqualityExpression : EqualityExpression == RelationalExpression EqualityExpression != RelationalExpression EqualityExpression === RelationalExpression EqualityExpression !== RelationalExpression BitwiseANDExpression : BitwiseANDExpression & EqualityExpression BitwiseXORExpression : BitwiseXORExpression ^ BitwiseANDExpression BitwiseORExpression : BitwiseORExpression | BitwiseXORExpression LogicalANDExpression : LogicalANDExpression && BitwiseORExpression LogicalORExpression : LogicalORExpression || LogicalANDExpression CoalesceExpression : CoalesceExpressionHead ?? BitwiseORExpression ConditionalExpression : ShortCircuitExpression ? AssignmentExpression : AssignmentExpression AssignmentExpression : YieldExpression ArrowFunction AsyncArrowFunction LeftHandSideExpression = AssignmentExpression LeftHandSideExpression AssignmentOperator AssignmentExpression LeftHandSideExpression &&= AssignmentExpression LeftHandSideExpression ||= AssignmentExpression LeftHandSideExpression ??= AssignmentExpression Expression : Expression , AssignmentExpression
  1. invalid를 반환한다.

8.6.5 정적 의미론: PropName : String 또는 empty

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

PropertyDefinition : IdentifierReference
  1. IdentifierReference의 StringValue를 반환한다.
PropertyDefinition : ... AssignmentExpression
  1. empty를 반환한다.
PropertyDefinition : PropertyName : AssignmentExpression
  1. PropertyName의 PropName을 반환한다.
LiteralPropertyName : IdentifierName AttributeKey : IdentifierName
  1. IdentifierName의 StringValue를 반환한다.
LiteralPropertyName : StringLiteral AttributeKey : StringLiteral
  1. StringLiteral의 SV를 반환한다.
LiteralPropertyName : NumericLiteral
  1. nbrNumericLiteral의 NumericValue로 둔다.
  2. ToString(nbr)을 반환한다.
ComputedPropertyName : [ AssignmentExpression ]
  1. empty를 반환한다.
MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody } get ClassElementName ( ) { FunctionBody } set ClassElementName ( PropertySetParameterList ) { FunctionBody }
  1. ClassElementName의 PropName을 반환한다.
GeneratorMethod : * ClassElementName ( UniqueFormalParameters ) { GeneratorBody }
  1. ClassElementName의 PropName을 반환한다.
AsyncGeneratorMethod : async * ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody }
  1. ClassElementName의 PropName을 반환한다.
ClassElement : ClassStaticBlock
  1. empty를 반환한다.
ClassElement : ;
  1. empty를 반환한다.
AsyncMethod : async ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody }
  1. ClassElementName의 PropName을 반환한다.
FieldDefinition : ClassElementName Initializeropt
  1. ClassElementName의 PropName을 반환한다.
ClassElementName : PrivateIdentifier
  1. empty를 반환한다.