Thursday, December 22, 2022

TopLevelVarScopedDeclarations

TopLevelVarScopedDeclarations

Block

  1. Block : { }
        Return a new empty List.
    
  2. StatementList : StatementList StatementListItem //StatementListItem can be Statement or Declaration
        Let declarations be TopLevelVarScopedDeclarations of StatementList.
        Append to declarations the elements of the TopLevelVarScopedDeclarations of StatementListItem.
        Return declarations.
    
  3. StatementListItem : Declaration
        if is function Declaration, return a list contains the Declaration// function is not taken as Lex but top level Var!
    

Label Statement

LabelledStatement : LabelIdentifier : LabelledItem

    Return the TopLevelVarScopedDeclarations of LabelledItem.

LabelledItem : Statement

    // recursive to the last non-labelled Statement
    If Statement is Statement : LabelledStatement , return TopLevelVarScopedDeclarations of Statement
    Return VarScopedDeclarations of Statement.

Others

not documented in ecma documents

No comments:

Post a Comment