core-js-pure 3.8.3 → 3.9.0
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/json/stringify.js +1 -1
- package/features/array/find-last-index.js +4 -0
- package/features/array/find-last.js +4 -0
- package/features/array/index.js +2 -0
- package/features/array/virtual/find-last-index.js +4 -0
- package/features/array/virtual/find-last.js +4 -0
- package/features/array/virtual/index.js +3 -0
- package/features/instance/find-last-index.js +8 -0
- package/features/instance/find-last.js +8 -0
- package/features/typed-array/find-last-index.js +1 -0
- package/features/typed-array/find-last.js +1 -0
- package/features/typed-array/index.js +4 -0
- package/features/typed-array/unique-by.js +2 -0
- package/internals/array-for-each.js +1 -3
- package/internals/array-includes.js +2 -2
- package/internals/array-iteration-from-last.js +34 -0
- package/internals/array-last-index-of.js +1 -4
- package/internals/array-method-is-strict.js +1 -1
- package/internals/array-unique-by.js +32 -0
- package/internals/async-iterator-prototype.js +1 -1
- package/internals/check-correctness-of-iteration.js +1 -1
- package/internals/function-bind.js +1 -1
- package/internals/get-map-iterator.js +1 -1
- package/internals/get-set-iterator.js +1 -1
- package/internals/global.js +2 -2
- package/internals/ieee754.js +2 -4
- package/internals/indexed-object.js +1 -1
- package/internals/is-iterable.js +1 -1
- package/internals/math-fround.js +1 -1
- package/internals/math-scale.js +2 -2
- package/internals/math-sign.js +1 -1
- package/internals/native-symbol.js +1 -1
- package/internals/object-assign.js +2 -2
- package/internals/object-create.js +1 -1
- package/internals/object-prototype-accessors-forced.js +1 -1
- package/internals/object-set-prototype-of.js +1 -1
- package/internals/range-iterator.js +1 -1
- package/internals/same-value-zero.js +1 -1
- package/internals/same-value.js +1 -1
- package/internals/shared.js +1 -1
- package/internals/string-pad-webkit-bug.js +1 -1
- package/internals/string-punycode-to-ascii.js +1 -1
- package/internals/task.js +2 -2
- package/internals/typed-array-constructors-require-wrappers.js +1 -22
- package/internals/typed-array-from-species-and-list.js +1 -0
- package/internals/use-symbol-as-uid.js +1 -2
- package/internals/whitespaces.js +2 -2
- package/modules/es.aggregate-error.js +1 -1
- package/modules/es.array.concat.js +2 -1
- package/modules/es.array.every.js +1 -3
- package/modules/es.array.filter.js +1 -4
- package/modules/es.array.find-index.js +1 -4
- package/modules/es.array.find.js +1 -4
- package/modules/es.array.includes.js +1 -4
- package/modules/es.array.index-of.js +1 -3
- package/modules/es.array.map.js +1 -4
- package/modules/es.array.reduce-right.js +1 -4
- package/modules/es.array.reduce.js +1 -3
- package/modules/es.array.reverse.js +1 -1
- package/modules/es.array.slice.js +1 -3
- package/modules/es.array.some.js +1 -3
- package/modules/es.array.splice.js +1 -3
- package/modules/es.date.to-json.js +1 -1
- package/modules/es.json.stringify.js +1 -1
- package/modules/es.math.hypot.js +2 -1
- package/modules/es.number.is-nan.js +1 -1
- package/modules/es.number.to-fixed.js +43 -44
- package/modules/es.promise.js +2 -2
- package/modules/es.reflect.define-property.js +1 -1
- package/modules/es.reflect.set.js +1 -1
- package/modules/es.string.from-code-point.js +2 -1
- package/modules/es.string.match-all.js +1 -1
- package/modules/es.symbol.js +1 -1
- package/modules/esnext.array.find-last-index.js +14 -0
- package/modules/esnext.array.find-last.js +14 -0
- package/modules/esnext.array.unique-by.js +2 -28
- package/modules/esnext.bigint.range.js +1 -1
- package/modules/esnext.map.merge.js +1 -1
- package/modules/esnext.typed-array.find-last-index.js +1 -0
- package/modules/esnext.typed-array.find-last.js +1 -0
- package/modules/esnext.typed-array.unique-by.js +1 -0
- package/modules/web.timers.js +1 -1
- package/modules/web.url.js +9 -11
- package/package.json +2 -2
- package/postinstall.js +2 -2
- package/proposals/array-find-from-last.js +5 -0
- package/proposals/array-unique.js +1 -0
- package/stable/instance/entries.js +1 -1
- package/stable/instance/for-each.js +1 -1
- package/stable/instance/keys.js +1 -1
- package/stable/instance/values.js +1 -1
- package/stage/1.js +1 -0
- package/internals/array-method-uses-to-length.js +0 -27
package/es/json/stringify.js
CHANGED
|
@@ -3,7 +3,7 @@ var core = require('../../internals/path');
|
|
|
3
3
|
|
|
4
4
|
if (!core.JSON) core.JSON = { stringify: JSON.stringify };
|
|
5
5
|
|
|
6
|
-
// eslint-disable-next-line no-unused-vars
|
|
6
|
+
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
7
7
|
module.exports = function stringify(it, replacer, space) {
|
|
8
8
|
return core.JSON.stringify.apply(null, arguments);
|
|
9
9
|
};
|
package/features/array/index.js
CHANGED
|
@@ -2,6 +2,8 @@ var parent = require('../../es/array');
|
|
|
2
2
|
require('../../modules/es.map');
|
|
3
3
|
require('../../modules/esnext.array.at');
|
|
4
4
|
require('../../modules/esnext.array.filter-out');
|
|
5
|
+
require('../../modules/esnext.array.find-last');
|
|
6
|
+
require('../../modules/esnext.array.find-last-index');
|
|
5
7
|
require('../../modules/esnext.array.is-template-object');
|
|
6
8
|
require('../../modules/esnext.array.last-item');
|
|
7
9
|
require('../../modules/esnext.array.last-index');
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
var parent = require('../../../es/array/virtual');
|
|
2
|
+
require('../../../modules/es.map');
|
|
2
3
|
require('../../../modules/esnext.array.at');
|
|
3
4
|
require('../../../modules/esnext.array.filter-out');
|
|
5
|
+
require('../../../modules/esnext.array.find-last');
|
|
6
|
+
require('../../../modules/esnext.array.find-last-index');
|
|
4
7
|
require('../../../modules/esnext.array.unique-by');
|
|
5
8
|
|
|
6
9
|
module.exports = parent;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var findLastIndex = require('../array/virtual/find-last-index');
|
|
2
|
+
|
|
3
|
+
var ArrayPrototype = Array.prototype;
|
|
4
|
+
|
|
5
|
+
module.exports = function (it) {
|
|
6
|
+
var own = it.findLastIndex;
|
|
7
|
+
return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.findLastIndex) ? findLastIndex : own;
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var findLast = require('../array/virtual/find-last');
|
|
2
|
+
|
|
3
|
+
var ArrayPrototype = Array.prototype;
|
|
4
|
+
|
|
5
|
+
module.exports = function (it) {
|
|
6
|
+
var own = it.findLast;
|
|
7
|
+
return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.findLast) ? findLast : own;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../modules/esnext.typed-array.find-last-index');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../modules/esnext.typed-array.find-last');
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
var parent = require('../../es/typed-array');
|
|
2
|
+
require('../../modules/es.map');
|
|
2
3
|
require('../../modules/esnext.typed-array.at');
|
|
3
4
|
require('../../modules/esnext.typed-array.filter-out');
|
|
5
|
+
require('../../modules/esnext.typed-array.find-last');
|
|
6
|
+
require('../../modules/esnext.typed-array.find-last-index');
|
|
7
|
+
require('../../modules/esnext.typed-array.unique-by');
|
|
4
8
|
|
|
5
9
|
module.exports = parent;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var $forEach = require('../internals/array-iteration').forEach;
|
|
3
3
|
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
|
|
4
|
-
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
|
|
5
4
|
|
|
6
5
|
var STRICT_METHOD = arrayMethodIsStrict('forEach');
|
|
7
|
-
var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
|
|
8
6
|
|
|
9
7
|
// `Array.prototype.forEach` method implementation
|
|
10
8
|
// https://tc39.es/ecma262/#sec-array.prototype.foreach
|
|
11
|
-
module.exports =
|
|
9
|
+
module.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
|
|
12
10
|
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
13
11
|
} : [].forEach;
|
|
@@ -10,10 +10,10 @@ var createMethod = function (IS_INCLUDES) {
|
|
|
10
10
|
var index = toAbsoluteIndex(fromIndex, length);
|
|
11
11
|
var value;
|
|
12
12
|
// Array#includes uses SameValueZero equality algorithm
|
|
13
|
-
// eslint-disable-next-line no-self-compare
|
|
13
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
14
14
|
if (IS_INCLUDES && el != el) while (length > index) {
|
|
15
15
|
value = O[index++];
|
|
16
|
-
// eslint-disable-next-line no-self-compare
|
|
16
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
17
17
|
if (value != value) return true;
|
|
18
18
|
// Array#indexOf ignores holes, Array#includes - not
|
|
19
19
|
} else for (;length > index; index++) {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var bind = require('../internals/function-bind-context');
|
|
2
|
+
var IndexedObject = require('../internals/indexed-object');
|
|
3
|
+
var toObject = require('../internals/to-object');
|
|
4
|
+
var toLength = require('../internals/to-length');
|
|
5
|
+
|
|
6
|
+
// `Array.prototype.{ findLast, findLastIndex }` methods implementation
|
|
7
|
+
var createMethod = function (TYPE) {
|
|
8
|
+
var IS_FIND_INDEX = TYPE == 6;
|
|
9
|
+
return function ($this, callbackfn, that) {
|
|
10
|
+
var O = toObject($this);
|
|
11
|
+
var self = IndexedObject(O);
|
|
12
|
+
var boundFunction = bind(callbackfn, that, 3);
|
|
13
|
+
var index = toLength(self.length);
|
|
14
|
+
var value, result;
|
|
15
|
+
while (index-- > 0) {
|
|
16
|
+
value = self[index];
|
|
17
|
+
result = boundFunction(value, index, O);
|
|
18
|
+
if (result) switch (TYPE) {
|
|
19
|
+
case 5: return value; // find
|
|
20
|
+
case 6: return index; // findIndex
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return IS_FIND_INDEX ? -1 : undefined;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
module.exports = {
|
|
28
|
+
// `Array.prototype.findLast` method
|
|
29
|
+
// https://github.com/tc39/proposal-array-find-from-last
|
|
30
|
+
findLast: createMethod(5),
|
|
31
|
+
// `Array.prototype.findLastIndex` method
|
|
32
|
+
// https://github.com/tc39/proposal-array-find-from-last
|
|
33
|
+
findLastIndex: createMethod(6)
|
|
34
|
+
};
|
|
@@ -3,15 +3,12 @@ var toIndexedObject = require('../internals/to-indexed-object');
|
|
|
3
3
|
var toInteger = require('../internals/to-integer');
|
|
4
4
|
var toLength = require('../internals/to-length');
|
|
5
5
|
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
|
|
6
|
-
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
|
|
7
6
|
|
|
8
7
|
var min = Math.min;
|
|
9
8
|
var nativeLastIndexOf = [].lastIndexOf;
|
|
10
9
|
var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
|
|
11
10
|
var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
|
|
12
|
-
|
|
13
|
-
var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
|
|
14
|
-
var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH;
|
|
11
|
+
var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;
|
|
15
12
|
|
|
16
13
|
// `Array.prototype.lastIndexOf` method implementation
|
|
17
14
|
// https://tc39.es/ecma262/#sec-array.prototype.lastindexof
|
|
@@ -4,7 +4,7 @@ var fails = require('../internals/fails');
|
|
|
4
4
|
module.exports = function (METHOD_NAME, argument) {
|
|
5
5
|
var method = [][METHOD_NAME];
|
|
6
6
|
return !!method && fails(function () {
|
|
7
|
-
// eslint-disable-next-line no-useless-call,no-throw-literal
|
|
7
|
+
// eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
|
|
8
8
|
method.call(null, argument || function () { throw 1; }, 1);
|
|
9
9
|
});
|
|
10
10
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var toLength = require('../internals/to-length');
|
|
3
|
+
var toObject = require('../internals/to-object');
|
|
4
|
+
var getBuiltIn = require('../internals/get-built-in');
|
|
5
|
+
var arraySpeciesCreate = require('../internals/array-species-create');
|
|
6
|
+
|
|
7
|
+
var push = [].push;
|
|
8
|
+
|
|
9
|
+
// `Array.prototype.uniqueBy` method
|
|
10
|
+
// https://github.com/tc39/proposal-array-unique
|
|
11
|
+
module.exports = function uniqueBy(resolver) {
|
|
12
|
+
var that = toObject(this);
|
|
13
|
+
var length = toLength(that.length);
|
|
14
|
+
var result = arraySpeciesCreate(that, 0);
|
|
15
|
+
var Map = getBuiltIn('Map');
|
|
16
|
+
var map = new Map();
|
|
17
|
+
var resolverFunction, index, item, key;
|
|
18
|
+
if (typeof resolver == 'function') resolverFunction = resolver;
|
|
19
|
+
else if (resolver == null) resolverFunction = function (value) {
|
|
20
|
+
return value;
|
|
21
|
+
};
|
|
22
|
+
else throw new TypeError('Incorrect resolver!');
|
|
23
|
+
for (index = 0; index < length; index++) {
|
|
24
|
+
item = that[index];
|
|
25
|
+
key = resolverFunction(item);
|
|
26
|
+
if (!map.has(key)) map.set(key, item);
|
|
27
|
+
}
|
|
28
|
+
map.forEach(function (value) {
|
|
29
|
+
push.call(result, value);
|
|
30
|
+
});
|
|
31
|
+
return result;
|
|
32
|
+
};
|
|
@@ -19,7 +19,7 @@ if (!IS_PURE) {
|
|
|
19
19
|
AsyncIteratorPrototype = AsyncIterator.prototype;
|
|
20
20
|
} else if (shared[USE_FUNCTION_CONSTRUCTOR] || global[USE_FUNCTION_CONSTRUCTOR]) {
|
|
21
21
|
try {
|
|
22
|
-
// eslint-disable-next-line no-new-func
|
|
22
|
+
// eslint-disable-next-line no-new-func -- we have no alternatives without usage of modern syntax
|
|
23
23
|
prototype = getPrototypeOf(getPrototypeOf(getPrototypeOf(Function('return async function*(){}()')())));
|
|
24
24
|
if (getPrototypeOf(prototype) === Object.prototype) AsyncIteratorPrototype = prototype;
|
|
25
25
|
} catch (error) { /* empty */ }
|
|
@@ -16,7 +16,7 @@ try {
|
|
|
16
16
|
iteratorWithReturn[ITERATOR] = function () {
|
|
17
17
|
return this;
|
|
18
18
|
};
|
|
19
|
-
// eslint-disable-next-line no-throw-literal
|
|
19
|
+
// eslint-disable-next-line no-throw-literal -- required for testing
|
|
20
20
|
Array.from(iteratorWithReturn, function () { throw 2; });
|
|
21
21
|
} catch (error) { /* empty */ }
|
|
22
22
|
|
|
@@ -8,7 +8,7 @@ var factories = {};
|
|
|
8
8
|
var construct = function (C, argsLength, args) {
|
|
9
9
|
if (!(argsLength in factories)) {
|
|
10
10
|
for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
|
|
11
|
-
// eslint-disable-next-line no-new-func
|
|
11
|
+
// eslint-disable-next-line no-new-func -- we have no proper alternatives, IE8- only
|
|
12
12
|
factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')');
|
|
13
13
|
} return factories[argsLength](C, args);
|
|
14
14
|
};
|
|
@@ -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-undef
|
|
5
|
+
// eslint-disable-next-line no-undef -- 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-undef
|
|
5
|
+
// eslint-disable-next-line no-undef -- safe
|
|
6
6
|
return Set.prototype.values.call(it);
|
|
7
7
|
};
|
package/internals/global.js
CHANGED
|
@@ -4,10 +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
|
+
/* global globalThis -- safe */
|
|
8
8
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
9
9
|
check(typeof window == 'object' && window) ||
|
|
10
10
|
check(typeof self == 'object' && self) ||
|
|
11
11
|
check(typeof global == 'object' && global) ||
|
|
12
|
-
// eslint-disable-next-line no-new-func
|
|
12
|
+
// eslint-disable-next-line no-new-func -- fallback
|
|
13
13
|
(function () { return this; })() || Function('return this')();
|
package/internals/ieee754.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
// IEEE754 conversions based on https://github.com/feross/ieee754
|
|
2
|
-
// eslint-disable-next-line no-shadow-restricted-names
|
|
3
|
-
var Infinity = 1 / 0;
|
|
4
2
|
var abs = Math.abs;
|
|
5
3
|
var pow = Math.pow;
|
|
6
4
|
var floor = Math.floor;
|
|
@@ -17,9 +15,9 @@ var pack = function (number, mantissaLength, bytes) {
|
|
|
17
15
|
var index = 0;
|
|
18
16
|
var exponent, mantissa, c;
|
|
19
17
|
number = abs(number);
|
|
20
|
-
// eslint-disable-next-line no-self-compare
|
|
18
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
21
19
|
if (number != number || number === Infinity) {
|
|
22
|
-
// eslint-disable-next-line no-self-compare
|
|
20
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
23
21
|
mantissa = number != number ? 1 : 0;
|
|
24
22
|
exponent = eMax;
|
|
25
23
|
} else {
|
|
@@ -6,7 +6,7 @@ var split = ''.split;
|
|
|
6
6
|
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
7
7
|
module.exports = fails(function () {
|
|
8
8
|
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
9
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
9
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
10
10
|
return !Object('z').propertyIsEnumerable(0);
|
|
11
11
|
}) ? function (it) {
|
|
12
12
|
return classof(it) == 'String' ? split.call(it, '') : Object(it);
|
package/internals/is-iterable.js
CHANGED
|
@@ -8,6 +8,6 @@ module.exports = function (it) {
|
|
|
8
8
|
var O = Object(it);
|
|
9
9
|
return O[ITERATOR] !== undefined
|
|
10
10
|
|| '@@iterator' in O
|
|
11
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
11
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
12
12
|
|| Iterators.hasOwnProperty(classof(O));
|
|
13
13
|
};
|
package/internals/math-fround.js
CHANGED
|
@@ -20,7 +20,7 @@ module.exports = Math.fround || function fround(x) {
|
|
|
20
20
|
if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
|
|
21
21
|
a = (1 + EPSILON32 / EPSILON) * $abs;
|
|
22
22
|
result = a - (a - $abs);
|
|
23
|
-
// eslint-disable-next-line no-self-compare
|
|
23
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
24
24
|
if (result > MAX32 || result != result) return $sign * Infinity;
|
|
25
25
|
return $sign * result;
|
|
26
26
|
};
|
package/internals/math-scale.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {
|
|
4
4
|
if (
|
|
5
5
|
arguments.length === 0
|
|
6
|
-
/* eslint-disable no-self-compare */
|
|
6
|
+
/* eslint-disable no-self-compare -- NaN check */
|
|
7
7
|
|| x != x
|
|
8
8
|
|| inLow != inLow
|
|
9
9
|
|| inHigh != inHigh
|
|
10
10
|
|| outLow != outLow
|
|
11
11
|
|| outHigh != outHigh
|
|
12
|
-
/* eslint-enable no-self-compare */
|
|
12
|
+
/* eslint-enable no-self-compare -- NaN check */
|
|
13
13
|
) return NaN;
|
|
14
14
|
if (x === Infinity || x === -Infinity) return x;
|
|
15
15
|
return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;
|
package/internals/math-sign.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// `Math.sign` method implementation
|
|
2
2
|
// https://tc39.es/ecma262/#sec-math.sign
|
|
3
3
|
module.exports = Math.sign || function sign(x) {
|
|
4
|
-
// eslint-disable-next-line no-self-compare
|
|
4
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
5
5
|
return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
|
|
6
6
|
};
|
|
@@ -2,6 +2,6 @@ var fails = require('../internals/fails');
|
|
|
2
2
|
|
|
3
3
|
module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
4
4
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
5
|
-
|
|
5
|
+
/* global Symbol -- required for testing */
|
|
6
6
|
return !String(Symbol());
|
|
7
7
|
});
|
|
@@ -26,13 +26,13 @@ module.exports = !nativeAssign || fails(function () {
|
|
|
26
26
|
// should work with symbols and should have deterministic property order (V8 bug)
|
|
27
27
|
var A = {};
|
|
28
28
|
var B = {};
|
|
29
|
-
|
|
29
|
+
/* global Symbol -- required for testing */
|
|
30
30
|
var symbol = Symbol();
|
|
31
31
|
var alphabet = 'abcdefghijklmnopqrst';
|
|
32
32
|
A[symbol] = 7;
|
|
33
33
|
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
|
34
34
|
return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
|
|
35
|
-
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
|
|
35
|
+
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
|
|
36
36
|
var T = toObject(target);
|
|
37
37
|
var argumentsLength = arguments.length;
|
|
38
38
|
var index = 1;
|
|
@@ -52,7 +52,7 @@ var NullProtoObjectViaIFrame = function () {
|
|
|
52
52
|
var activeXDocument;
|
|
53
53
|
var NullProtoObject = function () {
|
|
54
54
|
try {
|
|
55
|
-
/* global ActiveXObject */
|
|
55
|
+
/* global ActiveXObject -- old IE */
|
|
56
56
|
activeXDocument = document.domain && new ActiveXObject('htmlfile');
|
|
57
57
|
} catch (error) { /* ignore */ }
|
|
58
58
|
NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
|
|
@@ -7,7 +7,7 @@ var fails = require('../internals/fails');
|
|
|
7
7
|
module.exports = IS_PURE || !fails(function () {
|
|
8
8
|
var key = Math.random();
|
|
9
9
|
// In FF throws only define methods
|
|
10
|
-
// eslint-disable-next-line no-undef, no-useless-call
|
|
10
|
+
// eslint-disable-next-line no-undef, no-useless-call -- required for testing
|
|
11
11
|
__defineSetter__.call(null, key, function () { /* empty */ });
|
|
12
12
|
delete global[key];
|
|
13
13
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
/* eslint-disable no-proto -- safe */
|
|
1
2
|
var anObject = require('../internals/an-object');
|
|
2
3
|
var aPossiblePrototype = require('../internals/a-possible-prototype');
|
|
3
4
|
|
|
4
5
|
// `Object.setPrototypeOf` method
|
|
5
6
|
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
6
7
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
7
|
-
/* eslint-disable no-proto */
|
|
8
8
|
module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
9
9
|
var CORRECT_SETTER = false;
|
|
10
10
|
var test = {};
|
|
@@ -40,7 +40,7 @@ var $RangeIterator = createIteratorConstructor(function RangeIterator(start, end
|
|
|
40
40
|
if (step === Infinity || step === -Infinity || (step === zero && start !== end)) {
|
|
41
41
|
throw new RangeError(INCORRECT_RANGE);
|
|
42
42
|
}
|
|
43
|
-
// eslint-disable-next-line no-self-compare
|
|
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
46
|
type: RANGE_ITERATOR,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// `SameValueZero` abstract operation
|
|
2
2
|
// https://tc39.es/ecma262/#sec-samevaluezero
|
|
3
3
|
module.exports = function (x, y) {
|
|
4
|
-
// eslint-disable-next-line no-self-compare
|
|
4
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
5
5
|
return x === y || x != x && y != y;
|
|
6
6
|
};
|
package/internals/same-value.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// `SameValue` abstract operation
|
|
2
2
|
// https://tc39.es/ecma262/#sec-samevalue
|
|
3
3
|
module.exports = Object.is || function is(x, y) {
|
|
4
|
-
// eslint-disable-next-line no-self-compare
|
|
4
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
5
5
|
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
|
6
6
|
};
|
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.9.0',
|
|
8
8
|
mode: IS_PURE ? 'pure' : 'global',
|
|
9
9
|
copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
|
10
10
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// https://github.com/zloirock/core-js/issues/280
|
|
2
2
|
var userAgent = require('../internals/engine-user-agent');
|
|
3
3
|
|
|
4
|
-
// eslint-disable-next-line unicorn/no-unsafe-regex
|
|
4
|
+
// eslint-disable-next-line unicorn/no-unsafe-regex -- safe
|
|
5
5
|
module.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
|
|
@@ -74,7 +74,7 @@ var adapt = function (delta, numPoints, firstTime) {
|
|
|
74
74
|
* Converts a string of Unicode symbols (e.g. a domain name label) to a
|
|
75
75
|
* Punycode string of ASCII-only symbols.
|
|
76
76
|
*/
|
|
77
|
-
// eslint-disable-next-line
|
|
77
|
+
// eslint-disable-next-line max-statements -- TODO
|
|
78
78
|
var encode = function (input) {
|
|
79
79
|
var output = [];
|
|
80
80
|
|
package/internals/task.js
CHANGED
|
@@ -18,7 +18,7 @@ var ONREADYSTATECHANGE = 'onreadystatechange';
|
|
|
18
18
|
var defer, channel, port;
|
|
19
19
|
|
|
20
20
|
var run = function (id) {
|
|
21
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
21
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
22
22
|
if (queue.hasOwnProperty(id)) {
|
|
23
23
|
var fn = queue[id];
|
|
24
24
|
delete queue[id];
|
|
@@ -48,7 +48,7 @@ if (!set || !clear) {
|
|
|
48
48
|
var i = 1;
|
|
49
49
|
while (arguments.length > i) args.push(arguments[i++]);
|
|
50
50
|
queue[++counter] = function () {
|
|
51
|
-
// eslint-disable-next-line no-new-func
|
|
51
|
+
// eslint-disable-next-line no-new-func -- spec requirement
|
|
52
52
|
(typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
|
|
53
53
|
};
|
|
54
54
|
defer(counter);
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var global = require('../internals/global');
|
|
3
|
-
var fails = require('../internals/fails');
|
|
4
|
-
var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');
|
|
5
|
-
var NATIVE_ARRAY_BUFFER_VIEWS = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS;
|
|
6
|
-
|
|
7
|
-
var ArrayBuffer = global.ArrayBuffer;
|
|
8
|
-
var Int8Array = global.Int8Array;
|
|
9
|
-
|
|
10
|
-
module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {
|
|
11
|
-
Int8Array(1);
|
|
12
|
-
}) || !fails(function () {
|
|
13
|
-
new Int8Array(-1);
|
|
14
|
-
}) || !checkCorrectnessOfIteration(function (iterable) {
|
|
15
|
-
new Int8Array();
|
|
16
|
-
new Int8Array(null);
|
|
17
|
-
new Int8Array(1.5);
|
|
18
|
-
new Int8Array(iterable);
|
|
19
|
-
}, true) || fails(function () {
|
|
20
|
-
// Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill
|
|
21
|
-
return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;
|
|
22
|
-
});
|
|
1
|
+
// empty
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// empty
|
package/internals/whitespaces.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// a string of all valid unicode whitespaces
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
|
|
3
|
+
'\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
|
@@ -11,7 +11,7 @@ var $AggregateError = function AggregateError(errors, message) {
|
|
|
11
11
|
var that = this;
|
|
12
12
|
if (!(that instanceof $AggregateError)) return new $AggregateError(errors, message);
|
|
13
13
|
if (setPrototypeOf) {
|
|
14
|
-
// eslint-disable-next-line unicorn/error-message
|
|
14
|
+
// eslint-disable-next-line unicorn/error-message -- expected
|
|
15
15
|
that = setPrototypeOf(new Error(undefined), getPrototypeOf(that));
|
|
16
16
|
}
|
|
17
17
|
if (message !== undefined) createNonEnumerableProperty(that, 'message', String(message));
|
|
@@ -38,7 +38,8 @@ var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
|
|
38
38
|
// https://tc39.es/ecma262/#sec-array.prototype.concat
|
|
39
39
|
// with adding support of @@isConcatSpreadable and @@species
|
|
40
40
|
$({ target: 'Array', proto: true, forced: FORCED }, {
|
|
41
|
-
|
|
41
|
+
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
42
|
+
concat: function concat(arg) {
|
|
42
43
|
var O = toObject(this);
|
|
43
44
|
var A = arraySpeciesCreate(O, 0);
|
|
44
45
|
var n = 0;
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
var $ = require('../internals/export');
|
|
3
3
|
var $every = require('../internals/array-iteration').every;
|
|
4
4
|
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
|
|
5
|
-
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
|
|
6
5
|
|
|
7
6
|
var STRICT_METHOD = arrayMethodIsStrict('every');
|
|
8
|
-
var USES_TO_LENGTH = arrayMethodUsesToLength('every');
|
|
9
7
|
|
|
10
8
|
// `Array.prototype.every` method
|
|
11
9
|
// https://tc39.es/ecma262/#sec-array.prototype.every
|
|
12
|
-
$({ target: 'Array', proto: true, forced: !STRICT_METHOD
|
|
10
|
+
$({ target: 'Array', proto: true, forced: !STRICT_METHOD }, {
|
|
13
11
|
every: function every(callbackfn /* , thisArg */) {
|
|
14
12
|
return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
15
13
|
}
|
|
@@ -2,16 +2,13 @@
|
|
|
2
2
|
var $ = require('../internals/export');
|
|
3
3
|
var $filter = require('../internals/array-iteration').filter;
|
|
4
4
|
var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
|
|
5
|
-
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
|
|
6
5
|
|
|
7
6
|
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
|
|
8
|
-
// Edge 14- issue
|
|
9
|
-
var USES_TO_LENGTH = arrayMethodUsesToLength('filter');
|
|
10
7
|
|
|
11
8
|
// `Array.prototype.filter` method
|
|
12
9
|
// https://tc39.es/ecma262/#sec-array.prototype.filter
|
|
13
10
|
// with adding support of @@species
|
|
14
|
-
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT
|
|
11
|
+
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
|
15
12
|
filter: function filter(callbackfn /* , thisArg */) {
|
|
16
13
|
return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
17
14
|
}
|
|
@@ -2,19 +2,16 @@
|
|
|
2
2
|
var $ = require('../internals/export');
|
|
3
3
|
var $findIndex = require('../internals/array-iteration').findIndex;
|
|
4
4
|
var addToUnscopables = require('../internals/add-to-unscopables');
|
|
5
|
-
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
|
|
6
5
|
|
|
7
6
|
var FIND_INDEX = 'findIndex';
|
|
8
7
|
var SKIPS_HOLES = true;
|
|
9
8
|
|
|
10
|
-
var USES_TO_LENGTH = arrayMethodUsesToLength(FIND_INDEX);
|
|
11
|
-
|
|
12
9
|
// Shouldn't skip holes
|
|
13
10
|
if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });
|
|
14
11
|
|
|
15
12
|
// `Array.prototype.findIndex` method
|
|
16
13
|
// https://tc39.es/ecma262/#sec-array.prototype.findindex
|
|
17
|
-
$({ target: 'Array', proto: true, forced: SKIPS_HOLES
|
|
14
|
+
$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
|
18
15
|
findIndex: function findIndex(callbackfn /* , that = undefined */) {
|
|
19
16
|
return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
20
17
|
}
|