core-js 3.22.5 → 3.22.7
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 +2 -2
- package/internals/define-built-in.js +12 -17
- package/internals/{set-global.js → define-global-property.js} +0 -0
- package/internals/export.js +16 -16
- package/internals/make-built-in.js +6 -5
- package/internals/math-expm1.js +2 -1
- package/internals/math-fround.js +3 -2
- package/internals/math-log1p.js +2 -1
- package/internals/math-sign.js +2 -1
- package/internals/math-trunc.js +10 -0
- package/internals/shared-store.js +2 -2
- package/internals/shared.js +2 -2
- package/internals/to-integer-or-infinity.js +3 -4
- package/modules/es.math.acosh.js +4 -3
- package/modules/es.math.asinh.js +2 -1
- package/modules/es.math.atanh.js +2 -1
- package/modules/es.math.cbrt.js +2 -1
- package/modules/es.math.clz32.js +2 -1
- package/modules/es.math.sinh.js +2 -1
- package/modules/es.math.tanh.js +4 -3
- package/modules/es.math.trunc.js +2 -6
- package/modules/esnext.math.signbit.js +3 -1
- package/modules/web.queue-microtask.js +1 -1
- package/modules/web.url-search-params.constructor.js +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
2
2
|
var create = require('../internals/object-create');
|
|
3
|
-
var
|
|
3
|
+
var defineProperty = require('../internals/object-define-property').f;
|
|
4
4
|
|
|
5
5
|
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
|
6
6
|
var ArrayPrototype = Array.prototype;
|
|
@@ -8,7 +8,7 @@ var ArrayPrototype = Array.prototype;
|
|
|
8
8
|
// Array.prototype[@@unscopables]
|
|
9
9
|
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
10
10
|
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
|
11
|
-
|
|
11
|
+
defineProperty(ArrayPrototype, UNSCOPABLES, {
|
|
12
12
|
configurable: true,
|
|
13
13
|
value: create(null)
|
|
14
14
|
});
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
var global = require('../internals/global');
|
|
2
1
|
var isCallable = require('../internals/is-callable');
|
|
3
2
|
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
4
3
|
var makeBuiltIn = require('../internals/make-built-in');
|
|
5
|
-
var
|
|
4
|
+
var defineGlobalProperty = require('../internals/define-global-property');
|
|
6
5
|
|
|
7
6
|
module.exports = function (O, key, value, options) {
|
|
8
|
-
|
|
9
|
-
var simple = options
|
|
10
|
-
var
|
|
11
|
-
var name = options && options.name !== undefined ? options.name : key;
|
|
7
|
+
if (!options) options = {};
|
|
8
|
+
var simple = options.enumerable;
|
|
9
|
+
var name = options.name !== undefined ? options.name : key;
|
|
12
10
|
if (isCallable(value)) makeBuiltIn(value, name, options);
|
|
13
|
-
if (
|
|
11
|
+
if (options.global) {
|
|
14
12
|
if (simple) O[key] = value;
|
|
15
|
-
else
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
if (simple) O[key] = value;
|
|
23
|
-
else createNonEnumerableProperty(O, key, value);
|
|
24
|
-
return O;
|
|
13
|
+
else defineGlobalProperty(key, value);
|
|
14
|
+
} else {
|
|
15
|
+
if (!options.unsafe) delete O[key];
|
|
16
|
+
else if (O[key]) simple = true;
|
|
17
|
+
if (simple) O[key] = value;
|
|
18
|
+
else createNonEnumerableProperty(O, key, value);
|
|
19
|
+
} return O;
|
|
25
20
|
};
|
|
File without changes
|
package/internals/export.js
CHANGED
|
@@ -2,24 +2,24 @@ var global = require('../internals/global');
|
|
|
2
2
|
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
|
|
3
3
|
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
4
4
|
var defineBuiltIn = require('../internals/define-built-in');
|
|
5
|
-
var
|
|
5
|
+
var defineGlobalProperty = require('../internals/define-global-property');
|
|
6
6
|
var copyConstructorProperties = require('../internals/copy-constructor-properties');
|
|
7
7
|
var isForced = require('../internals/is-forced');
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
|
-
options.target
|
|
11
|
-
options.global
|
|
12
|
-
options.stat
|
|
13
|
-
options.proto
|
|
14
|
-
options.real
|
|
15
|
-
options.forced
|
|
16
|
-
options.bind
|
|
17
|
-
options.wrap
|
|
18
|
-
options.unsafe
|
|
19
|
-
options.sham
|
|
20
|
-
options.enumerable
|
|
21
|
-
options.
|
|
22
|
-
options.name
|
|
10
|
+
options.target - name of the target object
|
|
11
|
+
options.global - target is the global object
|
|
12
|
+
options.stat - export as static methods of target
|
|
13
|
+
options.proto - export as prototype methods of target
|
|
14
|
+
options.real - real prototype method for the `pure` version
|
|
15
|
+
options.forced - export even if the native feature is available
|
|
16
|
+
options.bind - bind methods to the target, required for the `pure` version
|
|
17
|
+
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
18
|
+
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
19
|
+
options.sham - add a flag to not completely full polyfills
|
|
20
|
+
options.enumerable - export as enumerable property
|
|
21
|
+
options.dontCallGetSet - prevent calling a getter on target
|
|
22
|
+
options.name - the .name of the function if it does not match the key
|
|
23
23
|
*/
|
|
24
24
|
module.exports = function (options, source) {
|
|
25
25
|
var TARGET = options.target;
|
|
@@ -29,13 +29,13 @@ module.exports = function (options, source) {
|
|
|
29
29
|
if (GLOBAL) {
|
|
30
30
|
target = global;
|
|
31
31
|
} else if (STATIC) {
|
|
32
|
-
target = global[TARGET] ||
|
|
32
|
+
target = global[TARGET] || defineGlobalProperty(TARGET, {});
|
|
33
33
|
} else {
|
|
34
34
|
target = (global[TARGET] || {}).prototype;
|
|
35
35
|
}
|
|
36
36
|
if (target) for (key in source) {
|
|
37
37
|
sourceProperty = source[key];
|
|
38
|
-
if (options.
|
|
38
|
+
if (options.dontCallGetSet) {
|
|
39
39
|
descriptor = getOwnPropertyDescriptor(target, key);
|
|
40
40
|
targetProperty = descriptor && descriptor.value;
|
|
41
41
|
} else targetProperty = target[key];
|
|
@@ -29,11 +29,12 @@ var makeBuiltIn = module.exports = function (value, name, options) {
|
|
|
29
29
|
if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {
|
|
30
30
|
defineProperty(value, 'length', { value: options.arity });
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
if (
|
|
34
|
-
defineProperty(value, 'prototype', { writable: false });
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
try {
|
|
33
|
+
if (options && hasOwn(options, 'constructor') && options.constructor) {
|
|
34
|
+
if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });
|
|
35
|
+
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
|
36
|
+
} else if (value.prototype) value.prototype = undefined;
|
|
37
|
+
} catch (error) { /* empty */ }
|
|
37
38
|
var state = enforceInternalState(value);
|
|
38
39
|
if (!hasOwn(state, 'source')) {
|
|
39
40
|
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
package/internals/math-expm1.js
CHANGED
|
@@ -10,5 +10,6 @@ module.exports = (!$expm1
|
|
|
10
10
|
// Tor Browser bug
|
|
11
11
|
|| $expm1(-2e-17) != -2e-17
|
|
12
12
|
) ? function expm1(x) {
|
|
13
|
-
|
|
13
|
+
var n = +x;
|
|
14
|
+
return n == 0 ? n : n > -1e-6 && n < 1e-6 ? n + n * n / 2 : exp(n) - 1;
|
|
14
15
|
} : $expm1;
|
package/internals/math-fround.js
CHANGED
|
@@ -15,8 +15,9 @@ var roundTiesToEven = function (n) {
|
|
|
15
15
|
// https://tc39.es/ecma262/#sec-math.fround
|
|
16
16
|
// eslint-disable-next-line es-x/no-math-fround -- safe
|
|
17
17
|
module.exports = Math.fround || function fround(x) {
|
|
18
|
-
var
|
|
19
|
-
var $
|
|
18
|
+
var n = +x;
|
|
19
|
+
var $abs = abs(n);
|
|
20
|
+
var $sign = sign(n);
|
|
20
21
|
var a, result;
|
|
21
22
|
if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
|
|
22
23
|
a = (1 + EPSILON32 / EPSILON) * $abs;
|
package/internals/math-log1p.js
CHANGED
|
@@ -4,5 +4,6 @@ var log = Math.log;
|
|
|
4
4
|
// https://tc39.es/ecma262/#sec-math.log1p
|
|
5
5
|
// eslint-disable-next-line es-x/no-math-log1p -- safe
|
|
6
6
|
module.exports = Math.log1p || function log1p(x) {
|
|
7
|
-
|
|
7
|
+
var n = +x;
|
|
8
|
+
return n > -1e-8 && n < 1e-8 ? n - n * n / 2 : log(1 + n);
|
|
8
9
|
};
|
package/internals/math-sign.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// https://tc39.es/ecma262/#sec-math.sign
|
|
3
3
|
// eslint-disable-next-line es-x/no-math-sign -- safe
|
|
4
4
|
module.exports = Math.sign || function sign(x) {
|
|
5
|
+
var n = +x;
|
|
5
6
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
6
|
-
return
|
|
7
|
+
return n == 0 || n != n ? n : n < 0 ? -1 : 1;
|
|
7
8
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var ceil = Math.ceil;
|
|
2
|
+
var floor = Math.floor;
|
|
3
|
+
|
|
4
|
+
// `Math.trunc` method
|
|
5
|
+
// https://tc39.es/ecma262/#sec-math.trunc
|
|
6
|
+
// eslint-disable-next-line es-x/no-math-trunc -- safe
|
|
7
|
+
module.exports = Math.trunc || function trunc(x) {
|
|
8
|
+
var n = +x;
|
|
9
|
+
return (n > 0 ? floor : ceil)(n);
|
|
10
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var global = require('../internals/global');
|
|
2
|
-
var
|
|
2
|
+
var defineGlobalProperty = require('../internals/define-global-property');
|
|
3
3
|
|
|
4
4
|
var SHARED = '__core-js_shared__';
|
|
5
|
-
var store = global[SHARED] ||
|
|
5
|
+
var store = global[SHARED] || defineGlobalProperty(SHARED, {});
|
|
6
6
|
|
|
7
7
|
module.exports = store;
|
package/internals/shared.js
CHANGED
|
@@ -4,9 +4,9 @@ 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.22.
|
|
7
|
+
version: '3.22.7',
|
|
8
8
|
mode: IS_PURE ? 'pure' : 'global',
|
|
9
9
|
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
10
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.22.
|
|
10
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.22.7/LICENSE',
|
|
11
11
|
source: 'https://github.com/zloirock/core-js'
|
|
12
12
|
});
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var floor = Math.floor;
|
|
1
|
+
var trunc = require('../internals/math-trunc');
|
|
3
2
|
|
|
4
3
|
// `ToIntegerOrInfinity` abstract operation
|
|
5
4
|
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
6
5
|
module.exports = function (argument) {
|
|
7
6
|
var number = +argument;
|
|
8
|
-
// eslint-disable-next-line no-self-compare --
|
|
9
|
-
return number !== number || number === 0 ? 0 : (number
|
|
7
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
8
|
+
return number !== number || number === 0 ? 0 : trunc(number);
|
|
10
9
|
};
|
package/modules/es.math.acosh.js
CHANGED
|
@@ -17,8 +17,9 @@ var FORCED = !$acosh
|
|
|
17
17
|
// https://tc39.es/ecma262/#sec-math.acosh
|
|
18
18
|
$({ target: 'Math', stat: true, forced: FORCED }, {
|
|
19
19
|
acosh: function acosh(x) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
var n = +x;
|
|
21
|
+
return n < 1 ? NaN : n > 94906265.62425156
|
|
22
|
+
? log(n) + LN2
|
|
23
|
+
: log1p(n - 1 + sqrt(n - 1) * sqrt(n + 1));
|
|
23
24
|
}
|
|
24
25
|
});
|
package/modules/es.math.asinh.js
CHANGED
|
@@ -6,7 +6,8 @@ var log = Math.log;
|
|
|
6
6
|
var sqrt = Math.sqrt;
|
|
7
7
|
|
|
8
8
|
function asinh(x) {
|
|
9
|
-
|
|
9
|
+
var n = +x;
|
|
10
|
+
return !isFinite(n) || n == 0 ? n : n < 0 ? -asinh(-n) : log(n + sqrt(n * n + 1));
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
// `Math.asinh` method
|
package/modules/es.math.atanh.js
CHANGED
|
@@ -9,6 +9,7 @@ var log = Math.log;
|
|
|
9
9
|
// Tor Browser bug: Math.atanh(-0) -> 0
|
|
10
10
|
$({ target: 'Math', stat: true, forced: !($atanh && 1 / $atanh(-0) < 0) }, {
|
|
11
11
|
atanh: function atanh(x) {
|
|
12
|
-
|
|
12
|
+
var n = +x;
|
|
13
|
+
return n == 0 ? n : log((1 + n) / (1 - n)) / 2;
|
|
13
14
|
}
|
|
14
15
|
});
|
package/modules/es.math.cbrt.js
CHANGED
package/modules/es.math.clz32.js
CHANGED
|
@@ -8,6 +8,7 @@ var LOG2E = Math.LOG2E;
|
|
|
8
8
|
// https://tc39.es/ecma262/#sec-math.clz32
|
|
9
9
|
$({ target: 'Math', stat: true }, {
|
|
10
10
|
clz32: function clz32(x) {
|
|
11
|
-
|
|
11
|
+
var n = x >>> 0;
|
|
12
|
+
return n ? 31 - floor(log(n + 0.5) * LOG2E) : 32;
|
|
12
13
|
}
|
|
13
14
|
});
|
package/modules/es.math.sinh.js
CHANGED
|
@@ -16,6 +16,7 @@ var FORCED = fails(function () {
|
|
|
16
16
|
// V8 near Chromium 38 has a problem with very small numbers
|
|
17
17
|
$({ target: 'Math', stat: true, forced: FORCED }, {
|
|
18
18
|
sinh: function sinh(x) {
|
|
19
|
-
|
|
19
|
+
var n = +x;
|
|
20
|
+
return abs(n) < 1 ? (expm1(n) - expm1(-n)) / 2 : (exp(n - 1) - exp(-n - 1)) * (E / 2);
|
|
20
21
|
}
|
|
21
22
|
});
|
package/modules/es.math.tanh.js
CHANGED
|
@@ -7,8 +7,9 @@ var exp = Math.exp;
|
|
|
7
7
|
// https://tc39.es/ecma262/#sec-math.tanh
|
|
8
8
|
$({ target: 'Math', stat: true }, {
|
|
9
9
|
tanh: function tanh(x) {
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
|
|
10
|
+
var n = +x;
|
|
11
|
+
var a = expm1(n);
|
|
12
|
+
var b = expm1(-n);
|
|
13
|
+
return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(n) + exp(-n));
|
|
13
14
|
}
|
|
14
15
|
});
|
package/modules/es.math.trunc.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
var $ = require('../internals/export');
|
|
2
|
-
|
|
3
|
-
var ceil = Math.ceil;
|
|
4
|
-
var floor = Math.floor;
|
|
2
|
+
var trunc = require('../internals/math-trunc');
|
|
5
3
|
|
|
6
4
|
// `Math.trunc` method
|
|
7
5
|
// https://tc39.es/ecma262/#sec-math.trunc
|
|
8
6
|
$({ target: 'Math', stat: true }, {
|
|
9
|
-
trunc:
|
|
10
|
-
return (it > 0 ? floor : ceil)(it);
|
|
11
|
-
}
|
|
7
|
+
trunc: trunc
|
|
12
8
|
});
|
|
@@ -4,6 +4,8 @@ var $ = require('../internals/export');
|
|
|
4
4
|
// https://github.com/tc39/proposal-Math.signbit
|
|
5
5
|
$({ target: 'Math', stat: true, forced: true }, {
|
|
6
6
|
signbit: function signbit(x) {
|
|
7
|
-
|
|
7
|
+
var n = +x;
|
|
8
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
9
|
+
return n == n && n == 0 ? 1 / n == -Infinity : n < 0;
|
|
8
10
|
}
|
|
9
11
|
});
|
|
@@ -9,7 +9,7 @@ var process = global.process;
|
|
|
9
9
|
|
|
10
10
|
// `queueMicrotask` method
|
|
11
11
|
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask
|
|
12
|
-
$({ global: true, enumerable: true,
|
|
12
|
+
$({ global: true, enumerable: true, dontCallGetSet: true }, {
|
|
13
13
|
queueMicrotask: function queueMicrotask(fn) {
|
|
14
14
|
validateArgumentsLength(arguments.length, 1);
|
|
15
15
|
aCallable(fn);
|
|
@@ -364,7 +364,7 @@ if (!USE_NATIVE_URL && isCallable(Headers)) {
|
|
|
364
364
|
};
|
|
365
365
|
|
|
366
366
|
if (isCallable(nativeFetch)) {
|
|
367
|
-
$({ global: true, enumerable: true,
|
|
367
|
+
$({ global: true, enumerable: true, dontCallGetSet: true, forced: true }, {
|
|
368
368
|
fetch: function fetch(input /* , init */) {
|
|
369
369
|
return nativeFetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
|
|
370
370
|
}
|
|
@@ -380,7 +380,7 @@ if (!USE_NATIVE_URL && isCallable(Headers)) {
|
|
|
380
380
|
RequestPrototype.constructor = RequestConstructor;
|
|
381
381
|
RequestConstructor.prototype = RequestPrototype;
|
|
382
382
|
|
|
383
|
-
$({ global: true, constructor: true,
|
|
383
|
+
$({ global: true, constructor: true, dontCallGetSet: true, forced: true }, {
|
|
384
384
|
Request: RequestConstructor
|
|
385
385
|
});
|
|
386
386
|
}
|