first
This commit is contained in:
24
node_modules/core-js/internals/iterator-close.js
generated
vendored
Normal file
24
node_modules/core-js/internals/iterator-close.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
var call = require('../internals/function-call');
|
||||
var anObject = require('../internals/an-object');
|
||||
var getMethod = require('../internals/get-method');
|
||||
|
||||
module.exports = function (iterator, kind, value) {
|
||||
var innerResult, innerError;
|
||||
anObject(iterator);
|
||||
try {
|
||||
innerResult = getMethod(iterator, 'return');
|
||||
if (!innerResult) {
|
||||
if (kind === 'throw') throw value;
|
||||
return value;
|
||||
}
|
||||
innerResult = call(innerResult, iterator);
|
||||
} catch (error) {
|
||||
innerError = true;
|
||||
innerResult = error;
|
||||
}
|
||||
if (kind === 'throw') throw value;
|
||||
if (innerError) throw innerResult;
|
||||
anObject(innerResult);
|
||||
return value;
|
||||
};
|
Reference in New Issue
Block a user