Index: test/mjsunit/harmony/destructuring.js |
diff --git a/test/mjsunit/harmony/destructuring.js b/test/mjsunit/harmony/destructuring.js |
index 50f27857ec04ce302dacb2ab63139ac27167f61c..8a03143e0401367f96de87a887d288eeb4698c84 100644 |
--- a/test/mjsunit/harmony/destructuring.js |
+++ b/test/mjsunit/harmony/destructuring.js |
@@ -503,6 +503,28 @@ |
}()); |
+(function TestRestCustomIterable() { |
+ var idx = 0; |
+ var iterable = {}; |
+ var iterator = { |
+ next: function() { |
+ idx += 1; |
+ return { |
+ value: idx, |
+ done: idx === 4 |
+ }; |
+ } |
+ }; |
+ iterable[Symbol.iterator] = function() { |
+ return iterator; |
+ }; |
+ |
+ var [...result] = iterable; |
+ |
+ assertEquals([1, 2, 3], result); |
+}()); |
+ |
+ |
(function TestIteratorsLexical() { |
'use strict'; |
var log = []; |