Description[es6] Fix scoping for default parameters in arrow functions
When eagerly parsing arrow functions, expressions in default
parameter initializers are parsed in the enclosing scope,
rather than in the function's scope (since that scope does not
yet exist). This leads to VariableProxies being added to the
wrong scope, and scope chains for FunctionLiterals being incorrect.
This patch addresses these problems by adding a subclass of
AstExpressionVisitor that moves VariableProxies to the proper
scope and fixes up scope chains of FunctionLiterals.
More work likely still needs to be done to make this work completely,
but it's very close to correct.
BUG=v8:4395
LOG=y
Committed: https://crrev.com/cf72aad39e51de9b7074ea039377c1812f4a2c6b
Cr-Commit-Position: refs/heads/master@{#31402}
Patch Set 1 #
Total comments: 4
Patch Set 2 : A few fixes #Patch Set 3 : Add a test #Patch Set 4 : Rebased #Patch Set 5 : Fix class literal handling #
Messages
Total messages: 20 (3 generated)
|