Reviewers: arv, rossberg,

Message:
PTAL

Description:
[destructuring] Grand for statement parsing unification.

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=a...@chromium.org,rossb...@chromium.org
BUG=v8:811
LOG=N

Please review this at https://codereview.chromium.org/1149043005/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+148, -108 lines):
  M src/parser.h
  M src/parser.cc
  M src/pattern-rewriter.cc
  M test/cctest/test-parsing.cc
  M test/mjsunit/es6/debug-stepnext-for.js
  M test/mjsunit/harmony/destructuring.js


--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to