Description[modules] Treat top-level functions as lexical
[15.2.1.11 Static Semantics:
LexicallyDeclaredNames](https://tc39.github.io/ecma262/#sec-module-semantics-static-semantics-lexicallydeclarednames)
(in contrast with its definition for StatementListItem) makes no
explicit provision for HoistableDeclarations. This means that function
declarations are treated as lexically scoped in module code, as
described in section 15.2.1.11's informative note:
> At the top level of a function, or script, function declarations are
> treated like var declarations rather than like lexical declarations.
BUG=v8:4884
LOG=N
R=adamk@chromium.org
Committed: https://crrev.com/43fa3e65c931bc2a91a7e2be935ebbc4fb269b0d
Cr-Commit-Position: refs/heads/master@{#35633}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Re-implement logic in ParseFunctionDeclaration #
Messages
Total messages: 13 (4 generated)
|