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

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

Issue 1385913003: Fix legacy const for-of/in destructuring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rephrasing suggested by Adam Created 5 years, 2 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
« src/pattern-rewriter.cc ('K') | « src/pattern-rewriter.cc ('k') | no next file » | 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 8287220965b3ba78f6b46b0aa4dc0136d8559c57..904058618ad23cb5520bba639a8fb14615b2c5ca 100644
--- a/test/mjsunit/harmony/destructuring.js
+++ b/test/mjsunit/harmony/destructuring.js
@@ -1097,3 +1097,9 @@
assertThrows(
function(){ eval("(class{foo(a, {}) {'use strict';}});") }, SyntaxError);
})();
+
+(function TestLegacyConstDestructuringInForLoop() {
+ var result;
+ for (const {foo} of [{foo: 1}]) { result = foo; }
+ assertEquals(1, result);
+})();
« src/pattern-rewriter.cc ('K') | « src/pattern-rewriter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698