archives

« Bugzilla Issues Index

#4480 — 13.2.7 - 13.2.10: Don't special case FunctionDeclaration and GeneratorDeclaration, instead use HoistableDeclaration


Instead of explicitly handling FunctionDeclaration and GeneratorDeclaration, 13.2.7 - 13.2.10 could simply use HoistableDeclaration. That way new hoistable declarations (like AsyncFunctionDeclaration) don't need to add new if-statements to 13.2.7 - 13.2.10.



13.2.7 Static Semantics: TopLevelLexicallyDeclaredNames
StatementListItem : Declaration

Steps 1.a-b could be simplified to:
---
a. Return << >>
---


13.2.8 Static Semantics: TopLevelLexicallyScopedDeclarations
StatementListItem : Declaration

Steps 1.a-b could be simplified to:
---
a. Return << >>
---


13.2.9 Static Semantics: TopLevelVarDeclaredNames
StatementListItem : Declaration

Steps 1.a-b could be simplified to:
---
a. Return the BoundNames of HoistableDeclaration.
---



13.2.10 Static Semantics: TopLevelVarScopedDeclarations
StatementListItem : Declaration


Steps 1.a-b could be simplified to:
---
a. Return DeclarationPart of HoistableDeclaration.
---


Fixed in ES2016 Draft.