• Marja Hölttä's avatar
    [parser] Fix arrow funcs w/ destructuring params again. [Alternative fix] · 138fbdb4
    Marja Hölttä authored
    What happened:
    - When rewriting in DoParseFunction, the relevant function scope is no longer in
    the scope stack.
    - The correct scope is given to the PatternRewriter.
    - PatternRewriter called to Parser::BuildIteratorCloseForCompletion.
    - BuildIteratorCloseForCompletion would just call NewTemporary (which creates
    a new temporary in Parser's current scope) instead of using the scope passed to
    it and calling NewTemporary on it.
    - Normally this went unnoticed, since it doesn't matter that much where the
    temporary is.
    - But in the lazy arrow func case, the Parser's scope at that point was the
    already-resolved outer scope, and a DCHECK detected this problem.
    
    Kudos & thanks to verwaest@ for a debugging session :)
    
    BUG=chromium:761831
    
    Change-Id: I1e8474ce927be0330f4ba4efc0fc08fdcc328809
    Reviewed-on: https://chromium-review.googlesource.com/650297
    Commit-Queue: Marja Hölttä <marja@chromium.org>
    Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
    Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#47877}
    138fbdb4
Name
Last commit
Last update
..
OWNERS Loading commit data...
duplicate-finder.h Loading commit data...
expression-classifier.h Loading commit data...
expression-scope-reparenter.cc Loading commit data...
expression-scope-reparenter.h Loading commit data...
func-name-inferrer.cc Loading commit data...
func-name-inferrer.h Loading commit data...
parse-info.cc Loading commit data...
parse-info.h Loading commit data...
parser-base.h Loading commit data...
parser.cc Loading commit data...
parser.h Loading commit data...
parsing.cc Loading commit data...
parsing.h Loading commit data...
pattern-rewriter.cc Loading commit data...
preparse-data-format.h Loading commit data...
preparse-data.cc Loading commit data...
preparse-data.h Loading commit data...
preparsed-scope-data.cc Loading commit data...
preparsed-scope-data.h Loading commit data...
preparser.cc Loading commit data...
preparser.h Loading commit data...
rewriter.cc Loading commit data...
rewriter.h Loading commit data...
scanner-character-streams.cc Loading commit data...
scanner-character-streams.h Loading commit data...
scanner.cc Loading commit data...
scanner.h Loading commit data...
token.cc Loading commit data...
token.h Loading commit data...