In the GlobalDeclarationInstantiation abstract operation:
-
VarDeclarations is set to the result of varScopedDeclarations from the script.
-
Only the 8th step populates the
functionsToInitialize
anddeclaredFunctionNames
lists, and that happens if an element of VarDeclarations is a declaration.
i also don't understand why it says insert d as the first element instead of append d to functionsToInitialize
-
However, I believe that VarDeclarations cannot contain declarations, as the varScopedDeclarations operation seems to return an empty list for declarations.
If my understanding is correct, how then are functions initialized by the GlobalDeclarationInstantiation
operation or any other instantiation operation?
Could you also confirm if my understanding of VarScopedDeclarations
is accurate?