Thursday, December 22, 2022

TopLevelLexicallyScopedDeclarations

TopLevelLexicallyScopedDeclarations

Block

  1. Block : { }
        Return a new empty List.
    
  2. StatementList : StatementList StatementListItem //StatementListItem can be Statement or Declaration
        Let declarations be TopLevelLexicallyScopedDeclarations of StatementList.
        Append to declarations the elements of the TopLevelLexicallyScopedDeclarations of StatementListItem.
        Return declarations.
    
  3. StatementListItem : Statement
        Return a new empty List.//VariableStatement contribute to Var instead of Lex
    
  4. StatementListItem : Declaration
        if Declaration is `let ` or `const `, return a new List containing Declaration;
        else Return a new empty List// TopLevel functions are taken as Var instead
    

Labelled Statements

Return a new empty List

Others

not documented in ecma documents

No comments:

Post a Comment