• Toon Verwaest's avatar
    [parser] Reuse identifier variable proxy for rewritten declaration · 8caaeb37
    Toon Verwaest authored
    When parsing an identifier as an expression we'll immediately create an
    unresolved VariableProxy in the parsing scope. If this variable ends up
    becoming a declaration, e.g., due to arrow function parameter, we'll move it
    into the function scope for that arrow function. Then to actually create the
    declarations we rewrite the "pattern". When we declare the variable, the proxy
    is automatically resolved to the variable we create from it. That means it
    can't be in the unresolved list anymore.
    
    We tried to remove the unresolved variable. Unfortunately, if there was a
    sloppy eval in a parameter context, there's an additional var-block scope
    created for the parameter. Rewriting happens in *that* scope. Hence we didn't
    always manage to remove the unresolved variable. I suppose as a fix an
    additional variable proxy was introduced; since otherwise the implicit
    resolution upon declaration would trigger a dcheck in scope resolution later.
    
    This CL removes the initial variable proxy from the correct scope, so it can be
    reused for the declaration.
    
    Change-Id: Id917afb177aef076a2947b0fdd03b5393bd29c3f
    Reviewed-on: https://chromium-review.googlesource.com/c/1261937Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
    Commit-Queue: Toon Verwaest <verwaest@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#56402}
    8caaeb37
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni 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 Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind 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...