清空
This commit is contained in:
1 parent
7c2ab0b7ad
commit
cff33ad7d1
6370 files changed
+378844
-82245
No files matched your search
+19
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
var call = require('../internals/function-call');
|
||||
var getBuiltIn = require('../internals/get-built-in');
|
||||
var getMethod = require('../internals/get-method');
|
||||
|
||||
module.exports = function (iterator, method, argument, reject) {
|
||||
try {
|
||||
var returnMethod = getMethod(iterator, 'return');
|
||||
if (returnMethod) {
|
||||
return getBuiltIn('Promise').resolve(call(returnMethod, iterator)).then(function () {
|
||||
method(argument);
|
||||
}, function (error) {
|
||||
reject(error);
|
||||
});
|
||||
}
|
||||
} catch (error2) {
|
||||
return reject(error2);
|
||||
} method(argument);
|
||||
};
|
||||
Reference in new issue
Block a user