• dslomov's avatar
    [destructuring] Grand for statement parsing unification. · 7ffdb519
    dslomov authored
    Also support patterns in ``for (var p in/of ...)``
    
    This CL extends the rewriting we used to do for ``for (let p in/of...)`` to
    ``for (var p in/of ...)``. For all for..in/of loop declaring variable,
    we rewrite
       for (var/let/const pattern in/of e) b
    into
       for (x' in/of e) { var/let/const pattern = e; b }
    
    This adds a small complication for debugger: for a statement
       for (var v in/of e) ...
    we used to have
       var v;
       for (v in/of e) ...
    and there was a separate breakpoint on ``var v`` line.
    This breakpoint is actually useless since it is immediately followed by
    a breakpoint on evaluation of ``e``, so this CL removes that breakpoint
    location.
    
    Similiraly, for let, it used to be that
      for (let v in/of e) ...
    became
      for (x' in/of e) { let v; v  = x'; ... }
    ``let v``generetaed a useless breakpoint (with the location at the
    loop's head. This CL removes that breakpoint as well.
    
    R=arv@chromium.org,rossberg@chromium.org
    BUG=v8:811
    LOG=N
    
    Review URL: https://codereview.chromium.org/1149043005
    
    Cr-Commit-Position: refs/heads/master@{#28565}
    7ffdb519
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
include 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...