main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
381 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var call = require('../internals/function-call');
|
---|
3 |
|
---|
4 | module.exports = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) {
|
---|
5 | var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator;
|
---|
6 | var next = record.next;
|
---|
7 | var step, result;
|
---|
8 | while (!(step = call(next, iterator)).done) {
|
---|
9 | result = fn(step.value);
|
---|
10 | if (result !== undefined) return result;
|
---|
11 | }
|
---|
12 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.