massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / modules / esnext.async-iterator.reduce.js
index e5f7f9a3b4a8e0528bf5ec724b538116f8078631..a3701f2e9d2403a2d975c64142e2f1c3ef3dbad8 100644 (file)
@@ -1,24 +1,27 @@
 'use strict';
 // https://github.com/tc39/proposal-iterator-helpers
 var $ = require('../internals/export');
-var aFunction = require('../internals/a-function');
+var global = require('../internals/global');
+var call = require('../internals/function-call');
+var aCallable = require('../internals/a-callable');
 var anObject = require('../internals/an-object');
 var getBuiltIn = require('../internals/get-built-in');
 
 var Promise = getBuiltIn('Promise');
+var TypeError = global.TypeError;
 
 $({ target: 'AsyncIterator', proto: true, real: true }, {
   reduce: function reduce(reducer /* , initialValue */) {
     var iterator = anObject(this);
-    var next = aFunction(iterator.next);
+    var next = aCallable(iterator.next);
     var noInitial = arguments.length < 2;
     var accumulator = noInitial ? undefined : arguments[1];
-    aFunction(reducer);
+    aCallable(reducer);
 
     return new Promise(function (resolve, reject) {
       var loop = function () {
         try {
-          Promise.resolve(anObject(next.call(iterator))).then(function (step) {
+          Promise.resolve(anObject(call(next, iterator))).then(function (step) {
             try {
               if (anObject(step).done) {
                 noInitial ? reject(TypeError('Reduce of empty iterator with no initial value')) : resolve(accumulator);