[es6] Ensure that for-in/of loops have a proper TDZ for their lexically-bound variables
authoradamk <adamk@chromium.org>
Wed, 1 Jul 2015 00:27:15 +0000 (17:27 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 1 Jul 2015 00:27:30 +0000 (00:27 +0000)
commit62572e011e73da2669be6e724243405e42304d78
tree43d0ad2ff2288369606bef8142012210a125e0b7
parent9adb5f0a59210a3c46eb17ed00226d2461192af4
[es6] Ensure that for-in/of loops have a proper TDZ for their lexically-bound variables

The enumerable expression in a for-in/of loop is supposed to have a TDZ for any
lexically bound names in that loop (there can be more than one with destructuring).

This patch accomplishes this with an almost-correct desugaring. The only thing missing
is proper debugger support (the let declarations added by the desugaring, while invisible
to code due to shadowing, are visible to the debugger).

BUG=v8:4210
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#29396}
src/parser.cc
test/mjsunit/es6/debug-blockscopes.js
test/mjsunit/es6/debug-stepnext-for.js
test/mjsunit/es6/regress/regress-2506.js
test/mjsunit/harmony/destructuring.js
test/mjsunit/strong/declaration-after-use.js
test/test262-es6/test262-es6.status