main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
581 bytes
|
Rev | Line | |
---|
[d24f17c] | 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.