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:
393 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var anObject = require('../internals/an-object');
|
---|
3 | var iteratorClose = require('../internals/iterator-close');
|
---|
4 |
|
---|
5 | // call something on iterator step with safe closing on error
|
---|
6 | module.exports = function (iterator, fn, value, ENTRIES) {
|
---|
7 | try {
|
---|
8 | return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
---|
9 | } catch (error) {
|
---|
10 | iteratorClose(iterator, 'throw', error);
|
---|
11 | }
|
---|
12 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.