[es6] Fix completion values of for loops with lexical variables
authorconradw <conradw@chromium.org>
Thu, 18 Jun 2015 11:54:03 +0000 (04:54 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 18 Jun 2015 11:54:16 +0000 (11:54 +0000)
commit1bb051b8a4b81aea753715a833b425d120fb5da6
tree30d3dc64172915d3b9bf89457764cd9063540853
parent4a4ba797ae6828e760d947c42336b28dadf26ce4
[es6] Fix completion values of for loops with lexical variables

Currently, the desugaring of for loops of the form for
(let/const ...; bla; bla) causes them to always have a
completion value of 1, regardless of whether the loop body
is executed or not. This CL fixes this, realigning
initializer blocks as a more general purpose way to avoid
the completion value rewriter (since that's all they really
do anyway).

BUG=

Review URL: https://codereview.chromium.org/1177053006

Cr-Commit-Position: refs/heads/master@{#29108}
src/ast.h
src/parser.cc
src/prettyprinter.cc
src/rewriter.cc
test/mjsunit/es6/block-for.js