@cubejs-client/ws-transport 0.28.38 → 0.29.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -93,6 +93,9 @@
|
|
|
93
93
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
94
94
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
95
95
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
96
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
97
|
+
writable: false
|
|
98
|
+
});
|
|
96
99
|
return Constructor;
|
|
97
100
|
}
|
|
98
101
|
|
|
@@ -147,6 +150,12 @@
|
|
|
147
150
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
148
151
|
});
|
|
149
152
|
|
|
153
|
+
var call$2 = Function.prototype.call;
|
|
154
|
+
|
|
155
|
+
var functionCall = call$2.bind ? call$2.bind(call$2) : function () {
|
|
156
|
+
return call$2.apply(call$2, arguments);
|
|
157
|
+
};
|
|
158
|
+
|
|
150
159
|
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
151
160
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
152
161
|
var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
|
|
@@ -174,27 +183,44 @@
|
|
|
174
183
|
};
|
|
175
184
|
};
|
|
176
185
|
|
|
177
|
-
var
|
|
186
|
+
var FunctionPrototype$2 = Function.prototype;
|
|
187
|
+
var bind$3 = FunctionPrototype$2.bind;
|
|
188
|
+
var call$1 = FunctionPrototype$2.call;
|
|
189
|
+
var callBind = bind$3 && bind$3.bind(call$1);
|
|
190
|
+
|
|
191
|
+
var functionUncurryThis = bind$3 ? function (fn) {
|
|
192
|
+
return fn && callBind(call$1, fn);
|
|
193
|
+
} : function (fn) {
|
|
194
|
+
return fn && function () {
|
|
195
|
+
return call$1.apply(fn, arguments);
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
var toString$1 = functionUncurryThis({}.toString);
|
|
200
|
+
var stringSlice = functionUncurryThis(''.slice);
|
|
178
201
|
|
|
179
202
|
var classofRaw = function (it) {
|
|
180
|
-
return toString
|
|
203
|
+
return stringSlice(toString$1(it), 8, -1);
|
|
181
204
|
};
|
|
182
205
|
|
|
183
|
-
var
|
|
206
|
+
var Object$4 = global$1.Object;
|
|
207
|
+
var split = functionUncurryThis(''.split);
|
|
184
208
|
|
|
185
209
|
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
186
210
|
var indexedObject = fails(function () {
|
|
187
211
|
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
188
212
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
189
|
-
return !Object('z').propertyIsEnumerable(0);
|
|
213
|
+
return !Object$4('z').propertyIsEnumerable(0);
|
|
190
214
|
}) ? function (it) {
|
|
191
|
-
return classofRaw(it) == 'String' ? split
|
|
192
|
-
} : Object;
|
|
215
|
+
return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
|
|
216
|
+
} : Object$4;
|
|
217
|
+
|
|
218
|
+
var TypeError$d = global$1.TypeError;
|
|
193
219
|
|
|
194
220
|
// `RequireObjectCoercible` abstract operation
|
|
195
221
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
196
222
|
var requireObjectCoercible = function (it) {
|
|
197
|
-
if (it == undefined) throw TypeError("Can't call method on " + it);
|
|
223
|
+
if (it == undefined) throw TypeError$d("Can't call method on " + it);
|
|
198
224
|
return it;
|
|
199
225
|
};
|
|
200
226
|
|
|
@@ -206,18 +232,26 @@
|
|
|
206
232
|
return indexedObject(requireObjectCoercible(it));
|
|
207
233
|
};
|
|
208
234
|
|
|
235
|
+
// `IsCallable` abstract operation
|
|
236
|
+
// https://tc39.es/ecma262/#sec-iscallable
|
|
237
|
+
var isCallable = function (argument) {
|
|
238
|
+
return typeof argument == 'function';
|
|
239
|
+
};
|
|
240
|
+
|
|
209
241
|
var isObject = function (it) {
|
|
210
|
-
return typeof it
|
|
242
|
+
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
211
243
|
};
|
|
212
244
|
|
|
213
|
-
var aFunction
|
|
214
|
-
return
|
|
245
|
+
var aFunction = function (argument) {
|
|
246
|
+
return isCallable(argument) ? argument : undefined;
|
|
215
247
|
};
|
|
216
248
|
|
|
217
249
|
var getBuiltIn = function (namespace, method) {
|
|
218
|
-
return arguments.length < 2 ? aFunction
|
|
250
|
+
return arguments.length < 2 ? aFunction(global$1[namespace]) : global$1[namespace] && global$1[namespace][method];
|
|
219
251
|
};
|
|
220
252
|
|
|
253
|
+
var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
|
|
254
|
+
|
|
221
255
|
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
|
|
222
256
|
|
|
223
257
|
var process$3 = global$1.process;
|
|
@@ -228,16 +262,22 @@
|
|
|
228
262
|
|
|
229
263
|
if (v8) {
|
|
230
264
|
match = v8.split('.');
|
|
231
|
-
|
|
232
|
-
|
|
265
|
+
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
266
|
+
// but their correct versions are not interesting for us
|
|
267
|
+
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
271
|
+
// so check `userAgent` even if `.v8` exists, but 0
|
|
272
|
+
if (!version && engineUserAgent) {
|
|
233
273
|
match = engineUserAgent.match(/Edge\/(\d+)/);
|
|
234
274
|
if (!match || match[1] >= 74) {
|
|
235
275
|
match = engineUserAgent.match(/Chrome\/(\d+)/);
|
|
236
|
-
if (match) version = match[1];
|
|
276
|
+
if (match) version = +match[1];
|
|
237
277
|
}
|
|
238
278
|
}
|
|
239
279
|
|
|
240
|
-
var engineV8Version = version
|
|
280
|
+
var engineV8Version = version;
|
|
241
281
|
|
|
242
282
|
/* eslint-disable es/no-symbol -- required for testing */
|
|
243
283
|
|
|
@@ -257,27 +297,58 @@
|
|
|
257
297
|
&& !Symbol.sham
|
|
258
298
|
&& typeof Symbol.iterator == 'symbol';
|
|
259
299
|
|
|
300
|
+
var Object$3 = global$1.Object;
|
|
301
|
+
|
|
260
302
|
var isSymbol = useSymbolAsUid ? function (it) {
|
|
261
303
|
return typeof it == 'symbol';
|
|
262
304
|
} : function (it) {
|
|
263
305
|
var $Symbol = getBuiltIn('Symbol');
|
|
264
|
-
return
|
|
306
|
+
return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
var String$4 = global$1.String;
|
|
310
|
+
|
|
311
|
+
var tryToString = function (argument) {
|
|
312
|
+
try {
|
|
313
|
+
return String$4(argument);
|
|
314
|
+
} catch (error) {
|
|
315
|
+
return 'Object';
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
var TypeError$c = global$1.TypeError;
|
|
320
|
+
|
|
321
|
+
// `Assert: IsCallable(argument) is true`
|
|
322
|
+
var aCallable = function (argument) {
|
|
323
|
+
if (isCallable(argument)) return argument;
|
|
324
|
+
throw TypeError$c(tryToString(argument) + ' is not a function');
|
|
265
325
|
};
|
|
266
326
|
|
|
327
|
+
// `GetMethod` abstract operation
|
|
328
|
+
// https://tc39.es/ecma262/#sec-getmethod
|
|
329
|
+
var getMethod = function (V, P) {
|
|
330
|
+
var func = V[P];
|
|
331
|
+
return func == null ? undefined : aCallable(func);
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
var TypeError$b = global$1.TypeError;
|
|
335
|
+
|
|
267
336
|
// `OrdinaryToPrimitive` abstract operation
|
|
268
337
|
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
269
338
|
var ordinaryToPrimitive = function (input, pref) {
|
|
270
339
|
var fn, val;
|
|
271
|
-
if (pref === 'string' &&
|
|
272
|
-
if (
|
|
273
|
-
if (pref !== 'string' &&
|
|
274
|
-
throw TypeError("Can't convert object to primitive value");
|
|
340
|
+
if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
341
|
+
if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
|
|
342
|
+
if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
343
|
+
throw TypeError$b("Can't convert object to primitive value");
|
|
275
344
|
};
|
|
276
345
|
|
|
346
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
347
|
+
var defineProperty$1 = Object.defineProperty;
|
|
348
|
+
|
|
277
349
|
var setGlobal = function (key, value) {
|
|
278
350
|
try {
|
|
279
|
-
|
|
280
|
-
Object.defineProperty(global$1, key, { value: value, configurable: true, writable: true });
|
|
351
|
+
defineProperty$1(global$1, key, { value: value, configurable: true, writable: true });
|
|
281
352
|
} catch (error) {
|
|
282
353
|
global$1[key] = value;
|
|
283
354
|
} return value;
|
|
@@ -292,58 +363,68 @@
|
|
|
292
363
|
(module.exports = function (key, value) {
|
|
293
364
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
294
365
|
})('versions', []).push({
|
|
295
|
-
version: '3.
|
|
366
|
+
version: '3.19.3',
|
|
296
367
|
mode: 'global',
|
|
297
368
|
copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
|
298
369
|
});
|
|
299
370
|
});
|
|
300
371
|
|
|
372
|
+
var Object$2 = global$1.Object;
|
|
373
|
+
|
|
301
374
|
// `ToObject` abstract operation
|
|
302
375
|
// https://tc39.es/ecma262/#sec-toobject
|
|
303
376
|
var toObject = function (argument) {
|
|
304
|
-
return Object(requireObjectCoercible(argument));
|
|
377
|
+
return Object$2(requireObjectCoercible(argument));
|
|
305
378
|
};
|
|
306
379
|
|
|
307
|
-
var hasOwnProperty = {}.hasOwnProperty;
|
|
380
|
+
var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
|
|
308
381
|
|
|
309
|
-
|
|
310
|
-
|
|
382
|
+
// `HasOwnProperty` abstract operation
|
|
383
|
+
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
384
|
+
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
385
|
+
return hasOwnProperty(toObject(it), key);
|
|
311
386
|
};
|
|
312
387
|
|
|
313
388
|
var id = 0;
|
|
314
389
|
var postfix = Math.random();
|
|
390
|
+
var toString = functionUncurryThis(1.0.toString);
|
|
315
391
|
|
|
316
392
|
var uid = function (key) {
|
|
317
|
-
return 'Symbol(' +
|
|
393
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
|
318
394
|
};
|
|
319
395
|
|
|
320
396
|
var WellKnownSymbolsStore = shared('wks');
|
|
321
397
|
var Symbol$1 = global$1.Symbol;
|
|
398
|
+
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
322
399
|
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
323
400
|
|
|
324
401
|
var wellKnownSymbol = function (name) {
|
|
325
|
-
if (!
|
|
326
|
-
|
|
402
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
403
|
+
var description = 'Symbol.' + name;
|
|
404
|
+
if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
|
|
327
405
|
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
406
|
+
} else if (useSymbolAsUid && symbolFor) {
|
|
407
|
+
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
328
408
|
} else {
|
|
329
|
-
WellKnownSymbolsStore[name] = createWellKnownSymbol(
|
|
409
|
+
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
330
410
|
}
|
|
331
411
|
} return WellKnownSymbolsStore[name];
|
|
332
412
|
};
|
|
333
413
|
|
|
414
|
+
var TypeError$a = global$1.TypeError;
|
|
334
415
|
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
|
335
416
|
|
|
336
417
|
// `ToPrimitive` abstract operation
|
|
337
418
|
// https://tc39.es/ecma262/#sec-toprimitive
|
|
338
419
|
var toPrimitive = function (input, pref) {
|
|
339
420
|
if (!isObject(input) || isSymbol(input)) return input;
|
|
340
|
-
var exoticToPrim = input
|
|
421
|
+
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
341
422
|
var result;
|
|
342
|
-
if (exoticToPrim
|
|
423
|
+
if (exoticToPrim) {
|
|
343
424
|
if (pref === undefined) pref = 'default';
|
|
344
|
-
result = exoticToPrim
|
|
425
|
+
result = functionCall(exoticToPrim, input, pref);
|
|
345
426
|
if (!isObject(result) || isSymbol(result)) return result;
|
|
346
|
-
throw TypeError("Can't convert object to primitive value");
|
|
427
|
+
throw TypeError$a("Can't convert object to primitive value");
|
|
347
428
|
}
|
|
348
429
|
if (pref === undefined) pref = 'number';
|
|
349
430
|
return ordinaryToPrimitive(input, pref);
|
|
@@ -353,15 +434,15 @@
|
|
|
353
434
|
// https://tc39.es/ecma262/#sec-topropertykey
|
|
354
435
|
var toPropertyKey = function (argument) {
|
|
355
436
|
var key = toPrimitive(argument, 'string');
|
|
356
|
-
return isSymbol(key) ? key :
|
|
437
|
+
return isSymbol(key) ? key : key + '';
|
|
357
438
|
};
|
|
358
439
|
|
|
359
440
|
var document$3 = global$1.document;
|
|
360
441
|
// typeof document.createElement is 'object' in old IE
|
|
361
|
-
var EXISTS = isObject(document$3) && isObject(document$3.createElement);
|
|
442
|
+
var EXISTS$1 = isObject(document$3) && isObject(document$3.createElement);
|
|
362
443
|
|
|
363
444
|
var documentCreateElement = function (it) {
|
|
364
|
-
return EXISTS ? document$3.createElement(it) : {};
|
|
445
|
+
return EXISTS$1 ? document$3.createElement(it) : {};
|
|
365
446
|
};
|
|
366
447
|
|
|
367
448
|
// Thank's IE8 for his funny defineProperty
|
|
@@ -383,19 +464,23 @@
|
|
|
383
464
|
if (ie8DomDefine) try {
|
|
384
465
|
return $getOwnPropertyDescriptor(O, P);
|
|
385
466
|
} catch (error) { /* empty */ }
|
|
386
|
-
if (
|
|
467
|
+
if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
|
|
387
468
|
};
|
|
388
469
|
|
|
389
470
|
var objectGetOwnPropertyDescriptor = {
|
|
390
471
|
f: f$4
|
|
391
472
|
};
|
|
392
473
|
|
|
393
|
-
var
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
474
|
+
var String$3 = global$1.String;
|
|
475
|
+
var TypeError$9 = global$1.TypeError;
|
|
476
|
+
|
|
477
|
+
// `Assert: Type(argument) is Object`
|
|
478
|
+
var anObject = function (argument) {
|
|
479
|
+
if (isObject(argument)) return argument;
|
|
480
|
+
throw TypeError$9(String$3(argument) + ' is not an object');
|
|
397
481
|
};
|
|
398
482
|
|
|
483
|
+
var TypeError$8 = global$1.TypeError;
|
|
399
484
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
400
485
|
var $defineProperty = Object.defineProperty;
|
|
401
486
|
|
|
@@ -408,7 +493,7 @@
|
|
|
408
493
|
if (ie8DomDefine) try {
|
|
409
494
|
return $defineProperty(O, P, Attributes);
|
|
410
495
|
} catch (error) { /* empty */ }
|
|
411
|
-
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
|
496
|
+
if ('get' in Attributes || 'set' in Attributes) throw TypeError$8('Accessors not supported');
|
|
412
497
|
if ('value' in Attributes) O[P] = Attributes.value;
|
|
413
498
|
return O;
|
|
414
499
|
};
|
|
@@ -424,12 +509,12 @@
|
|
|
424
509
|
return object;
|
|
425
510
|
};
|
|
426
511
|
|
|
427
|
-
var functionToString = Function.toString;
|
|
512
|
+
var functionToString = functionUncurryThis(Function.toString);
|
|
428
513
|
|
|
429
514
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
430
|
-
if (
|
|
515
|
+
if (!isCallable(sharedStore.inspectSource)) {
|
|
431
516
|
sharedStore.inspectSource = function (it) {
|
|
432
|
-
return functionToString
|
|
517
|
+
return functionToString(it);
|
|
433
518
|
};
|
|
434
519
|
}
|
|
435
520
|
|
|
@@ -437,7 +522,7 @@
|
|
|
437
522
|
|
|
438
523
|
var WeakMap$1 = global$1.WeakMap;
|
|
439
524
|
|
|
440
|
-
var nativeWeakMap =
|
|
525
|
+
var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
|
|
441
526
|
|
|
442
527
|
var keys = shared('keys');
|
|
443
528
|
|
|
@@ -448,6 +533,7 @@
|
|
|
448
533
|
var hiddenKeys$1 = {};
|
|
449
534
|
|
|
450
535
|
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
536
|
+
var TypeError$7 = global$1.TypeError;
|
|
451
537
|
var WeakMap = global$1.WeakMap;
|
|
452
538
|
var set$1, get, has;
|
|
453
539
|
|
|
@@ -459,42 +545,42 @@
|
|
|
459
545
|
return function (it) {
|
|
460
546
|
var state;
|
|
461
547
|
if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
|
462
|
-
throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
|
548
|
+
throw TypeError$7('Incompatible receiver, ' + TYPE + ' required');
|
|
463
549
|
} return state;
|
|
464
550
|
};
|
|
465
551
|
};
|
|
466
552
|
|
|
467
553
|
if (nativeWeakMap || sharedStore.state) {
|
|
468
554
|
var store = sharedStore.state || (sharedStore.state = new WeakMap());
|
|
469
|
-
var wmget = store.get;
|
|
470
|
-
var wmhas = store.has;
|
|
471
|
-
var wmset = store.set;
|
|
555
|
+
var wmget = functionUncurryThis(store.get);
|
|
556
|
+
var wmhas = functionUncurryThis(store.has);
|
|
557
|
+
var wmset = functionUncurryThis(store.set);
|
|
472
558
|
set$1 = function (it, metadata) {
|
|
473
|
-
if (wmhas
|
|
559
|
+
if (wmhas(store, it)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
|
|
474
560
|
metadata.facade = it;
|
|
475
|
-
wmset
|
|
561
|
+
wmset(store, it, metadata);
|
|
476
562
|
return metadata;
|
|
477
563
|
};
|
|
478
564
|
get = function (it) {
|
|
479
|
-
return wmget
|
|
565
|
+
return wmget(store, it) || {};
|
|
480
566
|
};
|
|
481
567
|
has = function (it) {
|
|
482
|
-
return wmhas
|
|
568
|
+
return wmhas(store, it);
|
|
483
569
|
};
|
|
484
570
|
} else {
|
|
485
571
|
var STATE = sharedKey('state');
|
|
486
572
|
hiddenKeys$1[STATE] = true;
|
|
487
573
|
set$1 = function (it, metadata) {
|
|
488
|
-
if (
|
|
574
|
+
if (hasOwnProperty_1(it, STATE)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
|
|
489
575
|
metadata.facade = it;
|
|
490
576
|
createNonEnumerableProperty(it, STATE, metadata);
|
|
491
577
|
return metadata;
|
|
492
578
|
};
|
|
493
579
|
get = function (it) {
|
|
494
|
-
return
|
|
580
|
+
return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
|
|
495
581
|
};
|
|
496
582
|
has = function (it) {
|
|
497
|
-
return
|
|
583
|
+
return hasOwnProperty_1(it, STATE);
|
|
498
584
|
};
|
|
499
585
|
}
|
|
500
586
|
|
|
@@ -506,7 +592,24 @@
|
|
|
506
592
|
getterFor: getterFor
|
|
507
593
|
};
|
|
508
594
|
|
|
595
|
+
var FunctionPrototype$1 = Function.prototype;
|
|
596
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
597
|
+
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
|
|
598
|
+
|
|
599
|
+
var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name');
|
|
600
|
+
// additional protection from minified / mangled / dropped function names
|
|
601
|
+
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
602
|
+
var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
|
|
603
|
+
|
|
604
|
+
var functionName = {
|
|
605
|
+
EXISTS: EXISTS,
|
|
606
|
+
PROPER: PROPER,
|
|
607
|
+
CONFIGURABLE: CONFIGURABLE
|
|
608
|
+
};
|
|
609
|
+
|
|
509
610
|
var redefine = createCommonjsModule(function (module) {
|
|
611
|
+
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
612
|
+
|
|
510
613
|
var getInternalState = internalState.get;
|
|
511
614
|
var enforceInternalState = internalState.enforce;
|
|
512
615
|
var TEMPLATE = String(String).split('String');
|
|
@@ -515,14 +618,18 @@
|
|
|
515
618
|
var unsafe = options ? !!options.unsafe : false;
|
|
516
619
|
var simple = options ? !!options.enumerable : false;
|
|
517
620
|
var noTargetGet = options ? !!options.noTargetGet : false;
|
|
621
|
+
var name = options && options.name !== undefined ? options.name : key;
|
|
518
622
|
var state;
|
|
519
|
-
if (
|
|
520
|
-
if (
|
|
521
|
-
|
|
623
|
+
if (isCallable(value)) {
|
|
624
|
+
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
625
|
+
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
626
|
+
}
|
|
627
|
+
if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
628
|
+
createNonEnumerableProperty(value, 'name', name);
|
|
522
629
|
}
|
|
523
630
|
state = enforceInternalState(value);
|
|
524
631
|
if (!state.source) {
|
|
525
|
-
state.source = TEMPLATE.join(typeof
|
|
632
|
+
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
526
633
|
}
|
|
527
634
|
}
|
|
528
635
|
if (O === global$1) {
|
|
@@ -538,43 +645,51 @@
|
|
|
538
645
|
else createNonEnumerableProperty(O, key, value);
|
|
539
646
|
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
540
647
|
})(Function.prototype, 'toString', function toString() {
|
|
541
|
-
return
|
|
648
|
+
return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
|
542
649
|
});
|
|
543
650
|
});
|
|
544
651
|
|
|
545
652
|
var ceil = Math.ceil;
|
|
546
653
|
var floor = Math.floor;
|
|
547
654
|
|
|
548
|
-
// `
|
|
549
|
-
// https://tc39.es/ecma262/#sec-
|
|
550
|
-
var
|
|
551
|
-
|
|
655
|
+
// `ToIntegerOrInfinity` abstract operation
|
|
656
|
+
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
657
|
+
var toIntegerOrInfinity = function (argument) {
|
|
658
|
+
var number = +argument;
|
|
659
|
+
// eslint-disable-next-line no-self-compare -- safe
|
|
660
|
+
return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
|
|
552
661
|
};
|
|
553
662
|
|
|
663
|
+
var max = Math.max;
|
|
554
664
|
var min$1 = Math.min;
|
|
555
665
|
|
|
666
|
+
// Helper for a popular repeating case of the spec:
|
|
667
|
+
// Let integer be ? ToInteger(index).
|
|
668
|
+
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
669
|
+
var toAbsoluteIndex = function (index, length) {
|
|
670
|
+
var integer = toIntegerOrInfinity(index);
|
|
671
|
+
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
var min = Math.min;
|
|
675
|
+
|
|
556
676
|
// `ToLength` abstract operation
|
|
557
677
|
// https://tc39.es/ecma262/#sec-tolength
|
|
558
678
|
var toLength = function (argument) {
|
|
559
|
-
return argument > 0 ? min
|
|
679
|
+
return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
560
680
|
};
|
|
561
681
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
// Let integer be ? ToInteger(index).
|
|
567
|
-
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
568
|
-
var toAbsoluteIndex = function (index, length) {
|
|
569
|
-
var integer = toInteger(index);
|
|
570
|
-
return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
|
682
|
+
// `LengthOfArrayLike` abstract operation
|
|
683
|
+
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
684
|
+
var lengthOfArrayLike = function (obj) {
|
|
685
|
+
return toLength(obj.length);
|
|
571
686
|
};
|
|
572
687
|
|
|
573
688
|
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
574
689
|
var createMethod$1 = function (IS_INCLUDES) {
|
|
575
690
|
return function ($this, el, fromIndex) {
|
|
576
691
|
var O = toIndexedObject($this);
|
|
577
|
-
var length =
|
|
692
|
+
var length = lengthOfArrayLike(O);
|
|
578
693
|
var index = toAbsoluteIndex(fromIndex, length);
|
|
579
694
|
var value;
|
|
580
695
|
// Array#includes uses SameValueZero equality algorithm
|
|
@@ -602,15 +717,17 @@
|
|
|
602
717
|
var indexOf = arrayIncludes.indexOf;
|
|
603
718
|
|
|
604
719
|
|
|
720
|
+
var push$1 = functionUncurryThis([].push);
|
|
721
|
+
|
|
605
722
|
var objectKeysInternal = function (object, names) {
|
|
606
723
|
var O = toIndexedObject(object);
|
|
607
724
|
var i = 0;
|
|
608
725
|
var result = [];
|
|
609
726
|
var key;
|
|
610
|
-
for (key in O) !
|
|
727
|
+
for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$1(result, key);
|
|
611
728
|
// Don't enum bug & hidden keys
|
|
612
|
-
while (names.length > i) if (
|
|
613
|
-
~indexOf(result, key) ||
|
|
729
|
+
while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
|
|
730
|
+
~indexOf(result, key) || push$1(result, key);
|
|
614
731
|
}
|
|
615
732
|
return result;
|
|
616
733
|
};
|
|
@@ -646,11 +763,13 @@
|
|
|
646
763
|
f: f$1
|
|
647
764
|
};
|
|
648
765
|
|
|
766
|
+
var concat = functionUncurryThis([].concat);
|
|
767
|
+
|
|
649
768
|
// all object keys, includes non-enumerable and symbols
|
|
650
769
|
var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
651
770
|
var keys = objectGetOwnPropertyNames.f(anObject(it));
|
|
652
771
|
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
|
653
|
-
return getOwnPropertySymbols ?
|
|
772
|
+
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
|
654
773
|
};
|
|
655
774
|
|
|
656
775
|
var copyConstructorProperties = function (target, source) {
|
|
@@ -659,7 +778,7 @@
|
|
|
659
778
|
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
660
779
|
for (var i = 0; i < keys.length; i++) {
|
|
661
780
|
var key = keys[i];
|
|
662
|
-
if (!
|
|
781
|
+
if (!hasOwnProperty_1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
663
782
|
}
|
|
664
783
|
};
|
|
665
784
|
|
|
@@ -669,7 +788,7 @@
|
|
|
669
788
|
var value = data[normalize(feature)];
|
|
670
789
|
return value == POLYFILL ? true
|
|
671
790
|
: value == NATIVE ? false
|
|
672
|
-
:
|
|
791
|
+
: isCallable(detection) ? fails(detection)
|
|
673
792
|
: !!detection;
|
|
674
793
|
};
|
|
675
794
|
|
|
@@ -703,6 +822,7 @@
|
|
|
703
822
|
options.sham - add a flag to not completely full polyfills
|
|
704
823
|
options.enumerable - export as enumerable property
|
|
705
824
|
options.noTargetGet - prevent calling a getter on target
|
|
825
|
+
options.name - the .name of the function if it does not match the key
|
|
706
826
|
*/
|
|
707
827
|
var _export = function (options, source) {
|
|
708
828
|
var TARGET = options.target;
|
|
@@ -725,7 +845,7 @@
|
|
|
725
845
|
FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
726
846
|
// contained in target
|
|
727
847
|
if (!FORCED && targetProperty !== undefined) {
|
|
728
|
-
if (typeof sourceProperty
|
|
848
|
+
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
729
849
|
copyConstructorProperties(sourceProperty, targetProperty);
|
|
730
850
|
}
|
|
731
851
|
// add a flag to not completely full polyfills
|
|
@@ -737,31 +857,12 @@
|
|
|
737
857
|
}
|
|
738
858
|
};
|
|
739
859
|
|
|
740
|
-
var
|
|
741
|
-
if (typeof it != 'function') {
|
|
742
|
-
throw TypeError(String(it) + ' is not a function');
|
|
743
|
-
} return it;
|
|
744
|
-
};
|
|
860
|
+
var bind$2 = functionUncurryThis(functionUncurryThis.bind);
|
|
745
861
|
|
|
746
862
|
// optional / simple context binding
|
|
747
|
-
var functionBindContext = function (fn, that
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
switch (length) {
|
|
751
|
-
case 0: return function () {
|
|
752
|
-
return fn.call(that);
|
|
753
|
-
};
|
|
754
|
-
case 1: return function (a) {
|
|
755
|
-
return fn.call(that, a);
|
|
756
|
-
};
|
|
757
|
-
case 2: return function (a, b) {
|
|
758
|
-
return fn.call(that, a, b);
|
|
759
|
-
};
|
|
760
|
-
case 3: return function (a, b, c) {
|
|
761
|
-
return fn.call(that, a, b, c);
|
|
762
|
-
};
|
|
763
|
-
}
|
|
764
|
-
return function (/* ...args */) {
|
|
863
|
+
var functionBindContext = function (fn, that) {
|
|
864
|
+
aCallable(fn);
|
|
865
|
+
return that === undefined ? fn : bind$2 ? bind$2(fn, that) : function (/* ...args */) {
|
|
765
866
|
return fn.apply(that, arguments);
|
|
766
867
|
};
|
|
767
868
|
};
|
|
@@ -769,11 +870,81 @@
|
|
|
769
870
|
// `IsArray` abstract operation
|
|
770
871
|
// https://tc39.es/ecma262/#sec-isarray
|
|
771
872
|
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
772
|
-
var isArray = Array.isArray || function isArray(
|
|
773
|
-
return classofRaw(
|
|
873
|
+
var isArray = Array.isArray || function isArray(argument) {
|
|
874
|
+
return classofRaw(argument) == 'Array';
|
|
875
|
+
};
|
|
876
|
+
|
|
877
|
+
var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
878
|
+
var test = {};
|
|
879
|
+
|
|
880
|
+
test[TO_STRING_TAG$2] = 'z';
|
|
881
|
+
|
|
882
|
+
var toStringTagSupport = String(test) === '[object z]';
|
|
883
|
+
|
|
884
|
+
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
|
885
|
+
var Object$1 = global$1.Object;
|
|
886
|
+
|
|
887
|
+
// ES3 wrong here
|
|
888
|
+
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
889
|
+
|
|
890
|
+
// fallback for IE11 Script Access Denied error
|
|
891
|
+
var tryGet = function (it, key) {
|
|
892
|
+
try {
|
|
893
|
+
return it[key];
|
|
894
|
+
} catch (error) { /* empty */ }
|
|
895
|
+
};
|
|
896
|
+
|
|
897
|
+
// getting tag from ES6+ `Object.prototype.toString`
|
|
898
|
+
var classof = toStringTagSupport ? classofRaw : function (it) {
|
|
899
|
+
var O, tag, result;
|
|
900
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
901
|
+
// @@toStringTag case
|
|
902
|
+
: typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag
|
|
903
|
+
// builtinTag case
|
|
904
|
+
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
905
|
+
// ES3 arguments fallback
|
|
906
|
+
: (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
907
|
+
};
|
|
908
|
+
|
|
909
|
+
var noop = function () { /* empty */ };
|
|
910
|
+
var empty = [];
|
|
911
|
+
var construct = getBuiltIn('Reflect', 'construct');
|
|
912
|
+
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
913
|
+
var exec = functionUncurryThis(constructorRegExp.exec);
|
|
914
|
+
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
|
915
|
+
|
|
916
|
+
var isConstructorModern = function (argument) {
|
|
917
|
+
if (!isCallable(argument)) return false;
|
|
918
|
+
try {
|
|
919
|
+
construct(noop, empty, argument);
|
|
920
|
+
return true;
|
|
921
|
+
} catch (error) {
|
|
922
|
+
return false;
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
|
|
926
|
+
var isConstructorLegacy = function (argument) {
|
|
927
|
+
if (!isCallable(argument)) return false;
|
|
928
|
+
switch (classof(argument)) {
|
|
929
|
+
case 'AsyncFunction':
|
|
930
|
+
case 'GeneratorFunction':
|
|
931
|
+
case 'AsyncGeneratorFunction': return false;
|
|
932
|
+
// we can't check .prototype since constructors produced by .bind haven't it
|
|
933
|
+
} return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
|
|
774
934
|
};
|
|
775
935
|
|
|
936
|
+
// `IsConstructor` abstract operation
|
|
937
|
+
// https://tc39.es/ecma262/#sec-isconstructor
|
|
938
|
+
var isConstructor = !construct || fails(function () {
|
|
939
|
+
var called;
|
|
940
|
+
return isConstructorModern(isConstructorModern.call)
|
|
941
|
+
|| !isConstructorModern(Object)
|
|
942
|
+
|| !isConstructorModern(function () { called = true; })
|
|
943
|
+
|| called;
|
|
944
|
+
}) ? isConstructorLegacy : isConstructorModern;
|
|
945
|
+
|
|
776
946
|
var SPECIES$4 = wellKnownSymbol('species');
|
|
947
|
+
var Array$1 = global$1.Array;
|
|
777
948
|
|
|
778
949
|
// a part of `ArraySpeciesCreate` abstract operation
|
|
779
950
|
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
@@ -782,12 +953,12 @@
|
|
|
782
953
|
if (isArray(originalArray)) {
|
|
783
954
|
C = originalArray.constructor;
|
|
784
955
|
// cross-realm fallback
|
|
785
|
-
if (
|
|
956
|
+
if (isConstructor(C) && (C === Array$1 || isArray(C.prototype))) C = undefined;
|
|
786
957
|
else if (isObject(C)) {
|
|
787
958
|
C = C[SPECIES$4];
|
|
788
959
|
if (C === null) C = undefined;
|
|
789
960
|
}
|
|
790
|
-
} return C === undefined ? Array : C;
|
|
961
|
+
} return C === undefined ? Array$1 : C;
|
|
791
962
|
};
|
|
792
963
|
|
|
793
964
|
// `ArraySpeciesCreate` abstract operation
|
|
@@ -796,7 +967,7 @@
|
|
|
796
967
|
return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
|
797
968
|
};
|
|
798
969
|
|
|
799
|
-
var push = [].push;
|
|
970
|
+
var push = functionUncurryThis([].push);
|
|
800
971
|
|
|
801
972
|
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
|
|
802
973
|
var createMethod = function (TYPE) {
|
|
@@ -810,8 +981,8 @@
|
|
|
810
981
|
return function ($this, callbackfn, that, specificCreate) {
|
|
811
982
|
var O = toObject($this);
|
|
812
983
|
var self = indexedObject(O);
|
|
813
|
-
var boundFunction = functionBindContext(callbackfn, that
|
|
814
|
-
var length =
|
|
984
|
+
var boundFunction = functionBindContext(callbackfn, that);
|
|
985
|
+
var length = lengthOfArrayLike(self);
|
|
815
986
|
var index = 0;
|
|
816
987
|
var create = specificCreate || arraySpeciesCreate;
|
|
817
988
|
var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
|
|
@@ -825,10 +996,10 @@
|
|
|
825
996
|
case 3: return true; // some
|
|
826
997
|
case 5: return value; // find
|
|
827
998
|
case 6: return index; // findIndex
|
|
828
|
-
case 2: push
|
|
999
|
+
case 2: push(target, value); // filter
|
|
829
1000
|
} else switch (TYPE) {
|
|
830
1001
|
case 4: return false; // every
|
|
831
|
-
case 7: push
|
|
1002
|
+
case 7: push(target, value); // filterReject
|
|
832
1003
|
}
|
|
833
1004
|
}
|
|
834
1005
|
}
|
|
@@ -890,6 +1061,18 @@
|
|
|
890
1061
|
forEach: arrayForEach
|
|
891
1062
|
});
|
|
892
1063
|
|
|
1064
|
+
// `Object.prototype.toString` method implementation
|
|
1065
|
+
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
1066
|
+
var objectToString = toStringTagSupport ? {}.toString : function toString() {
|
|
1067
|
+
return '[object ' + classof(this) + ']';
|
|
1068
|
+
};
|
|
1069
|
+
|
|
1070
|
+
// `Object.prototype.toString` method
|
|
1071
|
+
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
1072
|
+
if (!toStringTagSupport) {
|
|
1073
|
+
redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
|
|
1074
|
+
}
|
|
1075
|
+
|
|
893
1076
|
// iterable DOM collections
|
|
894
1077
|
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
|
895
1078
|
var domIterables = {
|
|
@@ -926,30 +1109,44 @@
|
|
|
926
1109
|
TouchList: 0
|
|
927
1110
|
};
|
|
928
1111
|
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
1112
|
+
// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
|
|
1113
|
+
|
|
1114
|
+
|
|
1115
|
+
var classList = documentCreateElement('span').classList;
|
|
1116
|
+
var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
|
|
1117
|
+
|
|
1118
|
+
var domTokenListPrototype = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
|
|
1119
|
+
|
|
1120
|
+
var handlePrototype = function (CollectionPrototype) {
|
|
932
1121
|
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
933
1122
|
if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
|
|
934
1123
|
createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
|
|
935
1124
|
} catch (error) {
|
|
936
1125
|
CollectionPrototype.forEach = arrayForEach;
|
|
937
1126
|
}
|
|
1127
|
+
};
|
|
1128
|
+
|
|
1129
|
+
for (var COLLECTION_NAME in domIterables) {
|
|
1130
|
+
if (domIterables[COLLECTION_NAME]) {
|
|
1131
|
+
handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype);
|
|
1132
|
+
}
|
|
938
1133
|
}
|
|
939
1134
|
|
|
1135
|
+
handlePrototype(domTokenListPrototype);
|
|
1136
|
+
|
|
940
1137
|
var DatePrototype = Date.prototype;
|
|
941
1138
|
var INVALID_DATE = 'Invalid Date';
|
|
942
1139
|
var TO_STRING = 'toString';
|
|
943
|
-
var
|
|
944
|
-
var getTime = DatePrototype.getTime;
|
|
1140
|
+
var un$DateToString = functionUncurryThis(DatePrototype[TO_STRING]);
|
|
1141
|
+
var getTime = functionUncurryThis(DatePrototype.getTime);
|
|
945
1142
|
|
|
946
1143
|
// `Date.prototype.toString` method
|
|
947
1144
|
// https://tc39.es/ecma262/#sec-date.prototype.tostring
|
|
948
1145
|
if (String(new Date(NaN)) != INVALID_DATE) {
|
|
949
1146
|
redefine(DatePrototype, TO_STRING, function toString() {
|
|
950
|
-
var value = getTime
|
|
1147
|
+
var value = getTime(this);
|
|
951
1148
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
952
|
-
return value === value ?
|
|
1149
|
+
return value === value ? un$DateToString(this) : INVALID_DATE;
|
|
953
1150
|
});
|
|
954
1151
|
}
|
|
955
1152
|
|
|
@@ -970,48 +1167,6 @@
|
|
|
970
1167
|
}
|
|
971
1168
|
});
|
|
972
1169
|
|
|
973
|
-
var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
974
|
-
var test = {};
|
|
975
|
-
|
|
976
|
-
test[TO_STRING_TAG$2] = 'z';
|
|
977
|
-
|
|
978
|
-
var toStringTagSupport = String(test) === '[object z]';
|
|
979
|
-
|
|
980
|
-
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
|
981
|
-
// ES3 wrong here
|
|
982
|
-
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
983
|
-
|
|
984
|
-
// fallback for IE11 Script Access Denied error
|
|
985
|
-
var tryGet = function (it, key) {
|
|
986
|
-
try {
|
|
987
|
-
return it[key];
|
|
988
|
-
} catch (error) { /* empty */ }
|
|
989
|
-
};
|
|
990
|
-
|
|
991
|
-
// getting tag from ES6+ `Object.prototype.toString`
|
|
992
|
-
var classof = toStringTagSupport ? classofRaw : function (it) {
|
|
993
|
-
var O, tag, result;
|
|
994
|
-
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
995
|
-
// @@toStringTag case
|
|
996
|
-
: typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
|
|
997
|
-
// builtinTag case
|
|
998
|
-
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
999
|
-
// ES3 arguments fallback
|
|
1000
|
-
: (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
|
|
1001
|
-
};
|
|
1002
|
-
|
|
1003
|
-
// `Object.prototype.toString` method implementation
|
|
1004
|
-
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
1005
|
-
var objectToString = toStringTagSupport ? {}.toString : function toString() {
|
|
1006
|
-
return '[object ' + classof(this) + ']';
|
|
1007
|
-
};
|
|
1008
|
-
|
|
1009
|
-
// `Object.prototype.toString` method
|
|
1010
|
-
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
1011
|
-
if (!toStringTagSupport) {
|
|
1012
|
-
redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
1170
|
var nativePromiseConstructor = global$1.Promise;
|
|
1016
1171
|
|
|
1017
1172
|
var redefineAll = function (target, src, options) {
|
|
@@ -1019,10 +1174,12 @@
|
|
|
1019
1174
|
return target;
|
|
1020
1175
|
};
|
|
1021
1176
|
|
|
1022
|
-
var
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1177
|
+
var String$2 = global$1.String;
|
|
1178
|
+
var TypeError$6 = global$1.TypeError;
|
|
1179
|
+
|
|
1180
|
+
var aPossiblePrototype = function (argument) {
|
|
1181
|
+
if (typeof argument == 'object' || isCallable(argument)) return argument;
|
|
1182
|
+
throw TypeError$6("Can't set " + String$2(argument) + ' as a prototype');
|
|
1026
1183
|
};
|
|
1027
1184
|
|
|
1028
1185
|
/* eslint-disable no-proto -- safe */
|
|
@@ -1037,14 +1194,14 @@
|
|
|
1037
1194
|
var setter;
|
|
1038
1195
|
try {
|
|
1039
1196
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1040
|
-
setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
|
|
1041
|
-
setter
|
|
1197
|
+
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
1198
|
+
setter(test, []);
|
|
1042
1199
|
CORRECT_SETTER = test instanceof Array;
|
|
1043
1200
|
} catch (error) { /* empty */ }
|
|
1044
1201
|
return function setPrototypeOf(O, proto) {
|
|
1045
1202
|
anObject(O);
|
|
1046
1203
|
aPossiblePrototype(proto);
|
|
1047
|
-
if (CORRECT_SETTER) setter
|
|
1204
|
+
if (CORRECT_SETTER) setter(O, proto);
|
|
1048
1205
|
else O.__proto__ = proto;
|
|
1049
1206
|
return O;
|
|
1050
1207
|
};
|
|
@@ -1057,7 +1214,7 @@
|
|
|
1057
1214
|
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
1058
1215
|
|
|
1059
1216
|
var setToStringTag = function (it, TAG, STATIC) {
|
|
1060
|
-
if (it && !
|
|
1217
|
+
if (it && !hasOwnProperty_1(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
|
|
1061
1218
|
defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
|
|
1062
1219
|
}
|
|
1063
1220
|
};
|
|
@@ -1076,10 +1233,11 @@
|
|
|
1076
1233
|
}
|
|
1077
1234
|
};
|
|
1078
1235
|
|
|
1079
|
-
var
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1236
|
+
var TypeError$5 = global$1.TypeError;
|
|
1237
|
+
|
|
1238
|
+
var anInstance = function (it, Prototype) {
|
|
1239
|
+
if (objectIsPrototypeOf(Prototype, it)) return it;
|
|
1240
|
+
throw TypeError$5('Incorrect invocation');
|
|
1083
1241
|
};
|
|
1084
1242
|
|
|
1085
1243
|
var iterators = {};
|
|
@@ -1095,33 +1253,58 @@
|
|
|
1095
1253
|
var ITERATOR$1 = wellKnownSymbol('iterator');
|
|
1096
1254
|
|
|
1097
1255
|
var getIteratorMethod = function (it) {
|
|
1098
|
-
if (it != undefined) return it
|
|
1099
|
-
|| it
|
|
1256
|
+
if (it != undefined) return getMethod(it, ITERATOR$1)
|
|
1257
|
+
|| getMethod(it, '@@iterator')
|
|
1100
1258
|
|| iterators[classof(it)];
|
|
1101
1259
|
};
|
|
1102
1260
|
|
|
1103
|
-
var
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1261
|
+
var TypeError$4 = global$1.TypeError;
|
|
1262
|
+
|
|
1263
|
+
var getIterator = function (argument, usingIterator) {
|
|
1264
|
+
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
|
1265
|
+
if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
|
|
1266
|
+
throw TypeError$4(tryToString(argument) + ' is not iterable');
|
|
1267
|
+
};
|
|
1268
|
+
|
|
1269
|
+
var iteratorClose = function (iterator, kind, value) {
|
|
1270
|
+
var innerResult, innerError;
|
|
1271
|
+
anObject(iterator);
|
|
1272
|
+
try {
|
|
1273
|
+
innerResult = getMethod(iterator, 'return');
|
|
1274
|
+
if (!innerResult) {
|
|
1275
|
+
if (kind === 'throw') throw value;
|
|
1276
|
+
return value;
|
|
1277
|
+
}
|
|
1278
|
+
innerResult = functionCall(innerResult, iterator);
|
|
1279
|
+
} catch (error) {
|
|
1280
|
+
innerError = true;
|
|
1281
|
+
innerResult = error;
|
|
1107
1282
|
}
|
|
1283
|
+
if (kind === 'throw') throw value;
|
|
1284
|
+
if (innerError) throw innerResult;
|
|
1285
|
+
anObject(innerResult);
|
|
1286
|
+
return value;
|
|
1108
1287
|
};
|
|
1109
1288
|
|
|
1289
|
+
var TypeError$3 = global$1.TypeError;
|
|
1290
|
+
|
|
1110
1291
|
var Result = function (stopped, result) {
|
|
1111
1292
|
this.stopped = stopped;
|
|
1112
1293
|
this.result = result;
|
|
1113
1294
|
};
|
|
1114
1295
|
|
|
1296
|
+
var ResultPrototype = Result.prototype;
|
|
1297
|
+
|
|
1115
1298
|
var iterate = function (iterable, unboundFunction, options) {
|
|
1116
1299
|
var that = options && options.that;
|
|
1117
1300
|
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
|
1118
1301
|
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
|
1119
1302
|
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
|
1120
|
-
var fn = functionBindContext(unboundFunction, that
|
|
1303
|
+
var fn = functionBindContext(unboundFunction, that);
|
|
1121
1304
|
var iterator, iterFn, index, length, result, next, step;
|
|
1122
1305
|
|
|
1123
1306
|
var stop = function (condition) {
|
|
1124
|
-
if (iterator) iteratorClose(iterator);
|
|
1307
|
+
if (iterator) iteratorClose(iterator, 'normal', condition);
|
|
1125
1308
|
return new Result(true, condition);
|
|
1126
1309
|
};
|
|
1127
1310
|
|
|
@@ -1136,26 +1319,25 @@
|
|
|
1136
1319
|
iterator = iterable;
|
|
1137
1320
|
} else {
|
|
1138
1321
|
iterFn = getIteratorMethod(iterable);
|
|
1139
|
-
if (
|
|
1322
|
+
if (!iterFn) throw TypeError$3(tryToString(iterable) + ' is not iterable');
|
|
1140
1323
|
// optimisation for array iterators
|
|
1141
1324
|
if (isArrayIteratorMethod(iterFn)) {
|
|
1142
|
-
for (index = 0, length =
|
|
1325
|
+
for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
|
|
1143
1326
|
result = callFn(iterable[index]);
|
|
1144
|
-
if (result && result
|
|
1327
|
+
if (result && objectIsPrototypeOf(ResultPrototype, result)) return result;
|
|
1145
1328
|
} return new Result(false);
|
|
1146
1329
|
}
|
|
1147
|
-
iterator =
|
|
1330
|
+
iterator = getIterator(iterable, iterFn);
|
|
1148
1331
|
}
|
|
1149
1332
|
|
|
1150
1333
|
next = iterator.next;
|
|
1151
|
-
while (!(step = next
|
|
1334
|
+
while (!(step = functionCall(next, iterator)).done) {
|
|
1152
1335
|
try {
|
|
1153
1336
|
result = callFn(step.value);
|
|
1154
1337
|
} catch (error) {
|
|
1155
|
-
iteratorClose(iterator);
|
|
1156
|
-
throw error;
|
|
1338
|
+
iteratorClose(iterator, 'throw', error);
|
|
1157
1339
|
}
|
|
1158
|
-
if (typeof result == 'object' && result && result
|
|
1340
|
+
if (typeof result == 'object' && result && objectIsPrototypeOf(ResultPrototype, result)) return result;
|
|
1159
1341
|
} return new Result(false);
|
|
1160
1342
|
};
|
|
1161
1343
|
|
|
@@ -1196,6 +1378,14 @@
|
|
|
1196
1378
|
return ITERATION_SUPPORT;
|
|
1197
1379
|
};
|
|
1198
1380
|
|
|
1381
|
+
var TypeError$2 = global$1.TypeError;
|
|
1382
|
+
|
|
1383
|
+
// `Assert: IsConstructor(argument) is true`
|
|
1384
|
+
var aConstructor = function (argument) {
|
|
1385
|
+
if (isConstructor(argument)) return argument;
|
|
1386
|
+
throw TypeError$2(tryToString(argument) + ' is not a constructor');
|
|
1387
|
+
};
|
|
1388
|
+
|
|
1199
1389
|
var SPECIES$2 = wellKnownSymbol('species');
|
|
1200
1390
|
|
|
1201
1391
|
// `SpeciesConstructor` abstract operation
|
|
@@ -1203,20 +1393,34 @@
|
|
|
1203
1393
|
var speciesConstructor = function (O, defaultConstructor) {
|
|
1204
1394
|
var C = anObject(O).constructor;
|
|
1205
1395
|
var S;
|
|
1206
|
-
return C === undefined || (S = anObject(C)[SPECIES$2]) == undefined ? defaultConstructor :
|
|
1396
|
+
return C === undefined || (S = anObject(C)[SPECIES$2]) == undefined ? defaultConstructor : aConstructor(S);
|
|
1207
1397
|
};
|
|
1208
1398
|
|
|
1399
|
+
var FunctionPrototype = Function.prototype;
|
|
1400
|
+
var apply = FunctionPrototype.apply;
|
|
1401
|
+
var bind$1 = FunctionPrototype.bind;
|
|
1402
|
+
var call = FunctionPrototype.call;
|
|
1403
|
+
|
|
1404
|
+
// eslint-disable-next-line es/no-reflect -- safe
|
|
1405
|
+
var functionApply = typeof Reflect == 'object' && Reflect.apply || (bind$1 ? call.bind(apply) : function () {
|
|
1406
|
+
return call.apply(apply, arguments);
|
|
1407
|
+
});
|
|
1408
|
+
|
|
1209
1409
|
var html = getBuiltIn('document', 'documentElement');
|
|
1210
1410
|
|
|
1211
|
-
var
|
|
1411
|
+
var arraySlice = functionUncurryThis([].slice);
|
|
1412
|
+
|
|
1413
|
+
var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(engineUserAgent);
|
|
1212
1414
|
|
|
1213
1415
|
var engineIsNode = classofRaw(global$1.process) == 'process';
|
|
1214
1416
|
|
|
1215
1417
|
var set = global$1.setImmediate;
|
|
1216
1418
|
var clear = global$1.clearImmediate;
|
|
1217
1419
|
var process$2 = global$1.process;
|
|
1218
|
-
var MessageChannel = global$1.MessageChannel;
|
|
1219
1420
|
var Dispatch = global$1.Dispatch;
|
|
1421
|
+
var Function$2 = global$1.Function;
|
|
1422
|
+
var MessageChannel = global$1.MessageChannel;
|
|
1423
|
+
var String$1 = global$1.String;
|
|
1220
1424
|
var counter = 0;
|
|
1221
1425
|
var queue = {};
|
|
1222
1426
|
var ONREADYSTATECHANGE = 'onreadystatechange';
|
|
@@ -1228,8 +1432,7 @@
|
|
|
1228
1432
|
} catch (error) { /* empty */ }
|
|
1229
1433
|
|
|
1230
1434
|
var run = function (id) {
|
|
1231
|
-
|
|
1232
|
-
if (queue.hasOwnProperty(id)) {
|
|
1435
|
+
if (hasOwnProperty_1(queue, id)) {
|
|
1233
1436
|
var fn = queue[id];
|
|
1234
1437
|
delete queue[id];
|
|
1235
1438
|
fn();
|
|
@@ -1248,19 +1451,15 @@
|
|
|
1248
1451
|
|
|
1249
1452
|
var post = function (id) {
|
|
1250
1453
|
// old engines have not location.origin
|
|
1251
|
-
global$1.postMessage(String(id), location.protocol + '//' + location.host);
|
|
1454
|
+
global$1.postMessage(String$1(id), location.protocol + '//' + location.host);
|
|
1252
1455
|
};
|
|
1253
1456
|
|
|
1254
1457
|
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
|
|
1255
1458
|
if (!set || !clear) {
|
|
1256
1459
|
set = function setImmediate(fn) {
|
|
1257
|
-
var args =
|
|
1258
|
-
var argumentsLength = arguments.length;
|
|
1259
|
-
var i = 1;
|
|
1260
|
-
while (argumentsLength > i) args.push(arguments[i++]);
|
|
1460
|
+
var args = arraySlice(arguments, 1);
|
|
1261
1461
|
queue[++counter] = function () {
|
|
1262
|
-
|
|
1263
|
-
(typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
|
|
1462
|
+
functionApply(isCallable(fn) ? fn : Function$2(fn), undefined, args);
|
|
1264
1463
|
};
|
|
1265
1464
|
defer(counter);
|
|
1266
1465
|
return counter;
|
|
@@ -1284,12 +1483,12 @@
|
|
|
1284
1483
|
channel = new MessageChannel();
|
|
1285
1484
|
port = channel.port2;
|
|
1286
1485
|
channel.port1.onmessage = listener;
|
|
1287
|
-
defer = functionBindContext(port.postMessage, port
|
|
1486
|
+
defer = functionBindContext(port.postMessage, port);
|
|
1288
1487
|
// Browsers with postMessage, skip WebWorkers
|
|
1289
1488
|
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
|
|
1290
1489
|
} else if (
|
|
1291
1490
|
global$1.addEventListener &&
|
|
1292
|
-
|
|
1491
|
+
isCallable(global$1.postMessage) &&
|
|
1293
1492
|
!global$1.importScripts &&
|
|
1294
1493
|
location && location.protocol !== 'file:' &&
|
|
1295
1494
|
!fails(post)
|
|
@@ -1317,7 +1516,7 @@
|
|
|
1317
1516
|
clear: clear
|
|
1318
1517
|
};
|
|
1319
1518
|
|
|
1320
|
-
var engineIsIosPebble = /iphone|ipod
|
|
1519
|
+
var engineIsIosPebble = /ipad|iphone|ipod/i.test(engineUserAgent) && global$1.Pebble !== undefined;
|
|
1321
1520
|
|
|
1322
1521
|
var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(engineUserAgent);
|
|
1323
1522
|
|
|
@@ -1372,9 +1571,9 @@
|
|
|
1372
1571
|
promise = Promise$1.resolve(undefined);
|
|
1373
1572
|
// workaround of WebKit ~ iOS Safari 10.1 bug
|
|
1374
1573
|
promise.constructor = Promise$1;
|
|
1375
|
-
then = promise.then;
|
|
1574
|
+
then = functionBindContext(promise.then, promise);
|
|
1376
1575
|
notify$1 = function () {
|
|
1377
|
-
then
|
|
1576
|
+
then(flush);
|
|
1378
1577
|
};
|
|
1379
1578
|
// Node.js without promises
|
|
1380
1579
|
} else if (engineIsNode) {
|
|
@@ -1388,9 +1587,10 @@
|
|
|
1388
1587
|
// - onreadystatechange
|
|
1389
1588
|
// - setTimeout
|
|
1390
1589
|
} else {
|
|
1590
|
+
// strange IE + webpack dev server bug - use .bind(global)
|
|
1591
|
+
macrotask = functionBindContext(macrotask, global$1);
|
|
1391
1592
|
notify$1 = function () {
|
|
1392
|
-
|
|
1393
|
-
macrotask.call(global$1, flush);
|
|
1593
|
+
macrotask(flush);
|
|
1394
1594
|
};
|
|
1395
1595
|
}
|
|
1396
1596
|
}
|
|
@@ -1411,8 +1611,8 @@
|
|
|
1411
1611
|
resolve = $$resolve;
|
|
1412
1612
|
reject = $$reject;
|
|
1413
1613
|
});
|
|
1414
|
-
this.resolve =
|
|
1415
|
-
this.reject =
|
|
1614
|
+
this.resolve = aCallable(resolve);
|
|
1615
|
+
this.reject = aCallable(reject);
|
|
1416
1616
|
};
|
|
1417
1617
|
|
|
1418
1618
|
// `NewPromiseCapability` abstract operation
|
|
@@ -1437,7 +1637,7 @@
|
|
|
1437
1637
|
var hostReportErrors = function (a, b) {
|
|
1438
1638
|
var console = global$1.console;
|
|
1439
1639
|
if (console && console.error) {
|
|
1440
|
-
arguments.length
|
|
1640
|
+
arguments.length == 1 ? console.error(a) : console.error(a, b);
|
|
1441
1641
|
}
|
|
1442
1642
|
};
|
|
1443
1643
|
|
|
@@ -1466,19 +1666,21 @@
|
|
|
1466
1666
|
|
|
1467
1667
|
var SPECIES$1 = wellKnownSymbol('species');
|
|
1468
1668
|
var PROMISE = 'Promise';
|
|
1469
|
-
|
|
1669
|
+
|
|
1670
|
+
var getInternalState = internalState.getterFor(PROMISE);
|
|
1470
1671
|
var setInternalState = internalState.set;
|
|
1471
1672
|
var getInternalPromiseState = internalState.getterFor(PROMISE);
|
|
1472
1673
|
var NativePromisePrototype = nativePromiseConstructor && nativePromiseConstructor.prototype;
|
|
1473
1674
|
var PromiseConstructor = nativePromiseConstructor;
|
|
1474
|
-
var
|
|
1675
|
+
var PromisePrototype = NativePromisePrototype;
|
|
1475
1676
|
var TypeError$1 = global$1.TypeError;
|
|
1476
1677
|
var document$1 = global$1.document;
|
|
1477
1678
|
var process = global$1.process;
|
|
1478
1679
|
var newPromiseCapability = newPromiseCapability$1.f;
|
|
1479
1680
|
var newGenericPromiseCapability = newPromiseCapability;
|
|
1681
|
+
|
|
1480
1682
|
var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$1.dispatchEvent);
|
|
1481
|
-
var NATIVE_REJECTION_EVENT =
|
|
1683
|
+
var NATIVE_REJECTION_EVENT = isCallable(global$1.PromiseRejectionEvent);
|
|
1482
1684
|
var UNHANDLED_REJECTION = 'unhandledrejection';
|
|
1483
1685
|
var REJECTION_HANDLED = 'rejectionhandled';
|
|
1484
1686
|
var PENDING = 0;
|
|
@@ -1487,6 +1689,7 @@
|
|
|
1487
1689
|
var HANDLED = 1;
|
|
1488
1690
|
var UNHANDLED = 2;
|
|
1489
1691
|
var SUBCLASSING = false;
|
|
1692
|
+
|
|
1490
1693
|
var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
|
|
1491
1694
|
|
|
1492
1695
|
var FORCED = isForced_1(PROMISE, function () {
|
|
@@ -1520,7 +1723,7 @@
|
|
|
1520
1723
|
// helpers
|
|
1521
1724
|
var isThenable = function (it) {
|
|
1522
1725
|
var then;
|
|
1523
|
-
return isObject(it) &&
|
|
1726
|
+
return isObject(it) && isCallable(then = it.then) ? then : false;
|
|
1524
1727
|
};
|
|
1525
1728
|
|
|
1526
1729
|
var notify = function (state, isReject) {
|
|
@@ -1557,7 +1760,7 @@
|
|
|
1557
1760
|
if (result === reaction.promise) {
|
|
1558
1761
|
reject(TypeError$1('Promise-chain cycle'));
|
|
1559
1762
|
} else if (then = isThenable(result)) {
|
|
1560
|
-
then
|
|
1763
|
+
functionCall(then, result, resolve, reject);
|
|
1561
1764
|
} else resolve(result);
|
|
1562
1765
|
} else reject(value);
|
|
1563
1766
|
} catch (error) {
|
|
@@ -1585,7 +1788,7 @@
|
|
|
1585
1788
|
};
|
|
1586
1789
|
|
|
1587
1790
|
var onUnhandled = function (state) {
|
|
1588
|
-
task
|
|
1791
|
+
functionCall(task, global$1, function () {
|
|
1589
1792
|
var promise = state.facade;
|
|
1590
1793
|
var value = state.value;
|
|
1591
1794
|
var IS_UNHANDLED = isUnhandled(state);
|
|
@@ -1608,7 +1811,7 @@
|
|
|
1608
1811
|
};
|
|
1609
1812
|
|
|
1610
1813
|
var onHandleUnhandled = function (state) {
|
|
1611
|
-
task
|
|
1814
|
+
functionCall(task, global$1, function () {
|
|
1612
1815
|
var promise = state.facade;
|
|
1613
1816
|
if (engineIsNode) {
|
|
1614
1817
|
process.emit('rejectionHandled', promise);
|
|
@@ -1642,7 +1845,7 @@
|
|
|
1642
1845
|
microtask(function () {
|
|
1643
1846
|
var wrapper = { done: false };
|
|
1644
1847
|
try {
|
|
1645
|
-
then
|
|
1848
|
+
functionCall(then, value,
|
|
1646
1849
|
bind(internalResolve, wrapper, state),
|
|
1647
1850
|
bind(internalReject, wrapper, state)
|
|
1648
1851
|
);
|
|
@@ -1664,9 +1867,9 @@
|
|
|
1664
1867
|
if (FORCED) {
|
|
1665
1868
|
// 25.4.3.1 Promise(executor)
|
|
1666
1869
|
PromiseConstructor = function Promise(executor) {
|
|
1667
|
-
anInstance(this,
|
|
1668
|
-
|
|
1669
|
-
Internal
|
|
1870
|
+
anInstance(this, PromisePrototype);
|
|
1871
|
+
aCallable(executor);
|
|
1872
|
+
functionCall(Internal, this);
|
|
1670
1873
|
var state = getInternalState(this);
|
|
1671
1874
|
try {
|
|
1672
1875
|
executor(bind(internalResolve, state), bind(internalReject, state));
|
|
@@ -1674,7 +1877,7 @@
|
|
|
1674
1877
|
internalReject(state, error);
|
|
1675
1878
|
}
|
|
1676
1879
|
};
|
|
1677
|
-
|
|
1880
|
+
PromisePrototype = PromiseConstructor.prototype;
|
|
1678
1881
|
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
1679
1882
|
Internal = function Promise(executor) {
|
|
1680
1883
|
setInternalState(this, {
|
|
@@ -1688,17 +1891,18 @@
|
|
|
1688
1891
|
value: undefined
|
|
1689
1892
|
});
|
|
1690
1893
|
};
|
|
1691
|
-
Internal.prototype = redefineAll(
|
|
1894
|
+
Internal.prototype = redefineAll(PromisePrototype, {
|
|
1692
1895
|
// `Promise.prototype.then` method
|
|
1693
1896
|
// https://tc39.es/ecma262/#sec-promise.prototype.then
|
|
1694
1897
|
then: function then(onFulfilled, onRejected) {
|
|
1695
1898
|
var state = getInternalPromiseState(this);
|
|
1899
|
+
var reactions = state.reactions;
|
|
1696
1900
|
var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
|
|
1697
|
-
reaction.ok =
|
|
1698
|
-
reaction.fail =
|
|
1901
|
+
reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
|
|
1902
|
+
reaction.fail = isCallable(onRejected) && onRejected;
|
|
1699
1903
|
reaction.domain = engineIsNode ? process.domain : undefined;
|
|
1700
1904
|
state.parent = true;
|
|
1701
|
-
|
|
1905
|
+
reactions[reactions.length] = reaction;
|
|
1702
1906
|
if (state.state != PENDING) notify(state, false);
|
|
1703
1907
|
return reaction.promise;
|
|
1704
1908
|
},
|
|
@@ -1721,7 +1925,7 @@
|
|
|
1721
1925
|
: newGenericPromiseCapability(C);
|
|
1722
1926
|
};
|
|
1723
1927
|
|
|
1724
|
-
if (
|
|
1928
|
+
if (isCallable(nativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
|
|
1725
1929
|
nativeThen = NativePromisePrototype.then;
|
|
1726
1930
|
|
|
1727
1931
|
if (!SUBCLASSING) {
|
|
@@ -1729,13 +1933,13 @@
|
|
|
1729
1933
|
redefine(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
|
1730
1934
|
var that = this;
|
|
1731
1935
|
return new PromiseConstructor(function (resolve, reject) {
|
|
1732
|
-
nativeThen
|
|
1936
|
+
functionCall(nativeThen, that, resolve, reject);
|
|
1733
1937
|
}).then(onFulfilled, onRejected);
|
|
1734
1938
|
// https://github.com/zloirock/core-js/issues/640
|
|
1735
1939
|
}, { unsafe: true });
|
|
1736
1940
|
|
|
1737
1941
|
// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
|
|
1738
|
-
redefine(NativePromisePrototype, 'catch',
|
|
1942
|
+
redefine(NativePromisePrototype, 'catch', PromisePrototype['catch'], { unsafe: true });
|
|
1739
1943
|
}
|
|
1740
1944
|
|
|
1741
1945
|
// make `.constructor === Promise` work for native promise-based APIs
|
|
@@ -1745,7 +1949,7 @@
|
|
|
1745
1949
|
|
|
1746
1950
|
// make `instanceof Promise` work for native promise-based APIs
|
|
1747
1951
|
if (objectSetPrototypeOf) {
|
|
1748
|
-
objectSetPrototypeOf(NativePromisePrototype,
|
|
1952
|
+
objectSetPrototypeOf(NativePromisePrototype, PromisePrototype);
|
|
1749
1953
|
}
|
|
1750
1954
|
}
|
|
1751
1955
|
}
|
|
@@ -1765,7 +1969,7 @@
|
|
|
1765
1969
|
// https://tc39.es/ecma262/#sec-promise.reject
|
|
1766
1970
|
reject: function reject(r) {
|
|
1767
1971
|
var capability = newPromiseCapability(this);
|
|
1768
|
-
capability.reject
|
|
1972
|
+
functionCall(capability.reject, undefined, r);
|
|
1769
1973
|
return capability.promise;
|
|
1770
1974
|
}
|
|
1771
1975
|
});
|
|
@@ -1787,16 +1991,15 @@
|
|
|
1787
1991
|
var resolve = capability.resolve;
|
|
1788
1992
|
var reject = capability.reject;
|
|
1789
1993
|
var result = perform(function () {
|
|
1790
|
-
var $promiseResolve =
|
|
1994
|
+
var $promiseResolve = aCallable(C.resolve);
|
|
1791
1995
|
var values = [];
|
|
1792
1996
|
var counter = 0;
|
|
1793
1997
|
var remaining = 1;
|
|
1794
1998
|
iterate(iterable, function (promise) {
|
|
1795
1999
|
var index = counter++;
|
|
1796
2000
|
var alreadyCalled = false;
|
|
1797
|
-
values.push(undefined);
|
|
1798
2001
|
remaining++;
|
|
1799
|
-
$promiseResolve
|
|
2002
|
+
functionCall($promiseResolve, C, promise).then(function (value) {
|
|
1800
2003
|
if (alreadyCalled) return;
|
|
1801
2004
|
alreadyCalled = true;
|
|
1802
2005
|
values[index] = value;
|
|
@@ -1815,9 +2018,9 @@
|
|
|
1815
2018
|
var capability = newPromiseCapability(C);
|
|
1816
2019
|
var reject = capability.reject;
|
|
1817
2020
|
var result = perform(function () {
|
|
1818
|
-
var $promiseResolve =
|
|
2021
|
+
var $promiseResolve = aCallable(C.resolve);
|
|
1819
2022
|
iterate(iterable, function (promise) {
|
|
1820
|
-
$promiseResolve
|
|
2023
|
+
functionCall($promiseResolve, C, promise).then(capability.resolve, reject);
|
|
1821
2024
|
});
|
|
1822
2025
|
});
|
|
1823
2026
|
if (result.error) reject(result.value);
|
|
@@ -1825,16 +2028,15 @@
|
|
|
1825
2028
|
}
|
|
1826
2029
|
});
|
|
1827
2030
|
|
|
1828
|
-
var slice = [].slice;
|
|
1829
2031
|
var MSIE = /MSIE .\./.test(engineUserAgent); // <- dirty ie9- check
|
|
2032
|
+
var Function$1 = global$1.Function;
|
|
1830
2033
|
|
|
1831
2034
|
var wrap = function (scheduler) {
|
|
1832
2035
|
return function (handler, timeout /* , ...arguments */) {
|
|
1833
2036
|
var boundArgs = arguments.length > 2;
|
|
1834
|
-
var args = boundArgs ?
|
|
2037
|
+
var args = boundArgs ? arraySlice(arguments, 2) : undefined;
|
|
1835
2038
|
return scheduler(boundArgs ? function () {
|
|
1836
|
-
|
|
1837
|
-
(typeof handler == 'function' ? handler : Function(handler)).apply(this, args);
|
|
2039
|
+
functionApply(isCallable(handler) ? handler : Function$1(handler), this, args);
|
|
1838
2040
|
} : handler, timeout);
|
|
1839
2041
|
};
|
|
1840
2042
|
};
|
|
@@ -1855,11 +2057,12 @@
|
|
|
1855
2057
|
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
1856
2058
|
var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
1857
2059
|
anObject(O);
|
|
2060
|
+
var props = toIndexedObject(Properties);
|
|
1858
2061
|
var keys = objectKeys(Properties);
|
|
1859
2062
|
var length = keys.length;
|
|
1860
2063
|
var index = 0;
|
|
1861
2064
|
var key;
|
|
1862
|
-
while (length > index) objectDefineProperty.f(O, key = keys[index++],
|
|
2065
|
+
while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
|
|
1863
2066
|
return O;
|
|
1864
2067
|
};
|
|
1865
2068
|
|
|
@@ -1892,17 +2095,15 @@
|
|
|
1892
2095
|
var iframe = documentCreateElement('iframe');
|
|
1893
2096
|
var JS = 'java' + SCRIPT + ':';
|
|
1894
2097
|
var iframeDocument;
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
return iframeDocument.F;
|
|
1905
|
-
}
|
|
2098
|
+
iframe.style.display = 'none';
|
|
2099
|
+
html.appendChild(iframe);
|
|
2100
|
+
// https://github.com/zloirock/core-js/issues/475
|
|
2101
|
+
iframe.src = String(JS);
|
|
2102
|
+
iframeDocument = iframe.contentWindow.document;
|
|
2103
|
+
iframeDocument.open();
|
|
2104
|
+
iframeDocument.write(scriptTag('document.F=Object'));
|
|
2105
|
+
iframeDocument.close();
|
|
2106
|
+
return iframeDocument.F;
|
|
1906
2107
|
};
|
|
1907
2108
|
|
|
1908
2109
|
// Check for document.domain and active x support
|
|
@@ -1915,10 +2116,11 @@
|
|
|
1915
2116
|
try {
|
|
1916
2117
|
activeXDocument = new ActiveXObject('htmlfile');
|
|
1917
2118
|
} catch (error) { /* ignore */ }
|
|
1918
|
-
NullProtoObject = document
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
2119
|
+
NullProtoObject = typeof document != 'undefined'
|
|
2120
|
+
? document.domain && activeXDocument
|
|
2121
|
+
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
2122
|
+
: NullProtoObjectViaIFrame()
|
|
2123
|
+
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
1922
2124
|
var length = enumBugKeys.length;
|
|
1923
2125
|
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
1924
2126
|
return NullProtoObject();
|