• littledan's avatar
    Fix scopes for body of sloppy-mode for-in/of loop · d0618585
    littledan authored
    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
    
    Review URL: https://codereview.chromium.org/1396663004
    
    Cr-Commit-Position: refs/heads/master@{#31268}
    d0618585
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
docs Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party/binutils Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
Makefile.nacl Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...