core-js 3.32.0 → 3.32.1
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/internals/add-to-unscopables.js +1 -1
- package/internals/array-buffer-byte-length.js +1 -1
- package/internals/array-buffer-transfer.js +1 -1
- package/internals/array-buffer.js +1 -1
- package/internals/array-includes.js +2 -2
- package/internals/array-iteration-from-last.js +1 -1
- package/internals/array-iteration.js +7 -7
- package/internals/array-slice-simple.js +2 -1
- package/internals/async-iterator-iteration.js +4 -4
- package/internals/caller.js +1 -1
- package/internals/classof.js +2 -2
- package/internals/collection-strong.js +5 -5
- package/internals/collection.js +6 -6
- package/internals/date-to-iso-string.js +1 -1
- package/internals/descriptors.js +1 -1
- package/internals/engine-is-node.js +2 -1
- package/internals/fix-regexp-well-known-symbol-logic.js +1 -1
- package/internals/function-bind.js +3 -1
- package/internals/get-json-replacer-function.js +1 -1
- package/internals/get-set-record.js +1 -1
- package/internals/global.js +1 -1
- package/internals/host-report-errors.js +1 -1
- package/internals/ie8-dom-define.js +1 -1
- package/internals/ieee754.js +22 -11
- package/internals/indexed-object.js +1 -1
- package/internals/is-array.js +1 -1
- package/internals/is-big-int-array.js +1 -1
- package/internals/is-forced.js +2 -2
- package/internals/is-regexp.js +1 -1
- package/internals/iterator-define.js +2 -2
- package/internals/math-expm1.js +2 -2
- package/internals/math-fround.js +1 -1
- package/internals/math-scale.js +1 -1
- package/internals/math-sign.js +1 -1
- package/internals/number-parse-float.js +1 -1
- package/internals/numeric-range-iterator.js +1 -1
- package/internals/object-assign.js +2 -2
- package/internals/object-get-own-property-names-external.js +1 -1
- package/internals/object-is-extensible.js +1 -1
- package/internals/parse-json-string.js +3 -3
- package/internals/regexp-sticky-helpers.js +2 -2
- package/internals/same-value-zero.js +1 -1
- package/internals/same-value.js +1 -1
- package/internals/schedulers-fix.js +1 -1
- package/internals/shared.js +2 -2
- package/internals/string-pad.js +1 -1
- package/internals/string-punycode-to-ascii.js +3 -3
- package/internals/string-repeat.js +1 -1
- package/internals/structured-clone-proper-transfer.js +1 -1
- package/internals/symbol-constructor-detection.js +1 -1
- package/internals/symbol-is-well-known.js +1 -0
- package/internals/typed-array-constructor.js +2 -2
- package/internals/v8-prototype-define-bug.js +1 -1
- package/modules/es.array.for-each.js +1 -1
- package/modules/es.array.iterator.js +4 -3
- package/modules/es.array.join.js +1 -1
- package/modules/es.date.set-year.js +1 -1
- package/modules/es.date.to-string.js +1 -1
- package/modules/es.json.stringify.js +4 -4
- package/modules/es.math.acosh.js +2 -2
- package/modules/es.math.asinh.js +1 -1
- package/modules/es.math.atanh.js +1 -1
- package/modules/es.math.expm1.js +1 -1
- package/modules/es.math.imul.js +1 -1
- package/modules/es.math.sinh.js +1 -1
- package/modules/es.math.tanh.js +1 -1
- package/modules/es.number.is-nan.js +1 -1
- package/modules/es.number.parse-float.js +1 -1
- package/modules/es.number.parse-int.js +1 -1
- package/modules/es.number.to-fixed.js +1 -1
- package/modules/es.object.is-frozen.js +1 -1
- package/modules/es.object.is-sealed.js +1 -1
- package/modules/es.parse-float.js +1 -1
- package/modules/es.parse-int.js +1 -1
- package/modules/es.promise.constructor.js +2 -2
- package/modules/es.reflect.construct.js +1 -1
- package/modules/es.regexp.constructor.js +1 -1
- package/modules/es.regexp.to-string.js +2 -2
- package/modules/es.string.from-code-point.js +1 -1
- package/modules/es.string.is-well-formed.js +2 -2
- package/modules/es.string.match-all.js +1 -1
- package/modules/es.string.replace.js +8 -3
- package/modules/es.string.split.js +4 -4
- package/modules/es.string.to-well-formed.js +2 -2
- package/modules/es.symbol.constructor.js +1 -1
- package/modules/es.symbol.description.js +1 -1
- package/modules/es.typed-array.to-locale-string.js +1 -1
- package/modules/es.typed-array.to-string.js +1 -1
- package/modules/es.weak-map.constructor.js +2 -2
- package/modules/esnext.array.last-index.js +1 -1
- package/modules/esnext.array.last-item.js +2 -2
- package/modules/esnext.async-disposable-stack.constructor.js +3 -3
- package/modules/esnext.composite-symbol.js +1 -1
- package/modules/esnext.disposable-stack.constructor.js +3 -3
- package/modules/esnext.json.parse.js +14 -14
- package/modules/esnext.json.raw-json.js +3 -3
- package/modules/esnext.math.signbit.js +1 -1
- package/modules/esnext.number.from-string.js +1 -1
- package/modules/esnext.set.intersection.v2.js +1 -1
- package/modules/esnext.string.dedent.js +8 -3
- package/modules/web.atob.js +2 -2
- package/modules/web.dom-exception.constructor.js +1 -1
- package/modules/web.structured-clone.js +4 -4
- package/modules/web.url.constructor.js +129 -125
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ var ArrayPrototype = Array.prototype;
|
|
|
8
8
|
|
|
9
9
|
// Array.prototype[@@unscopables]
|
|
10
10
|
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
11
|
-
if (ArrayPrototype[UNSCOPABLES]
|
|
11
|
+
if (ArrayPrototype[UNSCOPABLES] === undefined) {
|
|
12
12
|
defineProperty(ArrayPrototype, UNSCOPABLES, {
|
|
13
13
|
configurable: true,
|
|
14
14
|
value: create(null)
|
|
@@ -8,6 +8,6 @@ var $TypeError = TypeError;
|
|
|
8
8
|
// - Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
|
|
9
9
|
// - If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
|
|
10
10
|
module.exports = uncurryThisAccessor(ArrayBuffer.prototype, 'byteLength', 'get') || function (O) {
|
|
11
|
-
if (classof(O)
|
|
11
|
+
if (classof(O) !== 'ArrayBuffer') throw $TypeError('ArrayBuffer expected');
|
|
12
12
|
return O.byteLength;
|
|
13
13
|
};
|
|
@@ -26,7 +26,7 @@ module.exports = PROPER_TRANSFER && function (arrayBuffer, newLength, preserveRe
|
|
|
26
26
|
var fixedLength = !isResizable || !isResizable(arrayBuffer);
|
|
27
27
|
if (isDetached(arrayBuffer)) throw TypeError('ArrayBuffer is detached');
|
|
28
28
|
var newBuffer = structuredClone(arrayBuffer, { transfer: [arrayBuffer] });
|
|
29
|
-
if (byteLength
|
|
29
|
+
if (byteLength === newByteLength && (preserveResizability || fixedLength)) return newBuffer;
|
|
30
30
|
if (byteLength >= newByteLength && (!preserveResizability || fixedLength)) return slice(newBuffer, 0, newByteLength);
|
|
31
31
|
var options = (preserveResizability && !fixedLength) && maxByteLength ? { maxByteLength: maxByteLength(newBuffer) } : undefined;
|
|
32
32
|
var newNewBuffer = new ArrayBuffer(newByteLength, options);
|
|
@@ -212,7 +212,7 @@ if (!NATIVE_ARRAY_BUFFER) {
|
|
|
212
212
|
new NativeArrayBuffer();
|
|
213
213
|
new NativeArrayBuffer(1.5);
|
|
214
214
|
new NativeArrayBuffer(NaN);
|
|
215
|
-
return NativeArrayBuffer.length
|
|
215
|
+
return NativeArrayBuffer.length !== 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
|
|
216
216
|
})) {
|
|
217
217
|
/* eslint-enable no-new -- required for testing */
|
|
218
218
|
$ArrayBuffer = function ArrayBuffer(length) {
|
|
@@ -12,10 +12,10 @@ var createMethod = function (IS_INCLUDES) {
|
|
|
12
12
|
var value;
|
|
13
13
|
// Array#includes uses SameValueZero equality algorithm
|
|
14
14
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
15
|
-
if (IS_INCLUDES && el
|
|
15
|
+
if (IS_INCLUDES && el !== el) while (length > index) {
|
|
16
16
|
value = O[index++];
|
|
17
17
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
18
|
-
if (value
|
|
18
|
+
if (value !== value) return true;
|
|
19
19
|
// Array#indexOf ignores holes, Array#includes - not
|
|
20
20
|
} else for (;length > index; index++) {
|
|
21
21
|
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
@@ -6,7 +6,7 @@ var lengthOfArrayLike = require('../internals/length-of-array-like');
|
|
|
6
6
|
|
|
7
7
|
// `Array.prototype.{ findLast, findLastIndex }` methods implementation
|
|
8
8
|
var createMethod = function (TYPE) {
|
|
9
|
-
var IS_FIND_LAST_INDEX = TYPE
|
|
9
|
+
var IS_FIND_LAST_INDEX = TYPE === 1;
|
|
10
10
|
return function ($this, callbackfn, that) {
|
|
11
11
|
var O = toObject($this);
|
|
12
12
|
var self = IndexedObject(O);
|
|
@@ -10,13 +10,13 @@ var push = uncurryThis([].push);
|
|
|
10
10
|
|
|
11
11
|
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
|
|
12
12
|
var createMethod = function (TYPE) {
|
|
13
|
-
var IS_MAP = TYPE
|
|
14
|
-
var IS_FILTER = TYPE
|
|
15
|
-
var IS_SOME = TYPE
|
|
16
|
-
var IS_EVERY = TYPE
|
|
17
|
-
var IS_FIND_INDEX = TYPE
|
|
18
|
-
var IS_FILTER_REJECT = TYPE
|
|
19
|
-
var NO_HOLES = TYPE
|
|
13
|
+
var IS_MAP = TYPE === 1;
|
|
14
|
+
var IS_FILTER = TYPE === 2;
|
|
15
|
+
var IS_SOME = TYPE === 3;
|
|
16
|
+
var IS_EVERY = TYPE === 4;
|
|
17
|
+
var IS_FIND_INDEX = TYPE === 6;
|
|
18
|
+
var IS_FILTER_REJECT = TYPE === 7;
|
|
19
|
+
var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;
|
|
20
20
|
return function ($this, callbackfn, that, specificCreate) {
|
|
21
21
|
var O = toObject($this);
|
|
22
22
|
var self = IndexedObject(O);
|
|
@@ -11,7 +11,8 @@ module.exports = function (O, start, end) {
|
|
|
11
11
|
var k = toAbsoluteIndex(start, length);
|
|
12
12
|
var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
|
13
13
|
var result = $Array(max(fin - k, 0));
|
|
14
|
-
|
|
14
|
+
var n = 0;
|
|
15
|
+
for (; k < fin; k++, n++) createProperty(result, n, O[k]);
|
|
15
16
|
result.length = n;
|
|
16
17
|
return result;
|
|
17
18
|
};
|
|
@@ -11,10 +11,10 @@ var getIteratorDirect = require('../internals/get-iterator-direct');
|
|
|
11
11
|
var closeAsyncIteration = require('../internals/async-iterator-close');
|
|
12
12
|
|
|
13
13
|
var createMethod = function (TYPE) {
|
|
14
|
-
var IS_TO_ARRAY = TYPE
|
|
15
|
-
var IS_FOR_EACH = TYPE
|
|
16
|
-
var IS_EVERY = TYPE
|
|
17
|
-
var IS_SOME = TYPE
|
|
14
|
+
var IS_TO_ARRAY = TYPE === 0;
|
|
15
|
+
var IS_FOR_EACH = TYPE === 1;
|
|
16
|
+
var IS_EVERY = TYPE === 2;
|
|
17
|
+
var IS_SOME = TYPE === 3;
|
|
18
18
|
return function (object, fn, target) {
|
|
19
19
|
anObject(object);
|
|
20
20
|
var MAPPING = fn !== undefined;
|
package/internals/caller.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
module.exports = function (methodName, numArgs) {
|
|
3
|
-
return numArgs
|
|
3
|
+
return numArgs === 1 ? function (object, arg) {
|
|
4
4
|
return object[methodName](arg);
|
|
5
5
|
} : function (object, arg1, arg2) {
|
|
6
6
|
return object[methodName](arg1, arg2);
|
package/internals/classof.js
CHANGED
|
@@ -8,7 +8,7 @@ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
|
8
8
|
var $Object = Object;
|
|
9
9
|
|
|
10
10
|
// ES3 wrong here
|
|
11
|
-
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }())
|
|
11
|
+
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
|
|
12
12
|
|
|
13
13
|
// fallback for IE11 Script Access Denied error
|
|
14
14
|
var tryGet = function (it, key) {
|
|
@@ -26,5 +26,5 @@ module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
|
|
26
26
|
// builtinTag case
|
|
27
27
|
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
28
28
|
// ES3 arguments fallback
|
|
29
|
-
: (result = classofRaw(O))
|
|
29
|
+
: (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
30
30
|
};
|
|
@@ -69,7 +69,7 @@ module.exports = {
|
|
|
69
69
|
if (index !== 'F') return state.index[index];
|
|
70
70
|
// frozen object case
|
|
71
71
|
for (entry = state.first; entry; entry = entry.next) {
|
|
72
|
-
if (entry.key
|
|
72
|
+
if (entry.key === key) return entry;
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
|
|
@@ -106,8 +106,8 @@ module.exports = {
|
|
|
106
106
|
entry.removed = true;
|
|
107
107
|
if (prev) prev.next = next;
|
|
108
108
|
if (next) next.previous = prev;
|
|
109
|
-
if (state.first
|
|
110
|
-
if (state.last
|
|
109
|
+
if (state.first === entry) state.first = next;
|
|
110
|
+
if (state.last === entry) state.last = prev;
|
|
111
111
|
if (DESCRIPTORS) state.size--;
|
|
112
112
|
else that.size--;
|
|
113
113
|
} return !!entry;
|
|
@@ -194,8 +194,8 @@ module.exports = {
|
|
|
194
194
|
return createIterResultObject(undefined, true);
|
|
195
195
|
}
|
|
196
196
|
// return step by kind
|
|
197
|
-
if (kind
|
|
198
|
-
if (kind
|
|
197
|
+
if (kind === 'keys') return createIterResultObject(entry.key, false);
|
|
198
|
+
if (kind === 'values') return createIterResultObject(entry.value, false);
|
|
199
199
|
return createIterResultObject([entry.key, entry.value], false);
|
|
200
200
|
}, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
|
|
201
201
|
|
package/internals/collection.js
CHANGED
|
@@ -27,14 +27,14 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
|
|
|
27
27
|
var fixMethod = function (KEY) {
|
|
28
28
|
var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]);
|
|
29
29
|
defineBuiltIn(NativePrototype, KEY,
|
|
30
|
-
KEY
|
|
30
|
+
KEY === 'add' ? function add(value) {
|
|
31
31
|
uncurriedNativeMethod(this, value === 0 ? 0 : value);
|
|
32
32
|
return this;
|
|
33
|
-
} : KEY
|
|
33
|
+
} : KEY === 'delete' ? function (key) {
|
|
34
34
|
return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
|
|
35
|
-
} : KEY
|
|
35
|
+
} : KEY === 'get' ? function get(key) {
|
|
36
36
|
return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);
|
|
37
|
-
} : KEY
|
|
37
|
+
} : KEY === 'has' ? function has(key) {
|
|
38
38
|
return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
|
|
39
39
|
} : function set(key, value) {
|
|
40
40
|
uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
|
|
@@ -57,7 +57,7 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
|
|
|
57
57
|
} else if (isForced(CONSTRUCTOR_NAME, true)) {
|
|
58
58
|
var instance = new Constructor();
|
|
59
59
|
// early implementations not supports chaining
|
|
60
|
-
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1)
|
|
60
|
+
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) !== instance;
|
|
61
61
|
// V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
|
|
62
62
|
var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
|
|
63
63
|
// most early implementations doesn't supports iterables, most modern - not close it correctly
|
|
@@ -96,7 +96,7 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
exported[CONSTRUCTOR_NAME] = Constructor;
|
|
99
|
-
$({ global: true, constructor: true, forced: Constructor
|
|
99
|
+
$({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported);
|
|
100
100
|
|
|
101
101
|
setToStringTag(Constructor, CONSTRUCTOR_NAME);
|
|
102
102
|
|
|
@@ -21,7 +21,7 @@ var getUTCSeconds = uncurryThis(DatePrototype.getUTCSeconds);
|
|
|
21
21
|
// https://tc39.es/ecma262/#sec-date.prototype.toisostring
|
|
22
22
|
// PhantomJS / old WebKit fails here:
|
|
23
23
|
module.exports = (fails(function () {
|
|
24
|
-
return nativeDateToISOString.call(new Date(-5e13 - 1))
|
|
24
|
+
return nativeDateToISOString.call(new Date(-5e13 - 1)) !== '0385-07-25T07:06:39.999Z';
|
|
25
25
|
}) || !fails(function () {
|
|
26
26
|
nativeDateToISOString.call(new Date(NaN));
|
|
27
27
|
})) ? function toISOString() {
|
package/internals/descriptors.js
CHANGED
|
@@ -4,5 +4,5 @@ var fails = require('../internals/fails');
|
|
|
4
4
|
// Detect IE8's incomplete defineProperty implementation
|
|
5
5
|
module.exports = !fails(function () {
|
|
6
6
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
7
|
-
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1]
|
|
7
|
+
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
|
8
8
|
});
|
|
@@ -18,7 +18,7 @@ module.exports = function (KEY, exec, FORCED, SHAM) {
|
|
|
18
18
|
// String methods call symbol-named RegEp methods
|
|
19
19
|
var O = {};
|
|
20
20
|
O[SYMBOL] = function () { return 7; };
|
|
21
|
-
return ''[KEY](O)
|
|
21
|
+
return ''[KEY](O) !== 7;
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
|
|
@@ -13,7 +13,9 @@ var factories = {};
|
|
|
13
13
|
|
|
14
14
|
var construct = function (C, argsLength, args) {
|
|
15
15
|
if (!hasOwn(factories, argsLength)) {
|
|
16
|
-
|
|
16
|
+
var list = [];
|
|
17
|
+
var i = 0;
|
|
18
|
+
for (; i < argsLength; i++) list[i] = 'a[' + i + ']';
|
|
17
19
|
factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
|
|
18
20
|
} return factories[argsLength](C, args);
|
|
19
21
|
};
|
|
@@ -15,7 +15,7 @@ module.exports = function (replacer) {
|
|
|
15
15
|
for (var i = 0; i < rawLength; i++) {
|
|
16
16
|
var element = replacer[i];
|
|
17
17
|
if (typeof element == 'string') push(keys, element);
|
|
18
|
-
else if (typeof element == 'number' || classof(element)
|
|
18
|
+
else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') push(keys, toString(element));
|
|
19
19
|
}
|
|
20
20
|
var keysLength = keys.length;
|
|
21
21
|
var root = true;
|
|
@@ -33,7 +33,7 @@ module.exports = function (obj) {
|
|
|
33
33
|
var numSize = +obj.size;
|
|
34
34
|
// NOTE: If size is undefined, then numSize will be NaN
|
|
35
35
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
36
|
-
if (numSize
|
|
36
|
+
if (numSize !== numSize) throw $TypeError(INVALID_SIZE);
|
|
37
37
|
var intSize = toIntegerOrInfinity(numSize);
|
|
38
38
|
if (intSize < 0) throw $RangeError(INVALID_SIZE);
|
|
39
39
|
return new SetRecord(
|
package/internals/global.js
CHANGED
package/internals/ieee754.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
// IEEE754 conversions based on https://github.com/feross/ieee754
|
|
3
|
+
var sign = require('../internals/math-sign');
|
|
4
|
+
var trunc = require('../internals/math-trunc');
|
|
5
|
+
|
|
3
6
|
var $Array = Array;
|
|
4
7
|
var abs = Math.abs;
|
|
5
8
|
var pow = Math.pow;
|
|
@@ -7,20 +10,28 @@ var floor = Math.floor;
|
|
|
7
10
|
var log = Math.log;
|
|
8
11
|
var LN2 = Math.LN2;
|
|
9
12
|
|
|
13
|
+
var roundToEven = function (number) {
|
|
14
|
+
var truncated = trunc(number);
|
|
15
|
+
var delta = abs(number - truncated);
|
|
16
|
+
if (delta > 0.5 || delta === 0.5 && truncated % 2 !== 0) {
|
|
17
|
+
return truncated + sign(number);
|
|
18
|
+
} return truncated;
|
|
19
|
+
};
|
|
20
|
+
|
|
10
21
|
var pack = function (number, mantissaLength, bytes) {
|
|
11
22
|
var buffer = $Array(bytes);
|
|
12
23
|
var exponentLength = bytes * 8 - mantissaLength - 1;
|
|
13
24
|
var eMax = (1 << exponentLength) - 1;
|
|
14
25
|
var eBias = eMax >> 1;
|
|
15
26
|
var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
|
|
16
|
-
var
|
|
27
|
+
var s = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
|
|
17
28
|
var index = 0;
|
|
18
29
|
var exponent, mantissa, c;
|
|
19
30
|
number = abs(number);
|
|
20
31
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
21
|
-
if (number
|
|
32
|
+
if (number !== number || number === Infinity) {
|
|
22
33
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
23
|
-
mantissa = number
|
|
34
|
+
mantissa = number !== number ? 1 : 0;
|
|
24
35
|
exponent = eMax;
|
|
25
36
|
} else {
|
|
26
37
|
exponent = floor(log(number) / LN2);
|
|
@@ -42,10 +53,10 @@ var pack = function (number, mantissaLength, bytes) {
|
|
|
42
53
|
mantissa = 0;
|
|
43
54
|
exponent = eMax;
|
|
44
55
|
} else if (exponent + eBias >= 1) {
|
|
45
|
-
mantissa = (number * c - 1) * pow(2, mantissaLength);
|
|
56
|
+
mantissa = roundToEven((number * c - 1) * pow(2, mantissaLength));
|
|
46
57
|
exponent = exponent + eBias;
|
|
47
58
|
} else {
|
|
48
|
-
mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
|
|
59
|
+
mantissa = roundToEven(number * pow(2, eBias - 1) * pow(2, mantissaLength));
|
|
49
60
|
exponent = 0;
|
|
50
61
|
}
|
|
51
62
|
}
|
|
@@ -61,7 +72,7 @@ var pack = function (number, mantissaLength, bytes) {
|
|
|
61
72
|
exponent /= 256;
|
|
62
73
|
exponentLength -= 8;
|
|
63
74
|
}
|
|
64
|
-
buffer[--index] |=
|
|
75
|
+
buffer[--index] |= s * 128;
|
|
65
76
|
return buffer;
|
|
66
77
|
};
|
|
67
78
|
|
|
@@ -72,10 +83,10 @@ var unpack = function (buffer, mantissaLength) {
|
|
|
72
83
|
var eBias = eMax >> 1;
|
|
73
84
|
var nBits = exponentLength - 7;
|
|
74
85
|
var index = bytes - 1;
|
|
75
|
-
var
|
|
76
|
-
var exponent =
|
|
86
|
+
var s = buffer[index--];
|
|
87
|
+
var exponent = s & 127;
|
|
77
88
|
var mantissa;
|
|
78
|
-
|
|
89
|
+
s >>= 7;
|
|
79
90
|
while (nBits > 0) {
|
|
80
91
|
exponent = exponent * 256 + buffer[index--];
|
|
81
92
|
nBits -= 8;
|
|
@@ -90,11 +101,11 @@ var unpack = function (buffer, mantissaLength) {
|
|
|
90
101
|
if (exponent === 0) {
|
|
91
102
|
exponent = 1 - eBias;
|
|
92
103
|
} else if (exponent === eMax) {
|
|
93
|
-
return mantissa ? NaN :
|
|
104
|
+
return mantissa ? NaN : s ? -Infinity : Infinity;
|
|
94
105
|
} else {
|
|
95
106
|
mantissa = mantissa + pow(2, mantissaLength);
|
|
96
107
|
exponent = exponent - eBias;
|
|
97
|
-
} return (
|
|
108
|
+
} return (s ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
|
|
98
109
|
};
|
|
99
110
|
|
|
100
111
|
module.exports = {
|
|
@@ -12,5 +12,5 @@ module.exports = fails(function () {
|
|
|
12
12
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
13
13
|
return !$Object('z').propertyIsEnumerable(0);
|
|
14
14
|
}) ? function (it) {
|
|
15
|
-
return classof(it)
|
|
15
|
+
return classof(it) === 'String' ? split(it, '') : $Object(it);
|
|
16
16
|
} : $Object;
|
package/internals/is-array.js
CHANGED
|
@@ -5,5 +5,5 @@ var classof = require('../internals/classof-raw');
|
|
|
5
5
|
// https://tc39.es/ecma262/#sec-isarray
|
|
6
6
|
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
7
7
|
module.exports = Array.isArray || function isArray(argument) {
|
|
8
|
-
return classof(argument)
|
|
8
|
+
return classof(argument) === 'Array';
|
|
9
9
|
};
|
package/internals/is-forced.js
CHANGED
|
@@ -6,8 +6,8 @@ var replacement = /#|\.prototype\./;
|
|
|
6
6
|
|
|
7
7
|
var isForced = function (feature, detection) {
|
|
8
8
|
var value = data[normalize(feature)];
|
|
9
|
-
return value
|
|
10
|
-
: value
|
|
9
|
+
return value === POLYFILL ? true
|
|
10
|
+
: value === NATIVE ? false
|
|
11
11
|
: isCallable(detection) ? fails(detection)
|
|
12
12
|
: !!detection;
|
|
13
13
|
};
|
package/internals/is-regexp.js
CHANGED
|
@@ -9,5 +9,5 @@ var MATCH = wellKnownSymbol('match');
|
|
|
9
9
|
// https://tc39.es/ecma262/#sec-isregexp
|
|
10
10
|
module.exports = function (it) {
|
|
11
11
|
var isRegExp;
|
|
12
|
-
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it)
|
|
12
|
+
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) === 'RegExp');
|
|
13
13
|
};
|
|
@@ -45,7 +45,7 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
|
|
|
45
45
|
|| IterablePrototype['@@iterator']
|
|
46
46
|
|| DEFAULT && IterablePrototype[DEFAULT];
|
|
47
47
|
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
|
48
|
-
var anyNativeIterator = NAME
|
|
48
|
+
var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
|
49
49
|
var CurrentIteratorPrototype, methods, KEY;
|
|
50
50
|
|
|
51
51
|
// fix native
|
|
@@ -66,7 +66,7 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
|
69
|
-
if (PROPER_FUNCTION_NAME && DEFAULT
|
|
69
|
+
if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
70
70
|
if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
|
|
71
71
|
createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
|
|
72
72
|
} else {
|
package/internals/math-expm1.js
CHANGED
|
@@ -9,8 +9,8 @@ module.exports = (!$expm1
|
|
|
9
9
|
// Old FF bug
|
|
10
10
|
|| $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
|
|
11
11
|
// Tor Browser bug
|
|
12
|
-
|| $expm1(-2e-17)
|
|
12
|
+
|| $expm1(-2e-17) !== -2e-17
|
|
13
13
|
) ? function expm1(x) {
|
|
14
14
|
var n = +x;
|
|
15
|
-
return n
|
|
15
|
+
return n === 0 ? n : n > -1e-6 && n < 1e-6 ? n + n * n / 2 : exp(n) - 1;
|
|
16
16
|
} : $expm1;
|
package/internals/math-fround.js
CHANGED
|
@@ -24,6 +24,6 @@ module.exports = Math.fround || function fround(x) {
|
|
|
24
24
|
a = (1 + EPSILON32 / EPSILON) * $abs;
|
|
25
25
|
result = a - (a - $abs);
|
|
26
26
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
27
|
-
if (result > MAX32 || result
|
|
27
|
+
if (result > MAX32 || result !== result) return $sign * Infinity;
|
|
28
28
|
return $sign * result;
|
|
29
29
|
};
|
package/internals/math-scale.js
CHANGED
|
@@ -8,7 +8,7 @@ module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh)
|
|
|
8
8
|
var nOutLow = +outLow;
|
|
9
9
|
var nOutHigh = +outHigh;
|
|
10
10
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
11
|
-
if (nx
|
|
11
|
+
if (nx !== nx || nInLow !== nInLow || nInHigh !== nInHigh || nOutLow !== nOutLow || nOutHigh !== nOutHigh) return NaN;
|
|
12
12
|
if (nx === Infinity || nx === -Infinity) return nx;
|
|
13
13
|
return (nx - nInLow) * (nOutHigh - nOutLow) / (nInHigh - nInLow) + nOutLow;
|
|
14
14
|
};
|
package/internals/math-sign.js
CHANGED
|
@@ -19,5 +19,5 @@ var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity
|
|
|
19
19
|
module.exports = FORCED ? function parseFloat(string) {
|
|
20
20
|
var trimmedString = trim(toString(string));
|
|
21
21
|
var result = $parseFloat(trimmedString);
|
|
22
|
-
return result === 0 && charAt(trimmedString, 0)
|
|
22
|
+
return result === 0 && charAt(trimmedString, 0) === '-' ? -0 : result;
|
|
23
23
|
} : $parseFloat;
|
|
@@ -47,7 +47,7 @@ var $RangeIterator = createIteratorConstructor(function NumericRangeIterator(sta
|
|
|
47
47
|
throw $RangeError(INCORRECT_RANGE);
|
|
48
48
|
}
|
|
49
49
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
50
|
-
var hitsEnd = start
|
|
50
|
+
var hitsEnd = start !== start || end !== end || step !== step || (end > start) !== (step > zero);
|
|
51
51
|
setInternalState(this, {
|
|
52
52
|
type: NUMERIC_RANGE_ITERATOR,
|
|
53
53
|
start: start,
|
|
@@ -32,11 +32,11 @@ module.exports = !$assign || fails(function () {
|
|
|
32
32
|
var A = {};
|
|
33
33
|
var B = {};
|
|
34
34
|
// eslint-disable-next-line es/no-symbol -- safe
|
|
35
|
-
var symbol = Symbol();
|
|
35
|
+
var symbol = Symbol('assign detection');
|
|
36
36
|
var alphabet = 'abcdefghijklmnopqrst';
|
|
37
37
|
A[symbol] = 7;
|
|
38
38
|
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
|
39
|
-
return $assign({}, A)[symbol]
|
|
39
|
+
return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
|
|
40
40
|
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
|
|
41
41
|
var T = toObject(target);
|
|
42
42
|
var argumentsLength = arguments.length;
|
|
@@ -18,7 +18,7 @@ var getWindowNames = function (it) {
|
|
|
18
18
|
|
|
19
19
|
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
|
|
20
20
|
module.exports.f = function getOwnPropertyNames(it) {
|
|
21
|
-
return windowNames && classof(it)
|
|
21
|
+
return windowNames && classof(it) === 'Window'
|
|
22
22
|
? getWindowNames(it)
|
|
23
23
|
: $getOwnPropertyNames(toIndexedObject(it));
|
|
24
24
|
};
|
|
@@ -12,6 +12,6 @@ var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
|
|
|
12
12
|
// https://tc39.es/ecma262/#sec-object.isextensible
|
|
13
13
|
module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {
|
|
14
14
|
if (!isObject(it)) return false;
|
|
15
|
-
if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it)
|
|
15
|
+
if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) === 'ArrayBuffer') return false;
|
|
16
16
|
return $isExtensible ? $isExtensible(it) : true;
|
|
17
17
|
} : $isExtensible;
|
|
@@ -29,19 +29,19 @@ module.exports = function (source, i) {
|
|
|
29
29
|
var value = '';
|
|
30
30
|
while (i < source.length) {
|
|
31
31
|
var chr = at(source, i);
|
|
32
|
-
if (chr
|
|
32
|
+
if (chr === '\\') {
|
|
33
33
|
var twoChars = slice(source, i, i + 2);
|
|
34
34
|
if (hasOwn(codePoints, twoChars)) {
|
|
35
35
|
value += codePoints[twoChars];
|
|
36
36
|
i += 2;
|
|
37
|
-
} else if (twoChars
|
|
37
|
+
} else if (twoChars === '\\u') {
|
|
38
38
|
i += 2;
|
|
39
39
|
var fourHexDigits = slice(source, i, i + 4);
|
|
40
40
|
if (!exec(IS_4_HEX_DIGITS, fourHexDigits)) throw $SyntaxError('Bad Unicode escape at: ' + i);
|
|
41
41
|
value += fromCharCode($parseInt(fourHexDigits, 16));
|
|
42
42
|
i += 4;
|
|
43
43
|
} else throw $SyntaxError('Unknown escape sequence: "' + twoChars + '"');
|
|
44
|
-
} else if (chr
|
|
44
|
+
} else if (chr === '"') {
|
|
45
45
|
unterminated = false;
|
|
46
46
|
i++;
|
|
47
47
|
break;
|
|
@@ -8,7 +8,7 @@ var $RegExp = global.RegExp;
|
|
|
8
8
|
var UNSUPPORTED_Y = fails(function () {
|
|
9
9
|
var re = $RegExp('a', 'y');
|
|
10
10
|
re.lastIndex = 2;
|
|
11
|
-
return re.exec('abcd')
|
|
11
|
+
return re.exec('abcd') !== null;
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
// UC Browser bug
|
|
@@ -21,7 +21,7 @@ var BROKEN_CARET = UNSUPPORTED_Y || fails(function () {
|
|
|
21
21
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
|
22
22
|
var re = $RegExp('^r', 'gy');
|
|
23
23
|
re.lastIndex = 2;
|
|
24
|
-
return re.exec('str')
|
|
24
|
+
return re.exec('str') !== null;
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
module.exports = {
|
package/internals/same-value.js
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
// eslint-disable-next-line es/no-object-is -- safe
|
|
5
5
|
module.exports = Object.is || function is(x, y) {
|
|
6
6
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
7
|
-
return x === y ? x !== 0 || 1 / x === 1 / y : x
|
|
7
|
+
return x === y ? x !== 0 || 1 / x === 1 / y : x !== x && y !== y;
|
|
8
8
|
};
|
|
@@ -11,7 +11,7 @@ var Function = global.Function;
|
|
|
11
11
|
// dirty IE9- and Bun 0.3.0- checks
|
|
12
12
|
var WRAP = /MSIE .\./.test(USER_AGENT) || ENGINE_IS_BUN && (function () {
|
|
13
13
|
var version = global.Bun.version.split('.');
|
|
14
|
-
return version.length < 3 || version[0]
|
|
14
|
+
return version.length < 3 || version[0] === '0' && (version[1] < 3 || version[1] === '3' && version[2] === '0');
|
|
15
15
|
})();
|
|
16
16
|
|
|
17
17
|
// IE9- / Bun 0.3.0- setTimeout / setInterval / setImmediate additional parameters fix
|