core-js 3.9.0 → 3.10.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/index.js +96 -97
- package/es/json/index.js +1 -0
- package/es/json/stringify.js +1 -0
- package/features/index.js +353 -2
- package/index.js +1 -6
- package/internals/array-buffer-native.js +1 -0
- package/internals/array-buffer.js +3 -3
- package/internals/array-copy-within.js +1 -0
- package/internals/array-for-each.js +1 -0
- package/internals/array-last-index-of.js +5 -4
- package/internals/check-correctness-of-iteration.js +1 -1
- package/internals/correct-prototype-getter.js +1 -0
- package/internals/descriptors.js +1 -0
- package/internals/engine-is-ios.js +1 -1
- package/internals/fix-regexp-well-known-symbol-logic.js +2 -2
- package/internals/freezing.js +1 -0
- package/internals/get-map-iterator.js +1 -1
- package/internals/get-set-iterator.js +1 -1
- package/internals/get-substitution.js +2 -2
- package/internals/global.js +2 -1
- package/internals/ie8-dom-define.js +1 -0
- package/internals/internal-metadata.js +1 -0
- package/internals/internal-state.js +3 -0
- package/internals/is-array.js +1 -0
- package/internals/iterators-core.js +1 -0
- package/internals/math-expm1.js +6 -5
- package/internals/math-fround.js +1 -0
- package/internals/math-log1p.js +1 -0
- package/internals/math-sign.js +1 -0
- package/internals/native-symbol.js +8 -3
- package/internals/number-is-finite.js +1 -0
- package/internals/{range-iterator.js → numeric-range-iterator.js} +5 -5
- package/internals/object-assign.js +8 -6
- package/internals/object-define-properties.js +1 -0
- package/internals/object-define-property.js +4 -3
- package/internals/object-get-own-property-descriptor.js +4 -3
- package/internals/object-get-own-property-names-external.js +4 -3
- package/internals/object-get-own-property-names.js +1 -0
- package/internals/object-get-own-property-symbols.js +1 -0
- package/internals/object-get-prototype-of.js +1 -0
- package/internals/object-keys.js +1 -0
- package/internals/object-property-is-enumerable.js +4 -3
- package/internals/object-set-prototype-of.js +2 -0
- package/internals/regexp-exec.js +3 -5
- package/internals/same-value.js +1 -0
- package/internals/shared.js +1 -1
- package/internals/string-pad-webkit-bug.js +1 -1
- package/internals/string-repeat.js +1 -1
- package/internals/use-symbol-as-uid.js +1 -1
- package/internals/well-known-symbol.js +6 -3
- package/modules/es.array.for-each.js +1 -0
- package/modules/es.array.from.js +1 -0
- package/modules/es.array.index-of.js +1 -0
- package/modules/es.array.last-index-of.js +1 -0
- package/modules/es.array.of.js +1 -0
- package/modules/es.math.acosh.js +5 -4
- package/modules/es.math.asinh.js +3 -2
- package/modules/es.math.atanh.js +3 -2
- package/modules/es.math.cosh.js +3 -2
- package/modules/es.math.expm1.js +1 -0
- package/modules/es.math.hypot.js +1 -0
- package/modules/es.math.imul.js +3 -2
- package/modules/es.math.sinh.js +1 -0
- package/modules/es.number.parse-float.js +1 -0
- package/modules/es.number.parse-int.js +1 -0
- package/modules/es.object.assign.js +1 -0
- package/modules/es.object.freeze.js +4 -3
- package/modules/es.object.get-own-property-names.js +3 -2
- package/modules/es.object.is-extensible.js +4 -3
- package/modules/es.object.is-frozen.js +4 -3
- package/modules/es.object.is-sealed.js +4 -3
- package/modules/es.object.prevent-extensions.js +4 -3
- package/modules/es.object.seal.js +4 -3
- package/modules/es.reflect.define-property.js +1 -1
- package/modules/es.reflect.is-extensible.js +1 -0
- package/modules/es.reflect.set.js +1 -1
- package/modules/es.regexp.flags.js +1 -0
- package/modules/es.string.ends-with.js +4 -3
- package/modules/es.string.from-code-point.js +3 -2
- package/modules/es.string.match-all.js +1 -0
- package/modules/es.string.split.js +8 -10
- package/modules/es.string.starts-with.js +4 -3
- package/modules/es.string.trim-end.js +1 -0
- package/modules/es.string.trim-start.js +1 -0
- package/modules/es.typed-array.set.js +1 -1
- package/modules/es.typed-array.slice.js +1 -1
- package/modules/es.weak-map.js +1 -0
- package/modules/esnext.array.is-template-object.js +1 -0
- package/modules/esnext.bigint.range.js +3 -3
- package/modules/esnext.number.range.js +2 -2
- package/modules/esnext.observable.js +7 -8
- package/modules/web.url.js +1 -1
- package/package.json +4 -3
- package/stable/index.js +220 -4
- package/stage/1.js +0 -1
- package/stage/2.js +1 -0
package/index.js
CHANGED
|
@@ -206,15 +206,15 @@ if (!NATIVE_ARRAY_BUFFER) {
|
|
|
206
206
|
|
|
207
207
|
// iOS Safari 7.x bug
|
|
208
208
|
var testView = new $DataView(new $ArrayBuffer(2));
|
|
209
|
-
var
|
|
209
|
+
var $setInt8 = $DataViewPrototype.setInt8;
|
|
210
210
|
testView.setInt8(0, 2147483648);
|
|
211
211
|
testView.setInt8(1, 2147483649);
|
|
212
212
|
if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll($DataViewPrototype, {
|
|
213
213
|
setInt8: function setInt8(byteOffset, value) {
|
|
214
|
-
|
|
214
|
+
$setInt8.call(this, byteOffset, value << 24 >> 24);
|
|
215
215
|
},
|
|
216
216
|
setUint8: function setUint8(byteOffset, value) {
|
|
217
|
-
|
|
217
|
+
$setInt8.call(this, byteOffset, value << 24 >> 24);
|
|
218
218
|
}
|
|
219
219
|
}, { unsafe: true });
|
|
220
220
|
}
|
|
@@ -7,6 +7,7 @@ var min = Math.min;
|
|
|
7
7
|
|
|
8
8
|
// `Array.prototype.copyWithin` method implementation
|
|
9
9
|
// https://tc39.es/ecma262/#sec-array.prototype.copywithin
|
|
10
|
+
// eslint-disable-next-line es/no-array-prototype-copywithin -- safe
|
|
10
11
|
module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
|
|
11
12
|
var O = toObject(this);
|
|
12
13
|
var len = toLength(O.length);
|
|
@@ -8,4 +8,5 @@ var STRICT_METHOD = arrayMethodIsStrict('forEach');
|
|
|
8
8
|
// https://tc39.es/ecma262/#sec-array.prototype.foreach
|
|
9
9
|
module.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
|
|
10
10
|
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
11
|
+
// eslint-disable-next-line es/no-array-prototype-foreach -- safe
|
|
11
12
|
} : [].forEach;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
+
/* eslint-disable es/no-array-prototype-lastindexof -- safe */
|
|
2
3
|
var toIndexedObject = require('../internals/to-indexed-object');
|
|
3
4
|
var toInteger = require('../internals/to-integer');
|
|
4
5
|
var toLength = require('../internals/to-length');
|
|
5
6
|
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
|
|
6
7
|
|
|
7
8
|
var min = Math.min;
|
|
8
|
-
var
|
|
9
|
-
var NEGATIVE_ZERO =
|
|
9
|
+
var $lastIndexOf = [].lastIndexOf;
|
|
10
|
+
var NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
|
|
10
11
|
var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
|
|
11
12
|
var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;
|
|
12
13
|
|
|
@@ -14,7 +15,7 @@ var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;
|
|
|
14
15
|
// https://tc39.es/ecma262/#sec-array.prototype.lastindexof
|
|
15
16
|
module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
|
|
16
17
|
// convert -0 to +0
|
|
17
|
-
if (NEGATIVE_ZERO) return
|
|
18
|
+
if (NEGATIVE_ZERO) return $lastIndexOf.apply(this, arguments) || 0;
|
|
18
19
|
var O = toIndexedObject(this);
|
|
19
20
|
var length = toLength(O.length);
|
|
20
21
|
var index = length - 1;
|
|
@@ -22,4 +23,4 @@ module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[
|
|
|
22
23
|
if (index < 0) index = length + index;
|
|
23
24
|
for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;
|
|
24
25
|
return -1;
|
|
25
|
-
} :
|
|
26
|
+
} : $lastIndexOf;
|
|
@@ -16,7 +16,7 @@ try {
|
|
|
16
16
|
iteratorWithReturn[ITERATOR] = function () {
|
|
17
17
|
return this;
|
|
18
18
|
};
|
|
19
|
-
// eslint-disable-next-line no-throw-literal -- required for testing
|
|
19
|
+
// eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
|
|
20
20
|
Array.from(iteratorWithReturn, function () { throw 2; });
|
|
21
21
|
} catch (error) { /* empty */ }
|
|
22
22
|
|
|
@@ -3,5 +3,6 @@ var fails = require('../internals/fails');
|
|
|
3
3
|
module.exports = !fails(function () {
|
|
4
4
|
function F() { /* empty */ }
|
|
5
5
|
F.prototype.constructor = null;
|
|
6
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
6
7
|
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
7
8
|
});
|
package/internals/descriptors.js
CHANGED
|
@@ -2,5 +2,6 @@ var fails = require('../internals/fails');
|
|
|
2
2
|
|
|
3
3
|
// Detect IE8's incomplete defineProperty implementation
|
|
4
4
|
module.exports = !fails(function () {
|
|
5
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
5
6
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
6
7
|
});
|
|
@@ -4,7 +4,6 @@ require('../modules/es.regexp.exec');
|
|
|
4
4
|
var redefine = require('../internals/redefine');
|
|
5
5
|
var fails = require('../internals/fails');
|
|
6
6
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
7
|
-
var regexpExec = require('../internals/regexp-exec');
|
|
8
7
|
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
9
8
|
|
|
10
9
|
var SPECIES = wellKnownSymbol('species');
|
|
@@ -25,6 +24,7 @@ var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
|
|
25
24
|
// IE <= 11 replaces $0 with the whole match, as if it was $&
|
|
26
25
|
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
|
|
27
26
|
var REPLACE_KEEPS_$0 = (function () {
|
|
27
|
+
// eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
|
|
28
28
|
return 'a'.replace(/./, '$0') === '$0';
|
|
29
29
|
})();
|
|
30
30
|
|
|
@@ -94,7 +94,7 @@ module.exports = function (KEY, length, exec, sham) {
|
|
|
94
94
|
) {
|
|
95
95
|
var nativeRegExpMethod = /./[SYMBOL];
|
|
96
96
|
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
|
97
|
-
if (regexp.exec ===
|
|
97
|
+
if (regexp.exec === RegExp.prototype.exec) {
|
|
98
98
|
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
|
99
99
|
// The native String method already delegates to @@method (this
|
|
100
100
|
// polyfilled function), leasing to infinite recursion.
|
package/internals/freezing.js
CHANGED
|
@@ -2,6 +2,6 @@ var IS_PURE = require('../internals/is-pure');
|
|
|
2
2
|
var getIterator = require('../internals/get-iterator');
|
|
3
3
|
|
|
4
4
|
module.exports = IS_PURE ? getIterator : function (it) {
|
|
5
|
-
// eslint-disable-next-line no-
|
|
5
|
+
// eslint-disable-next-line es/no-map -- safe
|
|
6
6
|
return Map.prototype.entries.call(it);
|
|
7
7
|
};
|
|
@@ -2,6 +2,6 @@ var IS_PURE = require('../internals/is-pure');
|
|
|
2
2
|
var getIterator = require('../internals/get-iterator');
|
|
3
3
|
|
|
4
4
|
module.exports = IS_PURE ? getIterator : function (it) {
|
|
5
|
-
// eslint-disable-next-line no-
|
|
5
|
+
// eslint-disable-next-line es/no-set -- safe
|
|
6
6
|
return Set.prototype.values.call(it);
|
|
7
7
|
};
|
|
@@ -2,8 +2,8 @@ var toObject = require('../internals/to-object');
|
|
|
2
2
|
|
|
3
3
|
var floor = Math.floor;
|
|
4
4
|
var replace = ''.replace;
|
|
5
|
-
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d
|
|
6
|
-
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d
|
|
5
|
+
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
|
6
|
+
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
|
7
7
|
|
|
8
8
|
// https://tc39.es/ecma262/#sec-getsubstitution
|
|
9
9
|
module.exports = function (matched, str, position, captures, namedCaptures, replacement) {
|
package/internals/global.js
CHANGED
|
@@ -4,9 +4,10 @@ var check = function (it) {
|
|
|
4
4
|
|
|
5
5
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
6
6
|
module.exports =
|
|
7
|
-
|
|
7
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
8
8
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
9
9
|
check(typeof window == 'object' && window) ||
|
|
10
|
+
// eslint-disable-next-line no-restricted-globals -- safe
|
|
10
11
|
check(typeof self == 'object' && self) ||
|
|
11
12
|
check(typeof global == 'object' && global) ||
|
|
12
13
|
// eslint-disable-next-line no-new-func -- fallback
|
|
@@ -4,6 +4,7 @@ var createElement = require('../internals/document-create-element');
|
|
|
4
4
|
|
|
5
5
|
// Thank's IE8 for his funny defineProperty
|
|
6
6
|
module.exports = !DESCRIPTORS && !fails(function () {
|
|
7
|
+
// eslint-disable-next-line es/no-object-defineproperty -- requied for testing
|
|
7
8
|
return Object.defineProperty(createElement('div'), 'a', {
|
|
8
9
|
get: function () { return 7; }
|
|
9
10
|
}).a != 7;
|
|
@@ -7,6 +7,7 @@ var shared = require('../internals/shared-store');
|
|
|
7
7
|
var sharedKey = require('../internals/shared-key');
|
|
8
8
|
var hiddenKeys = require('../internals/hidden-keys');
|
|
9
9
|
|
|
10
|
+
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
10
11
|
var WeakMap = global.WeakMap;
|
|
11
12
|
var set, get, has;
|
|
12
13
|
|
|
@@ -29,6 +30,7 @@ if (NATIVE_WEAK_MAP) {
|
|
|
29
30
|
var wmhas = store.has;
|
|
30
31
|
var wmset = store.set;
|
|
31
32
|
set = function (it, metadata) {
|
|
33
|
+
if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
|
32
34
|
metadata.facade = it;
|
|
33
35
|
wmset.call(store, it, metadata);
|
|
34
36
|
return metadata;
|
|
@@ -43,6 +45,7 @@ if (NATIVE_WEAK_MAP) {
|
|
|
43
45
|
var STATE = sharedKey('state');
|
|
44
46
|
hiddenKeys[STATE] = true;
|
|
45
47
|
set = function (it, metadata) {
|
|
48
|
+
if (objectHas(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
|
46
49
|
metadata.facade = it;
|
|
47
50
|
createNonEnumerableProperty(it, STATE, metadata);
|
|
48
51
|
return metadata;
|
package/internals/is-array.js
CHANGED
|
@@ -2,6 +2,7 @@ var classof = require('../internals/classof-raw');
|
|
|
2
2
|
|
|
3
3
|
// `IsArray` abstract operation
|
|
4
4
|
// https://tc39.es/ecma262/#sec-isarray
|
|
5
|
+
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
5
6
|
module.exports = Array.isArray || function isArray(arg) {
|
|
6
7
|
return classof(arg) == 'Array';
|
|
7
8
|
};
|
|
@@ -15,6 +15,7 @@ var returnThis = function () { return this; };
|
|
|
15
15
|
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
|
16
16
|
var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
|
17
17
|
|
|
18
|
+
/* eslint-disable es/no-array-prototype-keys -- safe */
|
|
18
19
|
if ([].keys) {
|
|
19
20
|
arrayIterator = [].keys();
|
|
20
21
|
// Safari 8 has buggy iterators w/o `next`
|
package/internals/math-expm1.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
// eslint-disable-next-line es/no-math-expm1 -- safe
|
|
2
|
+
var $expm1 = Math.expm1;
|
|
2
3
|
var exp = Math.exp;
|
|
3
4
|
|
|
4
5
|
// `Math.expm1` method implementation
|
|
5
6
|
// https://tc39.es/ecma262/#sec-math.expm1
|
|
6
|
-
module.exports = (
|
|
7
|
+
module.exports = (!$expm1
|
|
7
8
|
// Old FF bug
|
|
8
|
-
||
|
|
9
|
+
|| $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
|
|
9
10
|
// Tor Browser bug
|
|
10
|
-
||
|
|
11
|
+
|| $expm1(-2e-17) != -2e-17
|
|
11
12
|
) ? function expm1(x) {
|
|
12
13
|
return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1;
|
|
13
|
-
} :
|
|
14
|
+
} : $expm1;
|
package/internals/math-fround.js
CHANGED
|
@@ -13,6 +13,7 @@ var roundTiesToEven = function (n) {
|
|
|
13
13
|
|
|
14
14
|
// `Math.fround` method implementation
|
|
15
15
|
// https://tc39.es/ecma262/#sec-math.fround
|
|
16
|
+
// eslint-disable-next-line es/no-math-fround -- safe
|
|
16
17
|
module.exports = Math.fround || function fround(x) {
|
|
17
18
|
var $abs = abs(x);
|
|
18
19
|
var $sign = sign(x);
|
package/internals/math-log1p.js
CHANGED
|
@@ -2,6 +2,7 @@ var log = Math.log;
|
|
|
2
2
|
|
|
3
3
|
// `Math.log1p` method implementation
|
|
4
4
|
// https://tc39.es/ecma262/#sec-math.log1p
|
|
5
|
+
// eslint-disable-next-line es/no-math-log1p -- safe
|
|
5
6
|
module.exports = Math.log1p || function log1p(x) {
|
|
6
7
|
return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x);
|
|
7
8
|
};
|
package/internals/math-sign.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// `Math.sign` method implementation
|
|
2
2
|
// https://tc39.es/ecma262/#sec-math.sign
|
|
3
|
+
// eslint-disable-next-line es/no-math-sign -- safe
|
|
3
4
|
module.exports = Math.sign || function sign(x) {
|
|
4
5
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
5
6
|
return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
var IS_NODE = require('../internals/engine-is-node');
|
|
2
|
+
var V8_VERSION = require('../internals/engine-v8-version');
|
|
1
3
|
var fails = require('../internals/fails');
|
|
2
4
|
|
|
5
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
3
6
|
module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
// eslint-disable-next-line es/no-symbol -- required for testing
|
|
8
|
+
return !Symbol.sham &&
|
|
9
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
|
10
|
+
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
11
|
+
(IS_NODE ? V8_VERSION === 38 : V8_VERSION > 37 && V8_VERSION < 41);
|
|
7
12
|
});
|
|
@@ -4,6 +4,7 @@ var globalIsFinite = global.isFinite;
|
|
|
4
4
|
|
|
5
5
|
// `Number.isFinite` method
|
|
6
6
|
// https://tc39.es/ecma262/#sec-number.isfinite
|
|
7
|
+
// eslint-disable-next-line es/no-number-isfinite -- safe
|
|
7
8
|
module.exports = Number.isFinite || function isFinite(it) {
|
|
8
9
|
return typeof it == 'number' && globalIsFinite(it);
|
|
9
10
|
};
|
|
@@ -6,12 +6,12 @@ var defineProperties = require('../internals/object-define-properties');
|
|
|
6
6
|
var DESCRIPTORS = require('../internals/descriptors');
|
|
7
7
|
|
|
8
8
|
var INCORRECT_RANGE = 'Incorrect Number.range arguments';
|
|
9
|
-
var
|
|
9
|
+
var NUMERIC_RANGE_ITERATOR = 'NumericRangeIterator';
|
|
10
10
|
|
|
11
11
|
var setInternalState = InternalStateModule.set;
|
|
12
|
-
var getInternalState = InternalStateModule.getterFor(
|
|
12
|
+
var getInternalState = InternalStateModule.getterFor(NUMERIC_RANGE_ITERATOR);
|
|
13
13
|
|
|
14
|
-
var $RangeIterator = createIteratorConstructor(function
|
|
14
|
+
var $RangeIterator = createIteratorConstructor(function NumericRangeIterator(start, end, option, type, zero, one) {
|
|
15
15
|
if (typeof start != type || (end !== Infinity && end !== -Infinity && typeof end != type)) {
|
|
16
16
|
throw new TypeError(INCORRECT_RANGE);
|
|
17
17
|
}
|
|
@@ -43,7 +43,7 @@ var $RangeIterator = createIteratorConstructor(function RangeIterator(start, end
|
|
|
43
43
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
44
44
|
var hitsEnd = start != start || end != end || step != step || (end > start) !== (step > zero);
|
|
45
45
|
setInternalState(this, {
|
|
46
|
-
type:
|
|
46
|
+
type: NUMERIC_RANGE_ITERATOR,
|
|
47
47
|
start: start,
|
|
48
48
|
end: end,
|
|
49
49
|
step: step,
|
|
@@ -58,7 +58,7 @@ var $RangeIterator = createIteratorConstructor(function RangeIterator(start, end
|
|
|
58
58
|
this.step = step;
|
|
59
59
|
this.inclusive = inclusiveEnd;
|
|
60
60
|
}
|
|
61
|
-
},
|
|
61
|
+
}, NUMERIC_RANGE_ITERATOR, function next() {
|
|
62
62
|
var state = getInternalState(this);
|
|
63
63
|
if (state.hitsEnd) return { value: undefined, done: true };
|
|
64
64
|
var start = state.start;
|
|
@@ -7,14 +7,16 @@ var propertyIsEnumerableModule = require('../internals/object-property-is-enumer
|
|
|
7
7
|
var toObject = require('../internals/to-object');
|
|
8
8
|
var IndexedObject = require('../internals/indexed-object');
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// eslint-disable-next-line es/no-object-assign -- safe
|
|
11
|
+
var $assign = Object.assign;
|
|
12
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
11
13
|
var defineProperty = Object.defineProperty;
|
|
12
14
|
|
|
13
15
|
// `Object.assign` method
|
|
14
16
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
15
|
-
module.exports =
|
|
17
|
+
module.exports = !$assign || fails(function () {
|
|
16
18
|
// should have correct order of operations (Edge bug)
|
|
17
|
-
if (DESCRIPTORS &&
|
|
19
|
+
if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
|
|
18
20
|
enumerable: true,
|
|
19
21
|
get: function () {
|
|
20
22
|
defineProperty(this, 'b', {
|
|
@@ -26,12 +28,12 @@ module.exports = !nativeAssign || fails(function () {
|
|
|
26
28
|
// should work with symbols and should have deterministic property order (V8 bug)
|
|
27
29
|
var A = {};
|
|
28
30
|
var B = {};
|
|
29
|
-
|
|
31
|
+
// eslint-disable-next-line es/no-symbol -- safe
|
|
30
32
|
var symbol = Symbol();
|
|
31
33
|
var alphabet = 'abcdefghijklmnopqrst';
|
|
32
34
|
A[symbol] = 7;
|
|
33
35
|
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
|
34
|
-
return
|
|
36
|
+
return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
|
|
35
37
|
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
|
|
36
38
|
var T = toObject(target);
|
|
37
39
|
var argumentsLength = arguments.length;
|
|
@@ -49,4 +51,4 @@ module.exports = !nativeAssign || fails(function () {
|
|
|
49
51
|
if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];
|
|
50
52
|
}
|
|
51
53
|
} return T;
|
|
52
|
-
} :
|
|
54
|
+
} : $assign;
|
|
@@ -5,6 +5,7 @@ var objectKeys = require('../internals/object-keys');
|
|
|
5
5
|
|
|
6
6
|
// `Object.defineProperties` method
|
|
7
7
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
8
|
+
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
8
9
|
module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
9
10
|
anObject(O);
|
|
10
11
|
var keys = objectKeys(Properties);
|
|
@@ -3,16 +3,17 @@ var IE8_DOM_DEFINE = require('../internals/ie8-dom-define');
|
|
|
3
3
|
var anObject = require('../internals/an-object');
|
|
4
4
|
var toPrimitive = require('../internals/to-primitive');
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
7
|
+
var $defineProperty = Object.defineProperty;
|
|
7
8
|
|
|
8
9
|
// `Object.defineProperty` method
|
|
9
10
|
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
10
|
-
exports.f = DESCRIPTORS ?
|
|
11
|
+
exports.f = DESCRIPTORS ? $defineProperty : function defineProperty(O, P, Attributes) {
|
|
11
12
|
anObject(O);
|
|
12
13
|
P = toPrimitive(P, true);
|
|
13
14
|
anObject(Attributes);
|
|
14
15
|
if (IE8_DOM_DEFINE) try {
|
|
15
|
-
return
|
|
16
|
+
return $defineProperty(O, P, Attributes);
|
|
16
17
|
} catch (error) { /* empty */ }
|
|
17
18
|
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
|
18
19
|
if ('value' in Attributes) O[P] = Attributes.value;
|
|
@@ -6,15 +6,16 @@ var toPrimitive = require('../internals/to-primitive');
|
|
|
6
6
|
var has = require('../internals/has');
|
|
7
7
|
var IE8_DOM_DEFINE = require('../internals/ie8-dom-define');
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
10
|
+
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
10
11
|
|
|
11
12
|
// `Object.getOwnPropertyDescriptor` method
|
|
12
13
|
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
13
|
-
exports.f = DESCRIPTORS ?
|
|
14
|
+
exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
|
14
15
|
O = toIndexedObject(O);
|
|
15
16
|
P = toPrimitive(P, true);
|
|
16
17
|
if (IE8_DOM_DEFINE) try {
|
|
17
|
-
return
|
|
18
|
+
return $getOwnPropertyDescriptor(O, P);
|
|
18
19
|
} catch (error) { /* empty */ }
|
|
19
20
|
if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
|
|
20
21
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/* eslint-disable es/no-object-getownpropertynames -- safe */
|
|
1
2
|
var toIndexedObject = require('../internals/to-indexed-object');
|
|
2
|
-
var
|
|
3
|
+
var $getOwnPropertyNames = require('../internals/object-get-own-property-names').f;
|
|
3
4
|
|
|
4
5
|
var toString = {}.toString;
|
|
5
6
|
|
|
@@ -8,7 +9,7 @@ var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNa
|
|
|
8
9
|
|
|
9
10
|
var getWindowNames = function (it) {
|
|
10
11
|
try {
|
|
11
|
-
return
|
|
12
|
+
return $getOwnPropertyNames(it);
|
|
12
13
|
} catch (error) {
|
|
13
14
|
return windowNames.slice();
|
|
14
15
|
}
|
|
@@ -18,5 +19,5 @@ var getWindowNames = function (it) {
|
|
|
18
19
|
module.exports.f = function getOwnPropertyNames(it) {
|
|
19
20
|
return windowNames && toString.call(it) == '[object Window]'
|
|
20
21
|
? getWindowNames(it)
|
|
21
|
-
:
|
|
22
|
+
: $getOwnPropertyNames(toIndexedObject(it));
|
|
22
23
|
};
|
|
@@ -5,6 +5,7 @@ var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
|
|
5
5
|
|
|
6
6
|
// `Object.getOwnPropertyNames` method
|
|
7
7
|
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
8
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
8
9
|
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
9
10
|
return internalObjectKeys(O, hiddenKeys);
|
|
10
11
|
};
|
|
@@ -8,6 +8,7 @@ var ObjectPrototype = Object.prototype;
|
|
|
8
8
|
|
|
9
9
|
// `Object.getPrototypeOf` method
|
|
10
10
|
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
11
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
11
12
|
module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
|
|
12
13
|
O = toObject(O);
|
|
13
14
|
if (has(O, IE_PROTO)) return O[IE_PROTO];
|
package/internals/object-keys.js
CHANGED
|
@@ -3,6 +3,7 @@ var enumBugKeys = require('../internals/enum-bug-keys');
|
|
|
3
3
|
|
|
4
4
|
// `Object.keys` method
|
|
5
5
|
// https://tc39.es/ecma262/#sec-object.keys
|
|
6
|
+
// eslint-disable-next-line es/no-object-keys -- safe
|
|
6
7
|
module.exports = Object.keys || function keys(O) {
|
|
7
8
|
return internalObjectKeys(O, enumBugKeys);
|
|
8
9
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
var
|
|
2
|
+
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
3
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
3
4
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
4
5
|
|
|
5
6
|
// Nashorn ~ JDK8 bug
|
|
6
|
-
var NASHORN_BUG = getOwnPropertyDescriptor &&
|
|
7
|
+
var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
7
8
|
|
|
8
9
|
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
9
10
|
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
10
11
|
exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
11
12
|
var descriptor = getOwnPropertyDescriptor(this, V);
|
|
12
13
|
return !!descriptor && descriptor.enumerable;
|
|
13
|
-
} :
|
|
14
|
+
} : $propertyIsEnumerable;
|
|
@@ -5,11 +5,13 @@ var aPossiblePrototype = require('../internals/a-possible-prototype');
|
|
|
5
5
|
// `Object.setPrototypeOf` method
|
|
6
6
|
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
7
7
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
8
|
+
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
8
9
|
module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
9
10
|
var CORRECT_SETTER = false;
|
|
10
11
|
var test = {};
|
|
11
12
|
var setter;
|
|
12
13
|
try {
|
|
14
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
13
15
|
setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
|
|
14
16
|
setter.call(test, []);
|
|
15
17
|
CORRECT_SETTER = test instanceof Array;
|
package/internals/regexp-exec.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var regexpFlags = require('./regexp-flags');
|
|
3
3
|
var stickyHelpers = require('./regexp-sticky-helpers');
|
|
4
|
+
var shared = require('./shared');
|
|
4
5
|
|
|
5
6
|
var nativeExec = RegExp.prototype.exec;
|
|
6
|
-
|
|
7
|
-
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
|
|
8
|
-
// which loads this file before patching the method.
|
|
9
|
-
var nativeReplace = String.prototype.replace;
|
|
7
|
+
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
10
8
|
|
|
11
9
|
var patchedExec = nativeExec;
|
|
12
10
|
|
|
@@ -21,7 +19,7 @@ var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
|
21
19
|
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
|
|
22
20
|
|
|
23
21
|
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
|
24
|
-
// eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group --
|
|
22
|
+
// eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing
|
|
25
23
|
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
|
26
24
|
|
|
27
25
|
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
|
package/internals/same-value.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// `SameValue` abstract operation
|
|
2
2
|
// https://tc39.es/ecma262/#sec-samevalue
|
|
3
|
+
// eslint-disable-next-line es/no-object-is -- safe
|
|
3
4
|
module.exports = Object.is || function is(x, y) {
|
|
4
5
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
5
6
|
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
package/internals/shared.js
CHANGED
|
@@ -4,7 +4,7 @@ var store = require('../internals/shared-store');
|
|
|
4
4
|
(module.exports = function (key, value) {
|
|
5
5
|
return store[key] || (store[key] = value !== undefined ? value : {});
|
|
6
6
|
})('versions', []).push({
|
|
7
|
-
version: '3.
|
|
7
|
+
version: '3.10.2',
|
|
8
8
|
mode: IS_PURE ? 'pure' : 'global',
|
|
9
9
|
copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
|
10
10
|
});
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
var userAgent = require('../internals/engine-user-agent');
|
|
3
3
|
|
|
4
4
|
// eslint-disable-next-line unicorn/no-unsafe-regex -- safe
|
|
5
|
-
module.exports = /Version\/10
|
|
5
|
+
module.exports = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent);
|
|
@@ -4,7 +4,7 @@ var requireObjectCoercible = require('../internals/require-object-coercible');
|
|
|
4
4
|
|
|
5
5
|
// `String.prototype.repeat` method implementation
|
|
6
6
|
// https://tc39.es/ecma262/#sec-string.prototype.repeat
|
|
7
|
-
module.exports =
|
|
7
|
+
module.exports = function repeat(count) {
|
|
8
8
|
var str = String(requireObjectCoercible(this));
|
|
9
9
|
var result = '';
|
|
10
10
|
var n = toInteger(count);
|