Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / internals / call-with-safe-iteration-closing.js
1 var anObject = require('../internals/an-object');
2
3 // call something on iterator step with safe closing on error
4 module.exports = function (iterator, fn, value, ENTRIES) {
5   try {
6     return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
7   // 7.4.6 IteratorClose(iterator, completion)
8   } catch (error) {
9     var returnMethod = iterator['return'];
10     if (returnMethod !== undefined) anObject(returnMethod.call(iterator));
11     throw error;
12   }
13 };