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() { |