projects
/
dotfiles
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
massive update, probably broken
[dotfiles/.git]
/
.config
/
coc
/
extensions
/
node_modules
/
coc-prettier
/
node_modules
/
core-js
/
internals
/
async-iterator-iteration.js
diff --git
a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/internals/async-iterator-iteration.js
b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/internals/async-iterator-iteration.js
index 5201b9c7f0c92a6aac4c3729d1b8938fc5663ea8..6deb863bac951a41125099c490cfb88151797f10 100644
(file)
--- a/
.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/internals/async-iterator-iteration.js
+++ b/
.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/internals/async-iterator-iteration.js
@@
-1,29
+1,35
@@
'use strict';
// https://github.com/tc39/proposal-iterator-helpers
'use strict';
// https://github.com/tc39/proposal-iterator-helpers
-var aFunction = require('../internals/a-function');
+// https://github.com/tc39/proposal-array-from-async
+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 anObject = require('../internals/an-object');
var getBuiltIn = require('../internals/get-built-in');
+var getMethod = require('../internals/get-method');
-var
Promise = getBuiltIn('Promise')
;
-var
push = [].push
;
+var
MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF
;
+var
TypeError = global.TypeError
;
var createMethod = function (TYPE) {
var IS_TO_ARRAY = TYPE == 0;
var IS_FOR_EACH = TYPE == 1;
var IS_EVERY = TYPE == 2;
var IS_SOME = TYPE == 3;
var createMethod = function (TYPE) {
var IS_TO_ARRAY = TYPE == 0;
var IS_FOR_EACH = TYPE == 1;
var IS_EVERY = TYPE == 2;
var IS_SOME = TYPE == 3;
- return function (iterator, fn) {
+ return function (iterator, fn
, target
) {
anObject(iterator);
anObject(iterator);
- var next = aFunction(iterator.next);
- var array = IS_TO_ARRAY ? [] : undefined;
- if (!IS_TO_ARRAY) aFunction(fn);
+ var Promise = getBuiltIn('Promise');
+ var next = aCallable(iterator.next);
+ var index = 0;
+ var MAPPING = fn !== undefined;
+ if (MAPPING || !IS_TO_ARRAY) aCallable(fn);
return new Promise(function (resolve, reject) {
var closeIteration = function (method, argument) {
try {
return new Promise(function (resolve, reject) {
var closeIteration = function (method, argument) {
try {
- var returnMethod =
iterator['return']
;
- if (returnMethod
!== undefined
) {
- return Promise.resolve(
returnMethod.call(
iterator)).then(function () {
+ var returnMethod =
getMethod(iterator, 'return')
;
+ if (returnMethod) {
+ return Promise.resolve(
call(returnMethod,
iterator)).then(function () {
method(argument);
}, function (error) {
reject(error);
method(argument);
}, function (error) {
reject(error);
@@
-40,25
+46,34
@@
var createMethod = function (TYPE) {
var loop = function () {
try {
var loop = function () {
try {
- Promise.resolve(anObject(next.call(iterator))).then(function (step) {
+ if (IS_TO_ARRAY && (index > MAX_SAFE_INTEGER) && MAPPING) {
+ throw TypeError('The allowed number of iterations has been exceeded');
+ }
+ Promise.resolve(anObject(call(next, iterator))).then(function (step) {
try {
if (anObject(step).done) {
try {
if (anObject(step).done) {
- resolve(IS_TO_ARRAY ? array : IS_SOME ? false : IS_EVERY || undefined);
+ if (IS_TO_ARRAY) {
+ target.length = index;
+ resolve(target);
+ } else resolve(IS_SOME ? false : IS_EVERY || undefined);
} else {
var value = step.value;
} else {
var value = step.value;
- if (IS_TO_ARRAY) {
- push.call(array, value);
- loop();
- } else {
- Promise.resolve(fn(value)).then(function (result) {
+ if (MAPPING) {
+ Promise.resolve(IS_TO_ARRAY ? fn(value, index) : fn(value)).then(function (result) {
if (IS_FOR_EACH) {
loop();
} else if (IS_EVERY) {
result ? loop() : closeIteration(resolve, false);
if (IS_FOR_EACH) {
loop();
} else if (IS_EVERY) {
result ? loop() : closeIteration(resolve, false);
+ } else if (IS_TO_ARRAY) {
+ target[index++] = result;
+ loop();
} else {
result ? closeIteration(resolve, IS_SOME || value) : loop();
}
}, onError);
} else {
result ? closeIteration(resolve, IS_SOME || value) : loop();
}
}, onError);
+ } else {
+ target[index++] = value;
+ loop();
}
}
} catch (error) { onError(error); }
}
}
} catch (error) { onError(error); }