core-js-pure 3.18.2 → 3.19.2
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.
- package/es/date/to-primitive.js +2 -3
- package/es/date/to-string.js +2 -4
- package/es/instance/at.js +6 -5
- package/es/instance/bind.js +3 -2
- package/es/instance/code-point-at.js +4 -3
- package/es/instance/concat.js +3 -2
- package/es/instance/copy-within.js +3 -2
- package/es/instance/ends-with.js +4 -3
- package/es/instance/entries.js +3 -2
- package/es/instance/every.js +3 -2
- package/es/instance/fill.js +3 -2
- package/es/instance/filter.js +3 -2
- package/es/instance/find-index.js +3 -2
- package/es/instance/find.js +3 -2
- package/es/instance/flags.js +2 -1
- package/es/instance/flat-map.js +3 -2
- package/es/instance/flat.js +3 -2
- package/es/instance/for-each.js +3 -2
- package/es/instance/includes.js +6 -5
- package/es/instance/index-of.js +3 -2
- package/es/instance/keys.js +3 -2
- package/es/instance/last-index-of.js +3 -2
- package/es/instance/map.js +3 -2
- package/es/instance/match-all.js +4 -3
- package/es/instance/pad-end.js +4 -3
- package/es/instance/pad-start.js +4 -3
- package/es/instance/reduce-right.js +3 -2
- package/es/instance/reduce.js +3 -2
- package/es/instance/repeat.js +4 -3
- package/es/instance/replace-all.js +4 -3
- package/es/instance/reverse.js +3 -2
- package/es/instance/slice.js +3 -2
- package/es/instance/some.js +3 -2
- package/es/instance/sort.js +3 -2
- package/es/instance/splice.js +3 -2
- package/es/instance/starts-with.js +4 -3
- package/es/instance/trim-end.js +4 -3
- package/es/instance/trim-left.js +4 -3
- package/es/instance/trim-right.js +4 -3
- package/es/instance/trim-start.js +4 -3
- package/es/instance/trim.js +4 -3
- package/es/instance/values.js +3 -2
- package/es/json/stringify.js +4 -3
- package/es/promise/all-settled.js +2 -1
- package/es/promise/any.js +2 -1
- package/es/regexp/flags.js +3 -4
- package/es/regexp/match.js +2 -1
- package/es/regexp/replace.js +2 -1
- package/es/regexp/search.js +2 -1
- package/es/regexp/split.js +2 -1
- package/es/regexp/test.js +2 -3
- package/es/regexp/to-string.js +2 -3
- package/es/string/iterator.js +2 -5
- package/features/instance/at.js +6 -5
- package/features/instance/code-points.js +4 -3
- package/features/instance/filter-out.js +3 -2
- package/features/instance/filter-reject.js +3 -2
- package/features/instance/find-last-index.js +3 -2
- package/features/instance/find-last.js +3 -2
- package/features/instance/group-by.js +3 -2
- package/features/instance/unique-by.js +3 -2
- package/features/map/from.js +3 -2
- package/features/map/group-by.js +2 -1
- package/features/map/key-by.js +2 -1
- package/features/map/of.js +3 -2
- package/features/promise/try.js +2 -1
- package/features/set/from.js +3 -2
- package/features/set/of.js +3 -2
- package/features/weak-map/from.js +3 -2
- package/features/weak-map/of.js +3 -2
- package/features/weak-set/from.js +3 -2
- package/features/weak-set/of.js +3 -2
- package/internals/a-callable.js +3 -0
- package/internals/a-constructor.js +3 -0
- package/internals/a-possible-prototype.js +5 -1
- package/internals/an-instance.js +8 -3
- package/internals/an-object.js +4 -0
- package/internals/array-buffer-native.js +1 -1
- package/internals/array-buffer-non-extensible.js +10 -0
- package/internals/array-from-async.js +1 -1
- package/internals/array-from.js +6 -2
- package/internals/array-group-by.js +6 -3
- package/internals/array-iteration-from-last.js +1 -1
- package/internals/array-iteration.js +5 -4
- package/internals/array-last-index-of.js +2 -1
- package/internals/array-reduce.js +3 -0
- package/internals/array-slice-simple.js +17 -0
- package/internals/array-slice.js +3 -0
- package/internals/array-sort.js +10 -11
- package/internals/array-species-constructor.js +2 -0
- package/internals/array-unique-by.js +13 -9
- package/internals/async-from-sync-iterator.js +4 -3
- package/internals/async-iterator-create-proxy.js +4 -3
- package/internals/async-iterator-iteration.js +5 -2
- package/internals/classof-raw.js +5 -2
- package/internals/classof.js +3 -0
- package/internals/clear-error-stack.js +20 -0
- package/internals/collection-add-all.js +3 -2
- package/internals/collection-delete-all.js +3 -2
- package/internals/collection-from.js +7 -4
- package/internals/collection-of.js +3 -4
- package/internals/collection-strong.js +11 -9
- package/internals/collection-weak.js +10 -6
- package/internals/collection.js +5 -3
- package/internals/composite-key.js +9 -2
- package/internals/create-html.js +3 -1
- package/internals/date-to-iso-string.js +23 -13
- package/internals/date-to-primitive.js +3 -0
- package/internals/define-iterator.js +2 -1
- package/internals/engine-v8-version.js +10 -4
- package/internals/error-stack-installable.js +10 -0
- package/internals/export.js +6 -4
- package/internals/flatten-into-array.js +4 -1
- package/internals/function-apply.js +9 -0
- package/internals/function-bind-context.js +5 -17
- package/internals/function-bind.js +15 -9
- package/internals/function-call.js +5 -0
- package/internals/function-uncurry-this.js +12 -0
- package/internals/get-async-iterator.js +2 -1
- package/internals/get-iterator.js +7 -2
- package/internals/get-substitution.js +10 -7
- package/internals/has-own-property.js +3 -2
- package/internals/host-report-errors.js +1 -1
- package/internals/ieee754.js +24 -6
- package/internals/indexed-object.js +5 -2
- package/internals/inspect-source.js +3 -2
- package/internals/install-error-cause.js +1 -1
- package/internals/internal-metadata.js +4 -7
- package/internals/internal-state.js +9 -7
- package/internals/is-callable.js +1 -1
- package/internals/is-constructor.js +6 -4
- package/internals/is-iterable.js +4 -2
- package/internals/is-object.js +1 -1
- package/internals/is-symbol.js +6 -2
- package/internals/iterate.js +14 -6
- package/internals/iterator-close.js +2 -1
- package/internals/iterator-create-proxy.js +4 -3
- package/internals/map-emplace.js +8 -3
- package/internals/map-upsert.js +12 -4
- package/internals/math-scale.js +9 -12
- package/internals/microtask.js +6 -4
- package/internals/normalize-string-argument.js +5 -0
- package/internals/not-a-regexp.js +3 -0
- package/internals/number-parse-float.js +8 -6
- package/internals/number-parse-int.js +4 -2
- package/internals/numeric-range-iterator.js +4 -0
- package/internals/object-assign.js +5 -2
- package/internals/object-define-properties.js +3 -1
- package/internals/object-define-property.js +2 -0
- package/internals/object-get-own-property-descriptor.js +2 -1
- package/internals/object-get-own-property-names-external.js +4 -4
- package/internals/object-get-prototype-of.js +2 -1
- package/internals/object-is-extensible.js +16 -0
- package/internals/object-is-prototype-of.js +3 -0
- package/internals/object-keys-internal.js +5 -2
- package/internals/object-set-prototype-of.js +4 -3
- package/internals/object-to-array.js +7 -3
- package/internals/ordinary-to-primitive.js +7 -3
- package/internals/own-keys.js +4 -1
- package/internals/reflect-metadata.js +9 -3
- package/internals/regexp-exec-abstract.js +6 -2
- package/internals/require-object-coercible.js +4 -0
- package/internals/set-global.js +4 -2
- package/internals/shared.js +1 -1
- package/internals/string-multibyte.js +13 -4
- package/internals/string-pad.js +6 -3
- package/internals/string-punycode-to-ascii.js +34 -20
- package/internals/string-repeat.js +3 -0
- package/internals/string-trim.js +4 -2
- package/internals/task.js +11 -11
- package/internals/this-number-value.js +2 -4
- package/internals/to-index.js +3 -0
- package/internals/to-object.js +3 -0
- package/internals/to-positive-integer.js +3 -0
- package/internals/to-primitive.js +4 -1
- package/internals/to-property-key.js +1 -1
- package/internals/to-string.js +3 -0
- package/internals/try-to-string.js +4 -0
- package/internals/uid.js +4 -1
- package/internals/well-known-symbol.js +5 -1
- package/modules/es.aggregate-error.js +27 -11
- package/modules/es.array.concat.js +2 -0
- package/modules/es.array.index-of.js +7 -5
- package/modules/es.array.join.js +3 -2
- package/modules/es.array.of.js +3 -1
- package/modules/es.array.reduce.js +2 -1
- package/modules/es.array.reverse.js +3 -2
- package/modules/es.array.slice.js +4 -2
- package/modules/es.array.sort.js +7 -4
- package/modules/es.array.splice.js +2 -0
- package/modules/es.date.get-year.js +3 -2
- package/modules/es.date.now.js +6 -1
- package/modules/es.date.set-year.js +6 -4
- package/modules/es.date.to-json.js +3 -2
- package/modules/es.escape.js +12 -5
- package/modules/es.function.has-instance.js +3 -2
- package/modules/es.json.stringify.js +18 -7
- package/modules/es.map.js +1 -1
- package/modules/es.number.to-fixed.js +19 -13
- package/modules/es.number.to-precision.js +6 -5
- package/modules/es.object.is-extensible.js +4 -10
- package/modules/es.object.is-frozen.js +6 -2
- package/modules/es.object.is-sealed.js +6 -2
- package/modules/es.promise.all-settled.js +2 -2
- package/modules/es.promise.any.js +5 -4
- package/modules/es.promise.js +22 -18
- package/modules/es.reflect.apply.js +4 -10
- package/modules/es.reflect.construct.js +10 -5
- package/modules/es.reflect.get.js +2 -1
- package/modules/es.reflect.is-extensible.js +2 -4
- package/modules/es.reflect.set.js +2 -1
- package/modules/es.set.js +1 -1
- package/modules/es.string.at-alternative.js +4 -1
- package/modules/es.string.ends-with.js +6 -4
- package/modules/es.string.from-code-point.js +7 -4
- package/modules/es.string.includes.js +8 -2
- package/modules/es.string.match-all.js +25 -19
- package/modules/es.string.raw.js +6 -6
- package/modules/es.string.replace-all.js +19 -13
- package/modules/es.string.starts-with.js +6 -4
- package/modules/es.string.substr.js +3 -2
- package/modules/es.symbol.js +34 -21
- package/modules/es.unescape.js +14 -9
- package/modules/es.weak-map.js +15 -15
- package/modules/esnext.array.is-template-object.js +1 -1
- package/modules/esnext.async-iterator.as-indexed-pairs.js +2 -1
- package/modules/esnext.async-iterator.constructor.js +1 -1
- package/modules/esnext.async-iterator.drop.js +2 -1
- package/modules/esnext.async-iterator.filter.js +2 -1
- package/modules/esnext.async-iterator.flat-map.js +3 -2
- package/modules/esnext.async-iterator.from.js +4 -4
- package/modules/esnext.async-iterator.map.js +2 -1
- package/modules/esnext.async-iterator.reduce.js +4 -1
- package/modules/esnext.async-iterator.take.js +4 -2
- package/modules/esnext.composite-key.js +5 -1
- package/modules/esnext.composite-symbol.js +3 -2
- package/modules/esnext.iterator.as-indexed-pairs.js +2 -1
- package/modules/esnext.iterator.constructor.js +1 -1
- package/modules/esnext.iterator.drop.js +4 -2
- package/modules/esnext.iterator.filter.js +2 -1
- package/modules/esnext.iterator.flat-map.js +7 -3
- package/modules/esnext.iterator.from.js +4 -4
- package/modules/esnext.iterator.map.js +2 -1
- package/modules/esnext.iterator.reduce.js +3 -0
- package/modules/esnext.iterator.take.js +2 -1
- package/modules/esnext.map.delete-all.js +2 -4
- package/modules/esnext.map.emplace.js +2 -2
- package/modules/esnext.map.every.js +1 -1
- package/modules/esnext.map.filter.js +5 -4
- package/modules/esnext.map.find-key.js +1 -1
- package/modules/esnext.map.find.js +1 -1
- package/modules/esnext.map.group-by.js +6 -2
- package/modules/esnext.map.includes.js +1 -1
- package/modules/esnext.map.key-by.js +2 -1
- package/modules/esnext.map.map-keys.js +5 -4
- package/modules/esnext.map.map-values.js +5 -4
- package/modules/esnext.map.reduce.js +3 -0
- package/modules/esnext.map.some.js +1 -1
- package/modules/esnext.map.update-or-insert.js +2 -2
- package/modules/esnext.map.update.js +11 -4
- package/modules/esnext.map.upsert.js +2 -2
- package/modules/esnext.math.seeded-prng.js +3 -1
- package/modules/esnext.number.from-string.js +12 -3
- package/modules/esnext.observable.js +14 -9
- package/modules/esnext.reflect.get-metadata-keys.js +5 -10
- package/modules/esnext.set.add-all.js +2 -4
- package/modules/esnext.set.delete-all.js +2 -4
- package/modules/esnext.set.difference.js +3 -2
- package/modules/esnext.set.every.js +1 -1
- package/modules/esnext.set.filter.js +4 -3
- package/modules/esnext.set.find.js +1 -1
- package/modules/esnext.set.intersection.js +3 -2
- package/modules/esnext.set.is-disjoint-from.js +3 -2
- package/modules/esnext.set.is-subset-of.js +3 -2
- package/modules/esnext.set.is-superset-of.js +3 -2
- package/modules/esnext.set.join.js +9 -4
- package/modules/esnext.set.map.js +5 -4
- package/modules/esnext.set.reduce.js +3 -0
- package/modules/esnext.set.some.js +1 -1
- package/modules/esnext.set.symmetric-difference.js +3 -2
- package/modules/esnext.weak-map.delete-all.js +2 -4
- package/modules/esnext.weak-map.emplace.js +2 -2
- package/modules/esnext.weak-map.upsert.js +2 -2
- package/modules/esnext.weak-set.add-all.js +2 -4
- package/modules/esnext.weak-set.delete-all.js +2 -4
- package/modules/web.timers.js +5 -4
- package/modules/web.url-search-params.js +122 -104
- package/modules/web.url.js +664 -628
- package/package.json +2 -2
- package/stable/instance/entries.js +6 -4
- package/stable/instance/for-each.js +6 -4
- package/stable/instance/keys.js +6 -4
- package/stable/instance/values.js +6 -4
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var $ = require('../internals/export');
|
|
3
|
+
var call = require('../internals/function-call');
|
|
3
4
|
var IS_PURE = require('../internals/is-pure');
|
|
4
5
|
var FunctionName = require('../internals/function-name');
|
|
5
6
|
var isCallable = require('../internals/is-callable');
|
|
@@ -70,7 +71,7 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
|
|
|
70
71
|
createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
|
|
71
72
|
} else {
|
|
72
73
|
INCORRECT_VALUES_NAME = true;
|
|
73
|
-
defaultIterator = function values() { return
|
|
74
|
+
defaultIterator = function values() { return call(nativeIterator, this); };
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
|
|
@@ -9,13 +9,19 @@ var match, version;
|
|
|
9
9
|
|
|
10
10
|
if (v8) {
|
|
11
11
|
match = v8.split('.');
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
13
|
+
// but their correct versions are not interesting for us
|
|
14
|
+
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
18
|
+
// so check `userAgent` even if `.v8` exists, but 0
|
|
19
|
+
if (!version && userAgent) {
|
|
14
20
|
match = userAgent.match(/Edge\/(\d+)/);
|
|
15
21
|
if (!match || match[1] >= 74) {
|
|
16
22
|
match = userAgent.match(/Chrome\/(\d+)/);
|
|
17
|
-
if (match) version = match[1];
|
|
23
|
+
if (match) version = +match[1];
|
|
18
24
|
}
|
|
19
25
|
}
|
|
20
26
|
|
|
21
|
-
module.exports = version
|
|
27
|
+
module.exports = version;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var fails = require('../internals/fails');
|
|
2
|
+
var createPropertyDescriptor = require('../internals/create-property-descriptor');
|
|
3
|
+
|
|
4
|
+
module.exports = !fails(function () {
|
|
5
|
+
var error = Error('a');
|
|
6
|
+
if (!('stack' in error)) return true;
|
|
7
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
8
|
+
Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
|
|
9
|
+
return error.stack !== 7;
|
|
10
|
+
});
|
package/internals/export.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var global = require('../internals/global');
|
|
3
|
+
var apply = require('../internals/function-apply');
|
|
4
|
+
var uncurryThis = require('../internals/function-uncurry-this');
|
|
3
5
|
var isCallable = require('../internals/is-callable');
|
|
4
6
|
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
|
|
5
7
|
var isForced = require('../internals/is-forced');
|
|
@@ -10,13 +12,13 @@ var hasOwn = require('../internals/has-own-property');
|
|
|
10
12
|
|
|
11
13
|
var wrapConstructor = function (NativeConstructor) {
|
|
12
14
|
var Wrapper = function (a, b, c) {
|
|
13
|
-
if (this instanceof
|
|
15
|
+
if (this instanceof Wrapper) {
|
|
14
16
|
switch (arguments.length) {
|
|
15
17
|
case 0: return new NativeConstructor();
|
|
16
18
|
case 1: return new NativeConstructor(a);
|
|
17
19
|
case 2: return new NativeConstructor(a, b);
|
|
18
20
|
} return new NativeConstructor(a, b, c);
|
|
19
|
-
} return
|
|
21
|
+
} return apply(NativeConstructor, this, arguments);
|
|
20
22
|
};
|
|
21
23
|
Wrapper.prototype = NativeConstructor.prototype;
|
|
22
24
|
return Wrapper;
|
|
@@ -66,14 +68,14 @@ module.exports = function (options, source) {
|
|
|
66
68
|
// export native or implementation
|
|
67
69
|
sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];
|
|
68
70
|
|
|
69
|
-
if (USE_NATIVE && typeof targetProperty
|
|
71
|
+
if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;
|
|
70
72
|
|
|
71
73
|
// bind timers to global for call from export context
|
|
72
74
|
if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);
|
|
73
75
|
// wrap global constructors for prevent changs in this version
|
|
74
76
|
else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);
|
|
75
77
|
// make static versions for prototype methods
|
|
76
|
-
else if (PROTO && isCallable(sourceProperty)) resultProperty =
|
|
78
|
+
else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);
|
|
77
79
|
// default case
|
|
78
80
|
else resultProperty = sourceProperty;
|
|
79
81
|
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
+
var global = require('../internals/global');
|
|
2
3
|
var isArray = require('../internals/is-array');
|
|
3
4
|
var lengthOfArrayLike = require('../internals/length-of-array-like');
|
|
4
5
|
var bind = require('../internals/function-bind-context');
|
|
5
6
|
|
|
7
|
+
var TypeError = global.TypeError;
|
|
8
|
+
|
|
6
9
|
// `FlattenIntoArray` abstract operation
|
|
7
10
|
// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
|
|
8
11
|
var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
|
|
9
12
|
var targetIndex = start;
|
|
10
13
|
var sourceIndex = 0;
|
|
11
|
-
var mapFn = mapper ? bind(mapper, thisArg
|
|
14
|
+
var mapFn = mapper ? bind(mapper, thisArg) : false;
|
|
12
15
|
var element, elementLen;
|
|
13
16
|
|
|
14
17
|
while (sourceIndex < sourceLen) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var FunctionPrototype = Function.prototype;
|
|
2
|
+
var apply = FunctionPrototype.apply;
|
|
3
|
+
var bind = FunctionPrototype.bind;
|
|
4
|
+
var call = FunctionPrototype.call;
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line es/no-reflect -- safe
|
|
7
|
+
module.exports = typeof Reflect == 'object' && Reflect.apply || (bind ? call.bind(apply) : function () {
|
|
8
|
+
return call.apply(apply, arguments);
|
|
9
|
+
});
|
|
@@ -1,24 +1,12 @@
|
|
|
1
|
+
var uncurryThis = require('../internals/function-uncurry-this');
|
|
1
2
|
var aCallable = require('../internals/a-callable');
|
|
2
3
|
|
|
4
|
+
var bind = uncurryThis(uncurryThis.bind);
|
|
5
|
+
|
|
3
6
|
// optional / simple context binding
|
|
4
|
-
module.exports = function (fn, that
|
|
7
|
+
module.exports = function (fn, that) {
|
|
5
8
|
aCallable(fn);
|
|
6
|
-
|
|
7
|
-
switch (length) {
|
|
8
|
-
case 0: return function () {
|
|
9
|
-
return fn.call(that);
|
|
10
|
-
};
|
|
11
|
-
case 1: return function (a) {
|
|
12
|
-
return fn.call(that, a);
|
|
13
|
-
};
|
|
14
|
-
case 2: return function (a, b) {
|
|
15
|
-
return fn.call(that, a, b);
|
|
16
|
-
};
|
|
17
|
-
case 3: return function (a, b, c) {
|
|
18
|
-
return fn.call(that, a, b, c);
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
return function (/* ...args */) {
|
|
9
|
+
return that === undefined ? fn : bind ? bind(fn, that) : function (/* ...args */) {
|
|
22
10
|
return fn.apply(that, arguments);
|
|
23
11
|
};
|
|
24
12
|
};
|
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
+
var global = require('../internals/global');
|
|
3
|
+
var uncurryThis = require('../internals/function-uncurry-this');
|
|
2
4
|
var aCallable = require('../internals/a-callable');
|
|
3
5
|
var isObject = require('../internals/is-object');
|
|
6
|
+
var hasOwn = require('../internals/has-own-property');
|
|
7
|
+
var arraySlice = require('../internals/array-slice');
|
|
4
8
|
|
|
5
|
-
var
|
|
9
|
+
var Function = global.Function;
|
|
10
|
+
var concat = uncurryThis([].concat);
|
|
11
|
+
var join = uncurryThis([].join);
|
|
6
12
|
var factories = {};
|
|
7
13
|
|
|
8
14
|
var construct = function (C, argsLength, args) {
|
|
9
|
-
if (!(argsLength
|
|
15
|
+
if (!hasOwn(factories, argsLength)) {
|
|
10
16
|
for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
|
|
11
|
-
|
|
12
|
-
factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')');
|
|
17
|
+
factories[argsLength] = Function('C,a', 'return new C(' + join(list, ',') + ')');
|
|
13
18
|
} return factories[argsLength](C, args);
|
|
14
19
|
};
|
|
15
20
|
|
|
16
21
|
// `Function.prototype.bind` method implementation
|
|
17
22
|
// https://tc39.es/ecma262/#sec-function.prototype.bind
|
|
18
23
|
module.exports = Function.bind || function bind(that /* , ...args */) {
|
|
19
|
-
var
|
|
20
|
-
var
|
|
24
|
+
var F = aCallable(this);
|
|
25
|
+
var Prototype = F.prototype;
|
|
26
|
+
var partArgs = arraySlice(arguments, 1);
|
|
21
27
|
var boundFunction = function bound(/* args... */) {
|
|
22
|
-
var args =
|
|
23
|
-
return this instanceof boundFunction ? construct(
|
|
28
|
+
var args = concat(partArgs, arraySlice(arguments));
|
|
29
|
+
return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
|
|
24
30
|
};
|
|
25
|
-
if (isObject(
|
|
31
|
+
if (isObject(Prototype)) boundFunction.prototype = Prototype;
|
|
26
32
|
return boundFunction;
|
|
27
33
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var FunctionPrototype = Function.prototype;
|
|
2
|
+
var bind = FunctionPrototype.bind;
|
|
3
|
+
var call = FunctionPrototype.call;
|
|
4
|
+
var callBind = bind && bind.bind(call);
|
|
5
|
+
|
|
6
|
+
module.exports = bind ? function (fn) {
|
|
7
|
+
return fn && callBind(call, fn);
|
|
8
|
+
} : function (fn) {
|
|
9
|
+
return fn && function () {
|
|
10
|
+
return call.apply(fn, arguments);
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
var call = require('../internals/function-call');
|
|
1
2
|
var AsyncFromSyncIterator = require('../internals/async-from-sync-iterator');
|
|
2
3
|
var anObject = require('../internals/an-object');
|
|
3
4
|
var getIterator = require('../internals/get-iterator');
|
|
@@ -8,5 +9,5 @@ var ASYNC_ITERATOR = wellKnownSymbol('asyncIterator');
|
|
|
8
9
|
|
|
9
10
|
module.exports = function (it, usingIterator) {
|
|
10
11
|
var method = arguments.length < 2 ? getMethod(it, ASYNC_ITERATOR) : usingIterator;
|
|
11
|
-
return method ? anObject(
|
|
12
|
+
return method ? anObject(call(method, it)) : new AsyncFromSyncIterator(getIterator(it));
|
|
12
13
|
};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
var global = require('../internals/global');
|
|
2
|
+
var call = require('../internals/function-call');
|
|
1
3
|
var aCallable = require('../internals/a-callable');
|
|
2
4
|
var anObject = require('../internals/an-object');
|
|
5
|
+
var tryToString = require('../internals/try-to-string');
|
|
3
6
|
var getIteratorMethod = require('../internals/get-iterator-method');
|
|
4
7
|
|
|
8
|
+
var TypeError = global.TypeError;
|
|
9
|
+
|
|
5
10
|
module.exports = function (argument, usingIterator) {
|
|
6
11
|
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
|
7
|
-
if (aCallable(iteratorMethod)) return anObject(
|
|
8
|
-
throw TypeError(
|
|
12
|
+
if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
|
|
13
|
+
throw TypeError(tryToString(argument) + ' is not iterable');
|
|
9
14
|
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
var uncurryThis = require('../internals/function-uncurry-this');
|
|
1
2
|
var toObject = require('../internals/to-object');
|
|
2
3
|
|
|
3
4
|
var floor = Math.floor;
|
|
4
|
-
var
|
|
5
|
+
var charAt = uncurryThis(''.charAt);
|
|
6
|
+
var replace = uncurryThis(''.replace);
|
|
7
|
+
var stringSlice = uncurryThis(''.slice);
|
|
5
8
|
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
|
6
9
|
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
|
7
10
|
|
|
@@ -15,15 +18,15 @@ module.exports = function (matched, str, position, captures, namedCaptures, repl
|
|
|
15
18
|
namedCaptures = toObject(namedCaptures);
|
|
16
19
|
symbols = SUBSTITUTION_SYMBOLS;
|
|
17
20
|
}
|
|
18
|
-
return replace
|
|
21
|
+
return replace(replacement, symbols, function (match, ch) {
|
|
19
22
|
var capture;
|
|
20
|
-
switch (
|
|
23
|
+
switch (charAt(ch, 0)) {
|
|
21
24
|
case '$': return '$';
|
|
22
25
|
case '&': return matched;
|
|
23
|
-
case '`': return str
|
|
24
|
-
case "'": return str
|
|
26
|
+
case '`': return stringSlice(str, 0, position);
|
|
27
|
+
case "'": return stringSlice(str, tailPos);
|
|
25
28
|
case '<':
|
|
26
|
-
capture = namedCaptures[ch
|
|
29
|
+
capture = namedCaptures[stringSlice(ch, 1, -1)];
|
|
27
30
|
break;
|
|
28
31
|
default: // \d\d?
|
|
29
32
|
var n = +ch;
|
|
@@ -31,7 +34,7 @@ module.exports = function (matched, str, position, captures, namedCaptures, repl
|
|
|
31
34
|
if (n > m) {
|
|
32
35
|
var f = floor(n / 10);
|
|
33
36
|
if (f === 0) return match;
|
|
34
|
-
if (f <= m) return captures[f - 1] === undefined ?
|
|
37
|
+
if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
|
|
35
38
|
return match;
|
|
36
39
|
}
|
|
37
40
|
capture = captures[n - 1];
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
var uncurryThis = require('../internals/function-uncurry-this');
|
|
1
2
|
var toObject = require('../internals/to-object');
|
|
2
3
|
|
|
3
|
-
var hasOwnProperty = {}.hasOwnProperty;
|
|
4
|
+
var hasOwnProperty = uncurryThis({}.hasOwnProperty);
|
|
4
5
|
|
|
5
6
|
// `HasOwnProperty` abstract operation
|
|
6
7
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
7
8
|
module.exports = Object.hasOwn || function hasOwn(it, key) {
|
|
8
|
-
return hasOwnProperty
|
|
9
|
+
return hasOwnProperty(toObject(it), key);
|
|
9
10
|
};
|
|
@@ -3,6 +3,6 @@ var global = require('../internals/global');
|
|
|
3
3
|
module.exports = function (a, b) {
|
|
4
4
|
var console = global.console;
|
|
5
5
|
if (console && console.error) {
|
|
6
|
-
arguments.length
|
|
6
|
+
arguments.length == 1 ? console.error(a) : console.error(a, b);
|
|
7
7
|
}
|
|
8
8
|
};
|
package/internals/ieee754.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// IEEE754 conversions based on https://github.com/feross/ieee754
|
|
2
|
+
var global = require('../internals/global');
|
|
3
|
+
|
|
4
|
+
var Array = global.Array;
|
|
2
5
|
var abs = Math.abs;
|
|
3
6
|
var pow = Math.pow;
|
|
4
7
|
var floor = Math.floor;
|
|
@@ -6,7 +9,7 @@ var log = Math.log;
|
|
|
6
9
|
var LN2 = Math.LN2;
|
|
7
10
|
|
|
8
11
|
var pack = function (number, mantissaLength, bytes) {
|
|
9
|
-
var buffer =
|
|
12
|
+
var buffer = Array(bytes);
|
|
10
13
|
var exponentLength = bytes * 8 - mantissaLength - 1;
|
|
11
14
|
var eMax = (1 << exponentLength) - 1;
|
|
12
15
|
var eBias = eMax >> 1;
|
|
@@ -22,7 +25,8 @@ var pack = function (number, mantissaLength, bytes) {
|
|
|
22
25
|
exponent = eMax;
|
|
23
26
|
} else {
|
|
24
27
|
exponent = floor(log(number) / LN2);
|
|
25
|
-
|
|
28
|
+
c = pow(2, -exponent);
|
|
29
|
+
if (number * c < 1) {
|
|
26
30
|
exponent--;
|
|
27
31
|
c *= 2;
|
|
28
32
|
}
|
|
@@ -46,10 +50,18 @@ var pack = function (number, mantissaLength, bytes) {
|
|
|
46
50
|
exponent = 0;
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
|
-
|
|
53
|
+
while (mantissaLength >= 8) {
|
|
54
|
+
buffer[index++] = mantissa & 255;
|
|
55
|
+
mantissa /= 256;
|
|
56
|
+
mantissaLength -= 8;
|
|
57
|
+
}
|
|
50
58
|
exponent = exponent << mantissaLength | mantissa;
|
|
51
59
|
exponentLength += mantissaLength;
|
|
52
|
-
|
|
60
|
+
while (exponentLength > 0) {
|
|
61
|
+
buffer[index++] = exponent & 255;
|
|
62
|
+
exponent /= 256;
|
|
63
|
+
exponentLength -= 8;
|
|
64
|
+
}
|
|
53
65
|
buffer[--index] |= sign * 128;
|
|
54
66
|
return buffer;
|
|
55
67
|
};
|
|
@@ -65,11 +77,17 @@ var unpack = function (buffer, mantissaLength) {
|
|
|
65
77
|
var exponent = sign & 127;
|
|
66
78
|
var mantissa;
|
|
67
79
|
sign >>= 7;
|
|
68
|
-
|
|
80
|
+
while (nBits > 0) {
|
|
81
|
+
exponent = exponent * 256 + buffer[index--];
|
|
82
|
+
nBits -= 8;
|
|
83
|
+
}
|
|
69
84
|
mantissa = exponent & (1 << -nBits) - 1;
|
|
70
85
|
exponent >>= -nBits;
|
|
71
86
|
nBits += mantissaLength;
|
|
72
|
-
|
|
87
|
+
while (nBits > 0) {
|
|
88
|
+
mantissa = mantissa * 256 + buffer[index--];
|
|
89
|
+
nBits -= 8;
|
|
90
|
+
}
|
|
73
91
|
if (exponent === 0) {
|
|
74
92
|
exponent = 1 - eBias;
|
|
75
93
|
} else if (exponent === eMax) {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
var global = require('../internals/global');
|
|
2
|
+
var uncurryThis = require('../internals/function-uncurry-this');
|
|
1
3
|
var fails = require('../internals/fails');
|
|
2
4
|
var classof = require('../internals/classof-raw');
|
|
3
5
|
|
|
4
|
-
var
|
|
6
|
+
var Object = global.Object;
|
|
7
|
+
var split = uncurryThis(''.split);
|
|
5
8
|
|
|
6
9
|
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
7
10
|
module.exports = fails(function () {
|
|
@@ -9,5 +12,5 @@ module.exports = fails(function () {
|
|
|
9
12
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
10
13
|
return !Object('z').propertyIsEnumerable(0);
|
|
11
14
|
}) ? function (it) {
|
|
12
|
-
return classof(it) == 'String' ? split
|
|
15
|
+
return classof(it) == 'String' ? split(it, '') : Object(it);
|
|
13
16
|
} : Object;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
var uncurryThis = require('../internals/function-uncurry-this');
|
|
1
2
|
var isCallable = require('../internals/is-callable');
|
|
2
3
|
var store = require('../internals/shared-store');
|
|
3
4
|
|
|
4
|
-
var functionToString = Function.toString;
|
|
5
|
+
var functionToString = uncurryThis(Function.toString);
|
|
5
6
|
|
|
6
7
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
7
8
|
if (!isCallable(store.inspectSource)) {
|
|
8
9
|
store.inspectSource = function (it) {
|
|
9
|
-
return functionToString
|
|
10
|
+
return functionToString(it);
|
|
10
11
|
};
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -5,6 +5,6 @@ var createNonEnumerableProperty = require('../internals/create-non-enumerable-pr
|
|
|
5
5
|
// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
|
|
6
6
|
module.exports = function (O, options) {
|
|
7
7
|
if (isObject(options) && 'cause' in options) {
|
|
8
|
-
createNonEnumerableProperty(O, 'cause',
|
|
8
|
+
createNonEnumerableProperty(O, 'cause', options.cause);
|
|
9
9
|
}
|
|
10
10
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
var $ = require('../internals/export');
|
|
2
|
+
var uncurryThis = require('../internals/function-uncurry-this');
|
|
2
3
|
var hiddenKeys = require('../internals/hidden-keys');
|
|
3
4
|
var isObject = require('../internals/is-object');
|
|
4
5
|
var hasOwn = require('../internals/has-own-property');
|
|
5
6
|
var defineProperty = require('../internals/object-define-property').f;
|
|
6
7
|
var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');
|
|
7
8
|
var getOwnPropertyNamesExternalModule = require('../internals/object-get-own-property-names-external');
|
|
9
|
+
var isExtensible = require('../internals/object-is-extensible');
|
|
8
10
|
var uid = require('../internals/uid');
|
|
9
11
|
var FREEZING = require('../internals/freezing');
|
|
10
12
|
|
|
@@ -12,11 +14,6 @@ var REQUIRED = false;
|
|
|
12
14
|
var METADATA = uid('meta');
|
|
13
15
|
var id = 0;
|
|
14
16
|
|
|
15
|
-
// eslint-disable-next-line es/no-object-isextensible -- safe
|
|
16
|
-
var isExtensible = Object.isExtensible || function () {
|
|
17
|
-
return true;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
17
|
var setMetadata = function (it) {
|
|
21
18
|
defineProperty(it, METADATA, { value: {
|
|
22
19
|
objectID: 'O' + id++, // object ID
|
|
@@ -60,7 +57,7 @@ var enable = function () {
|
|
|
60
57
|
meta.enable = function () { /* empty */ };
|
|
61
58
|
REQUIRED = true;
|
|
62
59
|
var getOwnPropertyNames = getOwnPropertyNamesModule.f;
|
|
63
|
-
var splice = [].splice;
|
|
60
|
+
var splice = uncurryThis([].splice);
|
|
64
61
|
var test = {};
|
|
65
62
|
test[METADATA] = 1;
|
|
66
63
|
|
|
@@ -70,7 +67,7 @@ var enable = function () {
|
|
|
70
67
|
var result = getOwnPropertyNames(it);
|
|
71
68
|
for (var i = 0, length = result.length; i < length; i++) {
|
|
72
69
|
if (result[i] === METADATA) {
|
|
73
|
-
splice
|
|
70
|
+
splice(result, i, 1);
|
|
74
71
|
break;
|
|
75
72
|
}
|
|
76
73
|
} return result;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
var NATIVE_WEAK_MAP = require('../internals/native-weak-map');
|
|
2
2
|
var global = require('../internals/global');
|
|
3
|
+
var uncurryThis = require('../internals/function-uncurry-this');
|
|
3
4
|
var isObject = require('../internals/is-object');
|
|
4
5
|
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
5
6
|
var hasOwn = require('../internals/has-own-property');
|
|
@@ -8,6 +9,7 @@ var sharedKey = require('../internals/shared-key');
|
|
|
8
9
|
var hiddenKeys = require('../internals/hidden-keys');
|
|
9
10
|
|
|
10
11
|
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
12
|
+
var TypeError = global.TypeError;
|
|
11
13
|
var WeakMap = global.WeakMap;
|
|
12
14
|
var set, get, has;
|
|
13
15
|
|
|
@@ -26,20 +28,20 @@ var getterFor = function (TYPE) {
|
|
|
26
28
|
|
|
27
29
|
if (NATIVE_WEAK_MAP || shared.state) {
|
|
28
30
|
var store = shared.state || (shared.state = new WeakMap());
|
|
29
|
-
var wmget = store.get;
|
|
30
|
-
var wmhas = store.has;
|
|
31
|
-
var wmset = store.set;
|
|
31
|
+
var wmget = uncurryThis(store.get);
|
|
32
|
+
var wmhas = uncurryThis(store.has);
|
|
33
|
+
var wmset = uncurryThis(store.set);
|
|
32
34
|
set = function (it, metadata) {
|
|
33
|
-
if (wmhas
|
|
35
|
+
if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
|
34
36
|
metadata.facade = it;
|
|
35
|
-
wmset
|
|
37
|
+
wmset(store, it, metadata);
|
|
36
38
|
return metadata;
|
|
37
39
|
};
|
|
38
40
|
get = function (it) {
|
|
39
|
-
return wmget
|
|
41
|
+
return wmget(store, it) || {};
|
|
40
42
|
};
|
|
41
43
|
has = function (it) {
|
|
42
|
-
return wmhas
|
|
44
|
+
return wmhas(store, it);
|
|
43
45
|
};
|
|
44
46
|
} else {
|
|
45
47
|
var STATE = sharedKey('state');
|
package/internals/is-callable.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
+
var uncurryThis = require('../internals/function-uncurry-this');
|
|
1
2
|
var fails = require('../internals/fails');
|
|
2
3
|
var isCallable = require('../internals/is-callable');
|
|
3
4
|
var classof = require('../internals/classof');
|
|
4
5
|
var getBuiltIn = require('../internals/get-built-in');
|
|
5
6
|
var inspectSource = require('../internals/inspect-source');
|
|
6
7
|
|
|
8
|
+
var noop = function () { /* empty */ };
|
|
7
9
|
var empty = [];
|
|
8
10
|
var construct = getBuiltIn('Reflect', 'construct');
|
|
9
11
|
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
10
|
-
var exec = constructorRegExp.exec;
|
|
11
|
-
var INCORRECT_TO_STRING = !constructorRegExp.exec(
|
|
12
|
+
var exec = uncurryThis(constructorRegExp.exec);
|
|
13
|
+
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
|
12
14
|
|
|
13
15
|
var isConstructorModern = function (argument) {
|
|
14
16
|
if (!isCallable(argument)) return false;
|
|
15
17
|
try {
|
|
16
|
-
construct(
|
|
18
|
+
construct(noop, empty, argument);
|
|
17
19
|
return true;
|
|
18
20
|
} catch (error) {
|
|
19
21
|
return false;
|
|
@@ -27,7 +29,7 @@ var isConstructorLegacy = function (argument) {
|
|
|
27
29
|
case 'GeneratorFunction':
|
|
28
30
|
case 'AsyncGeneratorFunction': return false;
|
|
29
31
|
// we can't check .prototype since constructors produced by .bind haven't it
|
|
30
|
-
} return INCORRECT_TO_STRING || !!exec
|
|
32
|
+
} return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
// `IsConstructor` abstract operation
|
package/internals/is-iterable.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
var global = require('../internals/global');
|
|
1
2
|
var classof = require('../internals/classof');
|
|
3
|
+
var hasOwn = require('../internals/has-own-property');
|
|
2
4
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
3
5
|
var Iterators = require('../internals/iterators');
|
|
4
6
|
|
|
5
7
|
var ITERATOR = wellKnownSymbol('iterator');
|
|
8
|
+
var Object = global.Object;
|
|
6
9
|
|
|
7
10
|
module.exports = function (it) {
|
|
8
11
|
var O = Object(it);
|
|
9
12
|
return O[ITERATOR] !== undefined
|
|
10
13
|
|| '@@iterator' in O
|
|
11
|
-
|
|
12
|
-
|| Iterators.hasOwnProperty(classof(O));
|
|
14
|
+
|| hasOwn(Iterators, classof(O));
|
|
13
15
|
};
|
package/internals/is-object.js
CHANGED
package/internals/is-symbol.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
var
|
|
1
|
+
var global = require('../internals/global');
|
|
2
2
|
var getBuiltIn = require('../internals/get-built-in');
|
|
3
|
+
var isCallable = require('../internals/is-callable');
|
|
4
|
+
var isPrototypeOf = require('../internals/object-is-prototype-of');
|
|
3
5
|
var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');
|
|
4
6
|
|
|
7
|
+
var Object = global.Object;
|
|
8
|
+
|
|
5
9
|
module.exports = USE_SYMBOL_AS_UID ? function (it) {
|
|
6
10
|
return typeof it == 'symbol';
|
|
7
11
|
} : function (it) {
|
|
8
12
|
var $Symbol = getBuiltIn('Symbol');
|
|
9
|
-
return isCallable($Symbol) && Object(it)
|
|
13
|
+
return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, Object(it));
|
|
10
14
|
};
|