Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Unified Diff: test/mjsunit/harmony/destructuring.js

Issue 1218543003: [es6] Ensure that for-in/of loops have a proper TDZ for their boundnames (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/es6/regress/regress-2506.js ('k') | test/mjsunit/strong/declaration-after-use.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/destructuring.js
diff --git a/test/mjsunit/harmony/destructuring.js b/test/mjsunit/harmony/destructuring.js
index c57dbafda6dbbd90862b11bd6af10e986e7bc2eb..198d4c025702c6de674bc66edfb8b5b8e82c848c 100644
--- a/test/mjsunit/harmony/destructuring.js
+++ b/test/mjsunit/harmony/destructuring.js
@@ -728,3 +728,11 @@
assertThrows("function f({x}) { var x; }; f({});", SyntaxError);
assertThrows("'use strict'; function f({x}) { let x = 0; }; f({});", SyntaxError);
}());
+
+
+(function TestForInOfTDZ() {
+ assertThrows("'use strict'; let x = {}; for (let [x, y] of {x});", ReferenceError);
+ assertThrows("'use strict'; let x = {}; for (let [y, x] of {x});", ReferenceError);
+ assertThrows("'use strict'; let x = {}; for (let [x, y] in {x});", ReferenceError);
+ assertThrows("'use strict'; let x = {}; for (let [y, x] in {x});", ReferenceError);
+}());
« no previous file with comments | « test/mjsunit/es6/regress/regress-2506.js ('k') | test/mjsunit/strong/declaration-after-use.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698