A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://tc39.es/ecma262/multipage/syntax-directed-operations.html below:

ECMAScript® 2026 Language Specification

In addition to those defined in this section, specialized syntax-directed operations are defined throughout this specification.

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*" is used within this specification as a synthetic name for a module's default export when it does not have another name. An entry in the module's [[Environment]] is created with that name and holds the corresponding value, and resolving the export named "default" by calling ResolveExport ( exportName [ , resolveSet ] ) for the module will return a ResolvedBinding Record whose [[BindingName]] is "*default*" , which will then resolve in the module's [[Environment]] to the above-mentioned value. This is done only for ease of specification, so that anonymous default exports can be resolved like any other export. This "*default*" string is never accessible to ECMAScript code or to the module linking algorithm.

It is defined piecewise over the following productions:

BindingIdentifier : Identifier
  1. Return a List whose sole element is the StringValue of Identifier .
BindingIdentifier : yield
  1. Return « "yield"  ».
BindingIdentifier : await
  1. Return « "await"  ».
LexicalDeclaration : LetOrConst BindingList ;
  1. Return the BoundNames of BindingList .
BindingList : BindingList , LexicalBinding
  1. Let names1 be the BoundNames of BindingList .
  2. Let names2 be the BoundNames of LexicalBinding .
  3. Return the list-concatenation of names1 and names2.
LexicalBinding : BindingIdentifier Initializer opt
  1. Return the BoundNames of BindingIdentifier .
LexicalBinding : BindingPattern Initializer
  1. Return the BoundNames of BindingPattern .
VariableDeclarationList : VariableDeclarationList , VariableDeclaration
  1. Let names1 be the BoundNames of VariableDeclarationList .
  2. Let names2 be the BoundNames of VariableDeclaration .
  3. Return the list-concatenation of names1 and names2.
VariableDeclaration : BindingIdentifier Initializer opt
  1. Return the BoundNames of BindingIdentifier .
VariableDeclaration : BindingPattern Initializer
  1. Return the BoundNames of BindingPattern .
ObjectBindingPattern : { }
  1. Return a new empty List .
ObjectBindingPattern : { BindingPropertyList , BindingRestProperty }
  1. Let names1 be the BoundNames of BindingPropertyList .
  2. Let names2 be the BoundNames of BindingRestProperty .
  3. Return the list-concatenation of names1 and names2.
ArrayBindingPattern : [ Elision opt ]
  1. Return a new empty List .
ArrayBindingPattern : [ Elision opt BindingRestElement ]
  1. Return the BoundNames of BindingRestElement .
ArrayBindingPattern : [ BindingElementList , Elision opt ]
  1. Return the BoundNames of BindingElementList .
ArrayBindingPattern : [ BindingElementList , Elision opt BindingRestElement ]
  1. Let names1 be the BoundNames of BindingElementList .
  2. Let names2 be the BoundNames of BindingRestElement .
  3. Return the list-concatenation of names1 and names2.
BindingPropertyList : BindingPropertyList , BindingProperty
  1. Let names1 be the BoundNames of BindingPropertyList .
  2. Let names2 be the BoundNames of BindingProperty .
  3. Return the list-concatenation of names1 and names2.
BindingElementList : BindingElementList , BindingElisionElement
  1. Let names1 be the BoundNames of BindingElementList .
  2. Let names2 be the BoundNames of BindingElisionElement .
  3. Return the list-concatenation of names1 and names2.
BindingElisionElement : Elision opt BindingElement
  1. Return the BoundNames of BindingElement .
BindingProperty : PropertyName : BindingElement
  1. Return the BoundNames of BindingElement .
SingleNameBinding : BindingIdentifier Initializer opt
  1. Return the BoundNames of BindingIdentifier .
BindingElement : BindingPattern Initializer opt
  1. Return the BoundNames of BindingPattern .
ForDeclaration : LetOrConst ForBinding
  1. Return the BoundNames of ForBinding .
FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
  1. Return the BoundNames of BindingIdentifier .
FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
  1. Return « "*default*"  ».
FormalParameters : [empty]
  1. Return a new empty List .
FormalParameters : FormalParameterList , FunctionRestParameter
  1. Let names1 be the BoundNames of FormalParameterList .
  2. Let names2 be the BoundNames of FunctionRestParameter .
  3. Return the list-concatenation of names1 and names2.
FormalParameterList : FormalParameterList , FormalParameter
  1. Let names1 be the BoundNames of FormalParameterList .
  2. Let names2 be the BoundNames of FormalParameter .
  3. Return the list-concatenation of names1 and names2.
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
  1. Let formals be the ArrowFormalParameters that is covered by CoverParenthesizedExpressionAndArrowParameterList .
  2. Return the BoundNames of formals.
GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
  1. Return the BoundNames of BindingIdentifier .
GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
  1. Return « "*default*"  ».
AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
  1. Return the BoundNames of BindingIdentifier .
AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
  1. Return « "*default*"  ».
ClassDeclaration : class BindingIdentifier ClassTail
  1. Return the BoundNames of BindingIdentifier .
ClassDeclaration : class ClassTail
  1. Return « "*default*"  ».
AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
  1. Return the BoundNames of BindingIdentifier .
AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
  1. Return « "*default*"  ».
CoverCallExpressionAndAsyncArrowHead : MemberExpression Arguments
  1. Let head be the AsyncArrowHead that is covered by CoverCallExpressionAndAsyncArrowHead .
  2. Return the BoundNames of head.
ImportDeclaration : import ImportClause FromClause WithClause opt ;
  1. Return the BoundNames of ImportClause .
ImportDeclaration : import ModuleSpecifier WithClause opt ;
  1. Return a new empty List .
ImportClause : ImportedDefaultBinding , NameSpaceImport
  1. Let names1 be the BoundNames of ImportedDefaultBinding .
  2. Let names2 be the BoundNames of NameSpaceImport .
  3. Return the list-concatenation of names1 and names2.
ImportClause : ImportedDefaultBinding , NamedImports
  1. Let names1 be the BoundNames of ImportedDefaultBinding .
  2. Let names2 be the BoundNames of NamedImports .
  3. Return the list-concatenation of names1 and names2.
NamedImports : { }
  1. Return a new empty List .
ImportsList : ImportsList , ImportSpecifier
  1. Let names1 be the BoundNames of ImportsList .
  2. Let names2 be the BoundNames of ImportSpecifier .
  3. Return the list-concatenation of names1 and names2.
ImportSpecifier : ModuleExportName as ImportedBinding
  1. Return the BoundNames of ImportedBinding .
ExportDeclaration : export ExportFromClause FromClause WithClause opt ; export NamedExports ;
  1. Return a new empty List .
ExportDeclaration : export VariableStatement
  1. Return the BoundNames of VariableStatement .
ExportDeclaration : export Declaration
  1. Return the BoundNames of Declaration .
ExportDeclaration : export default HoistableDeclaration
  1. Let declarationNames be the BoundNames of HoistableDeclaration .
  2. If declarationNames does not include the element "*default*" , append "*default*" to declarationNames.
  3. Return declarationNames.
ExportDeclaration : export default ClassDeclaration
  1. Let declarationNames be the BoundNames of ClassDeclaration .
  2. If declarationNames does not include the element "*default*" , append "*default*" to declarationNames.
  3. Return declarationNames.
ExportDeclaration : export default AssignmentExpression ;
  1. Return « "*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. Return FunctionDeclaration .
HoistableDeclaration : GeneratorDeclaration
  1. Return GeneratorDeclaration .
HoistableDeclaration : AsyncFunctionDeclaration
  1. Return AsyncFunctionDeclaration .
HoistableDeclaration : AsyncGeneratorDeclaration
  1. Return AsyncGeneratorDeclaration .
Declaration : ClassDeclaration
  1. Return ClassDeclaration .
Declaration : LexicalDeclaration
  1. Return 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. Return IsConstantDeclaration of LetOrConst .
LetOrConst : let
  1. Return false .
LetOrConst : const
  1. Return 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. Return false .
ClassDeclaration : class BindingIdentifier ClassTail class ClassTail
  1. Return false .
ExportDeclaration : export ExportFromClause FromClause ; export NamedExports ; export default AssignmentExpression ;
  1. Return false .
Note

It is not necessary to treat export default AssignmentExpression as a constant declaration because there is no syntax that permits assignment to the internal bound name used to reference a module's default object.

8.2.4 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. Return a new empty List .
StatementList : StatementList StatementListItem
  1. Let names1 be the LexicallyDeclaredNames of StatementList .
  2. Let names2 be the LexicallyDeclaredNames of StatementListItem .
  3. Return the list-concatenation of names1 and names2.
StatementListItem : Statement
  1. If Statement is Statement : LabelledStatement , return the LexicallyDeclaredNames of LabelledStatement .
  2. Return a new empty List .
StatementListItem : Declaration
  1. Return the BoundNames of Declaration .
CaseBlock : { }
  1. Return a new empty List .
CaseBlock : { CaseClauses opt DefaultClause CaseClauses opt }
  1. If the first CaseClauses is present, let names1 be the LexicallyDeclaredNames of the first CaseClauses .
  2. Else, let names1 be a new empty List .
  3. Let names2 be the LexicallyDeclaredNames of DefaultClause .
  4. If the second CaseClauses is present, let names3 be the LexicallyDeclaredNames of the second CaseClauses .
  5. Else, let names3 be a new empty List .
  6. Return the list-concatenation of names1, names2, and names3.
CaseClauses : CaseClauses CaseClause
  1. Let names1 be the LexicallyDeclaredNames of CaseClauses .
  2. Let names2 be the LexicallyDeclaredNames of CaseClause .
  3. Return the list-concatenation of names1 and names2.
CaseClause : case Expression : StatementList opt
  1. If the StatementList is present, return the LexicallyDeclaredNames of StatementList .
  2. Return a new empty List .
DefaultClause : default : StatementList opt
  1. If the StatementList is present, return the LexicallyDeclaredNames of StatementList .
  2. Return a new empty List .
LabelledStatement : LabelIdentifier : LabelledItem
  1. Return the LexicallyDeclaredNames of LabelledItem .
LabelledItem : Statement
  1. Return a new empty List .
LabelledItem : FunctionDeclaration
  1. Return the BoundNames of FunctionDeclaration .
FunctionStatementList : [empty]
  1. Return a new empty List .
FunctionStatementList : StatementList
  1. Return the TopLevelLexicallyDeclaredNames of StatementList .
ClassStaticBlockStatementList : [empty]
  1. Return a new empty List .
ClassStaticBlockStatementList : StatementList
  1. Return the TopLevelLexicallyDeclaredNames of StatementList .
ConciseBody : ExpressionBody
  1. Return a new empty List .
AsyncConciseBody : ExpressionBody
  1. Return a new empty List .
Script : [empty]
  1. Return a new empty List .
ScriptBody : StatementList
  1. Return the TopLevelLexicallyDeclaredNames of StatementList .
Note 1

At the top level of a Script , function declarations are treated like var declarations rather than like lexical declarations.

Note 2

The LexicallyDeclaredNames of a Module includes the names of all of its imported bindings.

ModuleItemList : ModuleItemList ModuleItem
  1. Let names1 be the LexicallyDeclaredNames of ModuleItemList .
  2. Let names2 be the LexicallyDeclaredNames of ModuleItem .
  3. Return the list-concatenation of names1 and names2.
ModuleItem : ImportDeclaration
  1. Return the BoundNames of ImportDeclaration .
ModuleItem : ExportDeclaration
  1. If ExportDeclaration is export VariableStatement , return a new empty List .
  2. Return the BoundNames of ExportDeclaration .
ModuleItem : StatementListItem
  1. Return the LexicallyDeclaredNames of StatementListItem .
Note 3

At the top level of a Module , function declarations are treated like lexical declarations rather than like var declarations.

8.2.5 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. Let declarations1 be the LexicallyScopedDeclarations of StatementList .
  2. Let declarations2 be the LexicallyScopedDeclarations of StatementListItem .
  3. Return the list-concatenation of declarations1 and declarations2.
StatementListItem : Statement
  1. If Statement is Statement : LabelledStatement , return the LexicallyScopedDeclarations of LabelledStatement .
  2. Return a new empty List .
StatementListItem : Declaration
  1. Return a List whose sole element is the DeclarationPart of Declaration .
CaseBlock : { }
  1. Return a new empty List .
CaseBlock : { CaseClauses opt DefaultClause CaseClauses opt }
  1. If the first CaseClauses is present, let declarations1 be the LexicallyScopedDeclarations of the first CaseClauses .
  2. Else, let declarations1 be a new empty List .
  3. Let declarations2 be the LexicallyScopedDeclarations of DefaultClause .
  4. If the second CaseClauses is present, let declarations3 be the LexicallyScopedDeclarations of the second CaseClauses .
  5. Else, let declarations3 be a new empty List .
  6. Return the list-concatenation of declarations1, declarations2, and declarations3.
CaseClauses : CaseClauses CaseClause
  1. Let declarations1 be the LexicallyScopedDeclarations of CaseClauses .
  2. Let declarations2 be the LexicallyScopedDeclarations of CaseClause .
  3. Return the list-concatenation of declarations1 and declarations2.
CaseClause : case Expression : StatementList opt
  1. If the StatementList is present, return the LexicallyScopedDeclarations of StatementList .
  2. Return a new empty List .
DefaultClause : default : StatementList opt
  1. If the StatementList is present, return the LexicallyScopedDeclarations of StatementList .
  2. Return a new empty List .
LabelledStatement : LabelIdentifier : LabelledItem
  1. Return the LexicallyScopedDeclarations of LabelledItem .
LabelledItem : Statement
  1. Return a new empty List .
LabelledItem : FunctionDeclaration
  1. Return « FunctionDeclaration  ».
FunctionStatementList : [empty]
  1. Return a new empty List .
FunctionStatementList : StatementList
  1. Return the TopLevelLexicallyScopedDeclarations of StatementList .
ClassStaticBlockStatementList : [empty]
  1. Return a new empty List .
ClassStaticBlockStatementList : StatementList
  1. Return the TopLevelLexicallyScopedDeclarations of StatementList .
ConciseBody : ExpressionBody
  1. Return a new empty List .
AsyncConciseBody : ExpressionBody
  1. Return a new empty List .
Script : [empty]
  1. Return a new empty List .
ScriptBody : StatementList
  1. Return the TopLevelLexicallyScopedDeclarations of StatementList .
Module : [empty]
  1. Return a new empty List .
ModuleItemList : ModuleItemList ModuleItem
  1. Let declarations1 be the LexicallyScopedDeclarations of ModuleItemList .
  2. Let declarations2 be the LexicallyScopedDeclarations of ModuleItem .
  3. Return the list-concatenation of declarations1 and declarations2.
ModuleItem : ImportDeclaration
  1. Return a new empty List .
ExportDeclaration : export ExportFromClause FromClause WithClause opt ; export NamedExports ; export VariableStatement
  1. Return a new empty List .
ExportDeclaration : export Declaration
  1. Return a List whose sole element is the DeclarationPart of Declaration .
ExportDeclaration : export default HoistableDeclaration
  1. Return a List whose sole element is the DeclarationPart of HoistableDeclaration .
ExportDeclaration : export default ClassDeclaration
  1. Return a List whose sole element is ClassDeclaration .
ExportDeclaration : export default AssignmentExpression ;
  1. Return a List whose sole element is this ExportDeclaration .
8.2.6 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. Return a new empty List .
Block : { }
  1. Return a new empty List .
StatementList : StatementList StatementListItem
  1. Let names1 be the VarDeclaredNames of StatementList .
  2. Let names2 be the VarDeclaredNames of StatementListItem .
  3. Return the list-concatenation of names1 and names2.
StatementListItem : Declaration
  1. Return a new empty List .
VariableStatement : var VariableDeclarationList ;
  1. Return the BoundNames of VariableDeclarationList .
IfStatement : if ( Expression ) Statement else Statement
  1. Let names1 be the VarDeclaredNames of the first Statement .
  2. Let names2 be the VarDeclaredNames of the second Statement .
  3. Return the list-concatenation of names1 and names2.
IfStatement : if ( Expression ) Statement
  1. Return the VarDeclaredNames of Statement .
DoWhileStatement : do Statement while ( Expression ) ;
  1. Return the VarDeclaredNames of Statement .
WhileStatement : while ( Expression ) Statement
  1. Return the VarDeclaredNames of Statement .
ForStatement : for ( Expression opt ; Expression opt ; Expression opt ) Statement
  1. Return the VarDeclaredNames of Statement .
ForStatement : for ( var VariableDeclarationList ; Expression opt ; Expression opt ) Statement
  1. Let names1 be the BoundNames of VariableDeclarationList .
  2. Let names2 be the VarDeclaredNames of Statement .
  3. Return the list-concatenation of names1 and names2.
ForStatement : for ( LexicalDeclaration Expression opt ; Expression opt ) Statement
  1. Return the VarDeclaredNames of Statement .
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. Return the VarDeclaredNames of Statement .
ForInOfStatement : for ( var ForBinding in Expression ) Statement for ( var ForBinding of AssignmentExpression ) Statement for await ( var ForBinding of AssignmentExpression ) Statement
  1. Let names1 be the BoundNames of ForBinding .
  2. Let names2 be the VarDeclaredNames of Statement .
  3. Return the list-concatenation of names1 and names2.
Note

This section is extended by Annex B.3.5 .

WithStatement : with ( Expression ) Statement
  1. Return the VarDeclaredNames of Statement .
SwitchStatement : switch ( Expression ) CaseBlock
  1. Return the VarDeclaredNames of CaseBlock .
CaseBlock : { }
  1. Return a new empty List .
CaseBlock : { CaseClauses opt DefaultClause CaseClauses opt }
  1. If the first CaseClauses is present, let names1 be the VarDeclaredNames of the first CaseClauses .
  2. Else, let names1 be a new empty List .
  3. Let names2 be the VarDeclaredNames of DefaultClause .
  4. If the second CaseClauses is present, let names3 be the VarDeclaredNames of the second CaseClauses .
  5. Else, let names3 be a new empty List .
  6. Return the list-concatenation of names1, names2, and names3.
CaseClauses : CaseClauses CaseClause
  1. Let names1 be the VarDeclaredNames of CaseClauses .
  2. Let names2 be the VarDeclaredNames of CaseClause .
  3. Return the list-concatenation of names1 and names2.
CaseClause : case Expression : StatementList opt
  1. If the StatementList is present, return the VarDeclaredNames of StatementList .
  2. Return a new empty List .
DefaultClause : default : StatementList opt
  1. If the StatementList is present, return the VarDeclaredNames of StatementList .
  2. Return a new empty List .
LabelledStatement : LabelIdentifier : LabelledItem
  1. Return the VarDeclaredNames of LabelledItem .
LabelledItem : FunctionDeclaration
  1. Return a new empty List .
TryStatement : try Block Catch
  1. Let names1 be the VarDeclaredNames of Block .
  2. Let names2 be the VarDeclaredNames of Catch .
  3. Return the list-concatenation of names1 and names2.
TryStatement : try Block Finally
  1. Let names1 be the VarDeclaredNames of Block .
  2. Let names2 be the VarDeclaredNames of Finally .
  3. Return the list-concatenation of names1 and names2.
TryStatement : try Block Catch Finally
  1. Let names1 be the VarDeclaredNames of Block .
  2. Let names2 be the VarDeclaredNames of Catch .
  3. Let names3 be the VarDeclaredNames of Finally .
  4. Return the list-concatenation of names1, names2, and names3.
Catch : catch ( CatchParameter ) Block
  1. Return the VarDeclaredNames of Block .
FunctionStatementList : [empty]
  1. Return a new empty List .
FunctionStatementList : StatementList
  1. Return the TopLevelVarDeclaredNames of StatementList .
ClassStaticBlockStatementList : [empty]
  1. Return a new empty List .
ClassStaticBlockStatementList : StatementList
  1. Return the TopLevelVarDeclaredNames of StatementList .
ConciseBody : ExpressionBody
  1. Return a new empty List .
AsyncConciseBody : ExpressionBody
  1. Return a new empty List .
Script : [empty]
  1. Return a new empty List .
ScriptBody : StatementList
  1. Return the TopLevelVarDeclaredNames of StatementList .
ModuleItemList : ModuleItemList ModuleItem
  1. Let names1 be the VarDeclaredNames of ModuleItemList .
  2. Let names2 be the VarDeclaredNames of ModuleItem .
  3. Return the list-concatenation of names1 and names2.
ModuleItem : ImportDeclaration
  1. Return a new empty List .
ModuleItem : ExportDeclaration
  1. If ExportDeclaration is export VariableStatement , return the BoundNames of ExportDeclaration .
  2. Return a new empty List .
8.2.7 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. Return a new empty List .
Block : { }
  1. Return a new empty List .
StatementList : StatementList StatementListItem
  1. Let declarations1 be the VarScopedDeclarations of StatementList .
  2. Let declarations2 be the VarScopedDeclarations of StatementListItem .
  3. Return the list-concatenation of declarations1 and declarations2.
StatementListItem : Declaration
  1. Return a new empty List .
VariableDeclarationList : VariableDeclaration
  1. Return « VariableDeclaration  ».
VariableDeclarationList : VariableDeclarationList , VariableDeclaration
  1. Let declarations1 be the VarScopedDeclarations of VariableDeclarationList .
  2. Return the list-concatenation of declarations1 and « VariableDeclaration  ».
IfStatement : if ( Expression ) Statement else Statement
  1. Let declarations1 be the VarScopedDeclarations of the first Statement .
  2. Let declarations2 be the VarScopedDeclarations of the second Statement .
  3. Return the list-concatenation of declarations1 and declarations2.
IfStatement : if ( Expression ) Statement
  1. Return the VarScopedDeclarations of Statement .
DoWhileStatement : do Statement while ( Expression ) ;
  1. Return the VarScopedDeclarations of Statement .
WhileStatement : while ( Expression ) Statement
  1. Return the VarScopedDeclarations of Statement .
ForStatement : for ( Expression opt ; Expression opt ; Expression opt ) Statement
  1. Return the VarScopedDeclarations of Statement .
ForStatement : for ( var VariableDeclarationList ; Expression opt ; Expression opt ) Statement
  1. Let declarations1 be the VarScopedDeclarations of VariableDeclarationList .
  2. Let declarations2 be the VarScopedDeclarations of Statement .
  3. Return the list-concatenation of declarations1 and declarations2.
ForStatement : for ( LexicalDeclaration Expression opt ; Expression opt ) Statement
  1. Return the VarScopedDeclarations of Statement .
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. Return the VarScopedDeclarations of Statement .
ForInOfStatement : for ( var ForBinding in Expression ) Statement for ( var ForBinding of AssignmentExpression ) Statement for await ( var ForBinding of AssignmentExpression ) Statement
  1. Let declarations1 be « ForBinding  ».
  2. Let declarations2 be the VarScopedDeclarations of Statement .
  3. Return the list-concatenation of declarations1 and declarations2.
Note

This section is extended by Annex B.3.5 .

WithStatement : with ( Expression ) Statement
  1. Return the VarScopedDeclarations of Statement .
SwitchStatement : switch ( Expression ) CaseBlock
  1. Return the VarScopedDeclarations of CaseBlock .
CaseBlock : { }
  1. Return a new empty List .
CaseBlock : { CaseClauses opt DefaultClause CaseClauses opt }
  1. If the first CaseClauses is present, let declarations1 be the VarScopedDeclarations of the first CaseClauses .
  2. Else, let declarations1 be a new empty List .
  3. Let declarations2 be the VarScopedDeclarations of DefaultClause .
  4. If the second CaseClauses is present, let declarations3 be the VarScopedDeclarations of the second CaseClauses .
  5. Else, let declarations3 be a new empty List .
  6. Return the list-concatenation of declarations1, declarations2, and declarations3.
CaseClauses : CaseClauses CaseClause
  1. Let declarations1 be the VarScopedDeclarations of CaseClauses .
  2. Let declarations2 be the VarScopedDeclarations of CaseClause .
  3. Return the list-concatenation of declarations1 and declarations2.
CaseClause : case Expression : StatementList opt
  1. If the StatementList is present, return the VarScopedDeclarations of StatementList .
  2. Return a new empty List .
DefaultClause : default : StatementList opt
  1. If the StatementList is present, return the VarScopedDeclarations of StatementList .
  2. Return a new empty List .
LabelledStatement : LabelIdentifier : LabelledItem
  1. Return the VarScopedDeclarations of LabelledItem .
LabelledItem : FunctionDeclaration
  1. Return a new empty List .
TryStatement : try Block Catch
  1. Let declarations1 be the VarScopedDeclarations of Block .
  2. Let declarations2 be the VarScopedDeclarations of Catch .
  3. Return the list-concatenation of declarations1 and declarations2.
TryStatement : try Block Finally
  1. Let declarations1 be the VarScopedDeclarations of Block .
  2. Let declarations2 be the VarScopedDeclarations of Finally .
  3. Return the list-concatenation of declarations1 and declarations2.
TryStatement : try Block Catch Finally
  1. Let declarations1 be the VarScopedDeclarations of Block .
  2. Let declarations2 be the VarScopedDeclarations of Catch .
  3. Let declarations3 be the VarScopedDeclarations of Finally .
  4. Return the list-concatenation of declarations1, declarations2, and declarations3.
Catch : catch ( CatchParameter ) Block
  1. Return the VarScopedDeclarations of Block .
FunctionStatementList : [empty]
  1. Return a new empty List .
FunctionStatementList : StatementList
  1. Return the TopLevelVarScopedDeclarations of StatementList .
ClassStaticBlockStatementList : [empty]
  1. Return a new empty List .
ClassStaticBlockStatementList : StatementList
  1. Return the TopLevelVarScopedDeclarations of StatementList .
ConciseBody : ExpressionBody
  1. Return a new empty List .
AsyncConciseBody : ExpressionBody
  1. Return a new empty List .
Script : [empty]
  1. Return a new empty List .
ScriptBody : StatementList
  1. Return the TopLevelVarScopedDeclarations of StatementList .
Module : [empty]
  1. Return a new empty List .
ModuleItemList : ModuleItemList ModuleItem
  1. Let declarations1 be the VarScopedDeclarations of ModuleItemList .
  2. Let declarations2 be the VarScopedDeclarations of ModuleItem .
  3. Return the list-concatenation of declarations1 and declarations2.
ModuleItem : ImportDeclaration
  1. Return a new empty List .
ModuleItem : ExportDeclaration
  1. If ExportDeclaration is export VariableStatement , return the VarScopedDeclarations of VariableStatement .
  2. Return a new empty List .
8.2.8 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. Let names1 be the TopLevelLexicallyDeclaredNames of StatementList .
  2. Let names2 be the TopLevelLexicallyDeclaredNames of StatementListItem .
  3. Return the list-concatenation of names1 and names2.
StatementListItem : Statement
  1. Return a new empty List .
StatementListItem : Declaration
  1. If Declaration is Declaration : HoistableDeclaration , then
    1. Return a new empty List .
  2. Return the BoundNames of Declaration .
Note

At the top level of a function, or script, function declarations are treated like var declarations rather than like lexical declarations.

8.2.9 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. Let declarations1 be the TopLevelLexicallyScopedDeclarations of StatementList .
  2. Let declarations2 be the TopLevelLexicallyScopedDeclarations of StatementListItem .
  3. Return the list-concatenation of declarations1 and declarations2.
StatementListItem : Statement
  1. Return a new empty List .
StatementListItem : Declaration
  1. If Declaration is Declaration : HoistableDeclaration , then
    1. Return a new empty List .
  2. Return « Declaration  ».
8.2.10 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. Let names1 be the TopLevelVarDeclaredNames of StatementList .
  2. Let names2 be the TopLevelVarDeclaredNames of StatementListItem .
  3. Return the list-concatenation of names1 and names2.
StatementListItem : Declaration
  1. If Declaration is Declaration : HoistableDeclaration , then
    1. Return the BoundNames of HoistableDeclaration .
  2. Return a new empty List .
StatementListItem : Statement
  1. If Statement is Statement : LabelledStatement , return the TopLevelVarDeclaredNames of Statement .
  2. Return the VarDeclaredNames of Statement .
Note

At the top level of a function or script, inner function declarations are treated like var declarations.

LabelledStatement : LabelIdentifier : LabelledItem
  1. Return the TopLevelVarDeclaredNames of LabelledItem .
LabelledItem : Statement
  1. If Statement is Statement : LabelledStatement , return the TopLevelVarDeclaredNames of Statement .
  2. Return the VarDeclaredNames of Statement .
LabelledItem : FunctionDeclaration
  1. Return the BoundNames of FunctionDeclaration .
8.2.11 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. Let declarations1 be the TopLevelVarScopedDeclarations of StatementList .
  2. Let declarations2 be the TopLevelVarScopedDeclarations of StatementListItem .
  3. Return the list-concatenation of declarations1 and declarations2.
StatementListItem : Statement
  1. If Statement is Statement : LabelledStatement , return the TopLevelVarScopedDeclarations of Statement .
  2. Return the VarScopedDeclarations of Statement .
StatementListItem : Declaration
  1. If Declaration is Declaration : HoistableDeclaration , then
    1. Let declaration be the DeclarationPart of HoistableDeclaration .
    2. Return « declaration ».
  2. Return a new empty List .
LabelledStatement : LabelIdentifier : LabelledItem
  1. Return the TopLevelVarScopedDeclarations of LabelledItem .
LabelledItem : Statement
  1. If Statement is Statement : LabelledStatement , return the TopLevelVarScopedDeclarations of Statement .
  2. Return the VarScopedDeclarations of Statement .
LabelledItem : FunctionDeclaration
  1. Return « FunctionDeclaration  ».

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4