• adamk's avatar
    Disallow destructuring in legacy sloppy for-in loop parsing · ceb92ebf
    adamk authored
    For web compat reasons, we support an initializer in the declaration
    part of a for-in loop. But we should disallow this for destructured
    declarations (just as we do for lexical declarations). In fact, without
    disallowing it, we crash.
    
    Also fix up the PreParser to have the same restrictions here as the parser
    (the lexical check was missing there), verified by running the message tests
    with --min-preparse-length=0.
    
    In fixing the logic I've also cleaned up the code a bit, removing the
    only-called-once DeclarationParsingResult::SingleName method.
    
    BUG=v8:811
    LOG=n
    
    Review URL: https://codereview.chromium.org/1471973003
    
    Cr-Commit-Position: refs/heads/master@{#32236}
    ceb92ebf
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...
bot_default.gyp Loading commit data...
bot_default.isolate 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...