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

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

Issue 1704533002: Support rest element pattern with user-defined iterable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/harmony/destructuring.js ('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-assignment.js
diff --git a/test/mjsunit/harmony/destructuring-assignment.js b/test/mjsunit/harmony/destructuring-assignment.js
index bc8c424d8b48f4085e2e9c88a9ef03a837221d1f..1aff4ee2c0ec439b8c587b2a391b8b72b5963c75 100644
--- a/test/mjsunit/harmony/destructuring-assignment.js
+++ b/test/mjsunit/harmony/destructuring-assignment.js
@@ -405,6 +405,28 @@ assertEquals(oz, [1, 2, 3, 4, 5]);
assertEquals([undefined, undefined, undefined], z);
assertEquals(9, count);
})();
+
+ (function cstm() {
+ var idx = 0;
+ var iterable = {};
+ var iterator = {
+ next: function() {
+ idx += 1;
+ return {
+ value: idx,
+ done: idx > 3
+ };
+ }
+ };
+ iterable[Symbol.iterator] = function() {
+ return iterator;
+ };
+ var result;
+
+ [...result] = iterable;
+
+ assertEquals([1, 2, 3], result);
+ })();
})();
(function testRequireObjectCoercible() {
« no previous file with comments | « test/mjsunit/harmony/destructuring.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698