main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 2 weeks ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
581 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var call = require('../internals/function-call');
|
---|
3 | var getBuiltIn = require('../internals/get-built-in');
|
---|
4 | var getMethod = require('../internals/get-method');
|
---|
5 |
|
---|
6 | module.exports = function (iterator, method, argument, reject) {
|
---|
7 | try {
|
---|
8 | var returnMethod = getMethod(iterator, 'return');
|
---|
9 | if (returnMethod) {
|
---|
10 | return getBuiltIn('Promise').resolve(call(returnMethod, iterator)).then(function () {
|
---|
11 | method(argument);
|
---|
12 | }, function (error) {
|
---|
13 | reject(error);
|
---|
14 | });
|
---|
15 | }
|
---|
16 | } catch (error2) {
|
---|
17 | return reject(error2);
|
---|
18 | } method(argument);
|
---|
19 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.