core-js 3.25.3 → 3.25.5
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/classof-raw.js +3 -3
- package/internals/function-uncurry-this-raw.js +11 -0
- package/internals/function-uncurry-this.js +7 -12
- package/internals/internal-state.js +9 -8
- package/internals/shared.js +2 -2
- package/modules/esnext.function.un-this.js +2 -2
- package/modules/web.structured-clone.js +8 -1
- package/package.json +1 -1
package/internals/classof-raw.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
1
|
+
var uncurryThisRaw = require('../internals/function-uncurry-this-raw');
|
|
2
2
|
|
|
3
|
-
var toString =
|
|
4
|
-
var stringSlice =
|
|
3
|
+
var toString = uncurryThisRaw({}.toString);
|
|
4
|
+
var stringSlice = uncurryThisRaw(''.slice);
|
|
5
5
|
|
|
6
6
|
module.exports = function (it) {
|
|
7
7
|
return stringSlice(toString(it), 8, -1);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var NATIVE_BIND = require('../internals/function-bind-native');
|
|
2
|
+
|
|
3
|
+
var FunctionPrototype = Function.prototype;
|
|
4
|
+
var call = FunctionPrototype.call;
|
|
5
|
+
var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
|
|
6
|
+
|
|
7
|
+
module.exports = function (fn) {
|
|
8
|
+
return NATIVE_BIND ? uncurryThisWithBind(fn) : function () {
|
|
9
|
+
return call.apply(fn, arguments);
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
var
|
|
1
|
+
var classofRaw = require('../internals/classof-raw');
|
|
2
|
+
var uncurryThisRaw = require('../internals/function-uncurry-this-raw');
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
module.exports = NATIVE_BIND ? function (fn) {
|
|
9
|
-
return fn && uncurryThis(fn);
|
|
10
|
-
} : function (fn) {
|
|
11
|
-
return fn && function () {
|
|
12
|
-
return call.apply(fn, arguments);
|
|
13
|
-
};
|
|
4
|
+
module.exports = function (fn) {
|
|
5
|
+
// Nashorn bug:
|
|
6
|
+
// https://github.com/zloirock/core-js/issues/1128
|
|
7
|
+
// https://github.com/zloirock/core-js/issues/1130
|
|
8
|
+
if (classofRaw(fn) === 'Function') return uncurryThisRaw(fn);
|
|
14
9
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
var NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection');
|
|
2
2
|
var global = require('../internals/global');
|
|
3
|
-
var uncurryThis = require('../internals/function-uncurry-this');
|
|
4
3
|
var isObject = require('../internals/is-object');
|
|
5
4
|
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
6
5
|
var hasOwn = require('../internals/has-own-property');
|
|
@@ -28,20 +27,22 @@ var getterFor = function (TYPE) {
|
|
|
28
27
|
|
|
29
28
|
if (NATIVE_WEAK_MAP || shared.state) {
|
|
30
29
|
var store = shared.state || (shared.state = new WeakMap());
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
31
|
+
store.get = store.get;
|
|
32
|
+
store.has = store.has;
|
|
33
|
+
store.set = store.set;
|
|
34
|
+
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
34
35
|
set = function (it, metadata) {
|
|
35
|
-
if (
|
|
36
|
+
if (store.has(it)) throw TypeError(OBJECT_ALREADY_INITIALIZED);
|
|
36
37
|
metadata.facade = it;
|
|
37
|
-
|
|
38
|
+
store.set(it, metadata);
|
|
38
39
|
return metadata;
|
|
39
40
|
};
|
|
40
41
|
get = function (it) {
|
|
41
|
-
return
|
|
42
|
+
return store.get(it) || {};
|
|
42
43
|
};
|
|
43
44
|
has = function (it) {
|
|
44
|
-
return
|
|
45
|
+
return store.has(it);
|
|
45
46
|
};
|
|
46
47
|
} else {
|
|
47
48
|
var STATE = sharedKey('state');
|
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.25.
|
|
7
|
+
version: '3.25.5',
|
|
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.25.
|
|
10
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE',
|
|
11
11
|
source: 'https://github.com/zloirock/core-js'
|
|
12
12
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var $ = require('../internals/export');
|
|
2
|
-
var
|
|
2
|
+
var uncurryThisRaw = require('../internals/function-uncurry-this-raw');
|
|
3
3
|
var aCallable = require('../internals/a-callable');
|
|
4
4
|
|
|
5
5
|
// `Function.prototype.unThis` method
|
|
6
6
|
// https://github.com/js-choi/proposal-function-un-this
|
|
7
7
|
$({ target: 'Function', proto: true, forced: true }, {
|
|
8
8
|
unThis: function unThis() {
|
|
9
|
-
return
|
|
9
|
+
return uncurryThisRaw(aCallable(this));
|
|
10
10
|
}
|
|
11
11
|
});
|
|
@@ -371,9 +371,13 @@ var structuredCloneInternal = function (value, map) {
|
|
|
371
371
|
} catch (error) {
|
|
372
372
|
throwUnpolyfillable(type);
|
|
373
373
|
} break;
|
|
374
|
+
case 'CropTarget':
|
|
374
375
|
case 'CryptoKey':
|
|
375
|
-
case '
|
|
376
|
+
case 'FileSystemDirectoryHandle':
|
|
377
|
+
case 'FileSystemFileHandle':
|
|
378
|
+
case 'FileSystemHandle':
|
|
376
379
|
case 'GPUCompilationInfo':
|
|
380
|
+
case 'GPUCompilationMessage':
|
|
377
381
|
case 'ImageBitmap':
|
|
378
382
|
case 'RTCCertificate':
|
|
379
383
|
case 'WebAssembly.Module':
|
|
@@ -472,6 +476,7 @@ var tryToTransfer = function (rawTransfer, map) {
|
|
|
472
476
|
} catch (error) { /* empty */ }
|
|
473
477
|
break;
|
|
474
478
|
case 'ArrayBuffer':
|
|
479
|
+
case 'MediaSourceHandle':
|
|
475
480
|
case 'MessagePort':
|
|
476
481
|
case 'OffscreenCanvas':
|
|
477
482
|
case 'ReadableStream':
|
|
@@ -485,6 +490,8 @@ var tryToTransfer = function (rawTransfer, map) {
|
|
|
485
490
|
}
|
|
486
491
|
};
|
|
487
492
|
|
|
493
|
+
// `structuredClone` method
|
|
494
|
+
// https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone
|
|
488
495
|
$({ global: true, enumerable: true, sham: !PROPER_TRANSFER, forced: FORCED_REPLACEMENT }, {
|
|
489
496
|
structuredClone: function structuredClone(value /* , { transfer } */) {
|
|
490
497
|
var options = validateArgumentsLength(arguments.length, 1) > 1 && !isNullOrUndefined(arguments[1]) ? anObject(arguments[1]) : undefined;
|