DescriptionFix scopes for body of sloppy-mode for-in/of loop
This patch fixes an obscure edge case for functions defined as the
direct body of a for-of/for-in loop, such as the following:
for (foo in []) function foo() { return foo; }
Here, the first occurrence of foo should point to the outer scope;
however, before this patch, it pointed to the inner foo in an
invalid way which caused an assertion about the scope chain to fail.
This patch fixes the scope chain by inserting an extra scope for
the body of the loop, not including the header.
BUG=chromium:542099
LOG=N
R=rossberg
Committed: https://crrev.com/d0618585a747e1ba51e84a2d30526d8b21ff7191
Cr-Commit-Position: refs/heads/master@{#31268}
Patch Set 1 #
Total comments: 4
Patch Set 2 : Fix comment, improve test #
Total comments: 1
Patch Set 3 : better comment #Patch Set 4 : Improve test #Messages
Total messages: 20 (7 generated)
|