Speculatively change iteration protocall to use the same next function
[WebKit-https.git] / Source / JavaScriptCore / builtins / IteratorHelpers.js
index f565d44..1ac9f91 100644 (file)
@@ -33,10 +33,11 @@ function performIteration(iterable)
     let result = [];
 
     let iterator = iterable.@iteratorSymbol();
+    let next = iterator.next;
     let item;
     let index = 0;
     while (true) {
-        item = iterator.next();
+        item = next.@call(iterator);
         if (!@isObject(item))
             @throwTypeError("Iterator result interface is not an object");
         if (item.done)