• 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...
cctest Loading commit data...
intl Loading commit data...
js-perf-test Loading commit data...
memory Loading commit data...
message Loading commit data...
mjsunit Loading commit data...
mozilla Loading commit data...
preparser Loading commit data...
promises-aplus Loading commit data...
simdjs Loading commit data...
test262 Loading commit data...
unittests Loading commit data...
webkit Loading commit data...
default.gyp Loading commit data...
default.isolate Loading commit data...
optimize_for_size.gyp Loading commit data...
optimize_for_size.isolate Loading commit data...