core-js 3.22.2 → 3.22.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/array-buffer-view-core.js +4 -4
- package/internals/array-buffer.js +3 -3
- package/internals/async-from-sync-iterator.js +2 -2
- package/internals/async-iterator-create-proxy.js +2 -2
- package/internals/async-iterator-prototype.js +2 -2
- package/internals/collection-strong.js +3 -3
- package/internals/collection-weak.js +3 -3
- package/internals/collection.js +3 -3
- package/internals/define-built-in-accessor.js +8 -0
- package/internals/define-built-in.js +25 -0
- package/internals/define-built-ins.js +6 -0
- package/internals/define-iterator.js +4 -4
- package/internals/export.js +2 -3
- package/internals/fix-regexp-well-known-symbol-logic.js +3 -3
- package/internals/iterator-create-proxy.js +2 -2
- package/internals/iterators-core.js +2 -2
- package/internals/make-built-in.js +47 -0
- package/internals/shared.js +2 -2
- package/internals/symbol-define-to-primitive.js +3 -3
- package/internals/typed-array-constructor.js +3 -3
- package/modules/es.aggregate-error.cause.js +1 -1
- package/modules/es.aggregate-error.constructor.js +1 -1
- package/modules/es.array-buffer.constructor.js +1 -1
- package/modules/es.array.concat.js +1 -1
- package/modules/es.array.includes.js +7 -1
- package/modules/es.data-view.constructor.js +1 -1
- package/modules/es.date.to-json.js +1 -1
- package/modules/es.date.to-primitive.js +2 -2
- package/modules/es.date.to-string.js +2 -2
- package/modules/es.error.cause.js +2 -2
- package/modules/es.error.to-string.js +2 -2
- package/modules/es.function.has-instance.js +3 -2
- package/modules/es.json.stringify.js +1 -1
- package/modules/es.math.hypot.js +1 -1
- package/modules/es.number.constructor.js +2 -2
- package/modules/es.object.assign.js +1 -1
- package/modules/es.object.to-string.js +2 -2
- package/modules/es.promise.catch.js +2 -2
- package/modules/es.promise.constructor.js +17 -21
- package/modules/es.promise.finally.js +2 -2
- package/modules/es.regexp.constructor.js +2 -2
- package/modules/es.regexp.dot-all.js +3 -3
- package/modules/es.regexp.flags.js +2 -2
- package/modules/es.regexp.sticky.js +3 -3
- package/modules/es.regexp.to-string.js +2 -2
- package/modules/es.string.from-code-point.js +1 -1
- package/modules/es.string.match-all.js +2 -2
- package/modules/es.symbol.constructor.js +5 -5
- package/modules/es.symbol.description.js +1 -1
- package/modules/es.weak-map.constructor.js +2 -2
- package/modules/esnext.array.last-index.js +2 -2
- package/modules/esnext.array.last-item.js +2 -2
- package/modules/esnext.array.to-spliced.js +1 -1
- package/modules/esnext.async-iterator.constructor.js +1 -1
- package/modules/esnext.iterator.constructor.js +1 -1
- package/modules/esnext.map.merge.js +1 -1
- package/modules/esnext.observable.constructor.js +12 -12
- package/modules/esnext.typed-array.to-spliced.js +1 -1
- package/modules/web.dom-exception.constructor.js +10 -10
- package/modules/web.dom-exception.stack.js +1 -1
- package/modules/web.structured-clone.js +21 -9
- package/modules/web.url-search-params.constructor.js +7 -7
- package/modules/web.url.constructor.js +43 -45
- package/package.json +2 -3
- package/internals/redefine-all.js +0 -6
- package/internals/redefine.js +0 -46
|
@@ -7,8 +7,8 @@ var call = require('../internals/function-call');
|
|
|
7
7
|
var uncurryThis = require('../internals/function-uncurry-this');
|
|
8
8
|
var DESCRIPTORS = require('../internals/descriptors');
|
|
9
9
|
var USE_NATIVE_URL = require('../internals/native-url');
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var defineBuiltIn = require('../internals/define-built-in');
|
|
11
|
+
var defineBuiltIns = require('../internals/define-built-ins');
|
|
12
12
|
var setToStringTag = require('../internals/set-to-string-tag');
|
|
13
13
|
var createIteratorConstructor = require('../internals/create-iterator-constructor');
|
|
14
14
|
var InternalStateModule = require('../internals/internal-state');
|
|
@@ -208,7 +208,7 @@ var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
|
|
|
208
208
|
|
|
209
209
|
var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
|
|
210
210
|
|
|
211
|
-
|
|
211
|
+
defineBuiltIns(URLSearchParamsPrototype, {
|
|
212
212
|
// `URLSearchParams.prototype.append` method
|
|
213
213
|
// https://url.spec.whatwg.org/#dom-urlsearchparams-append
|
|
214
214
|
append: function append(name, value) {
|
|
@@ -327,17 +327,17 @@ redefineAll(URLSearchParamsPrototype, {
|
|
|
327
327
|
}, { enumerable: true });
|
|
328
328
|
|
|
329
329
|
// `URLSearchParams.prototype[@@iterator]` method
|
|
330
|
-
|
|
330
|
+
defineBuiltIn(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries, { name: 'entries' });
|
|
331
331
|
|
|
332
332
|
// `URLSearchParams.prototype.toString` method
|
|
333
333
|
// https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
|
|
334
|
-
|
|
334
|
+
defineBuiltIn(URLSearchParamsPrototype, 'toString', function toString() {
|
|
335
335
|
return getInternalParamsState(this).serialize();
|
|
336
336
|
}, { enumerable: true });
|
|
337
337
|
|
|
338
338
|
setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
|
|
339
339
|
|
|
340
|
-
$({ global: true, forced: !USE_NATIVE_URL }, {
|
|
340
|
+
$({ global: true, constructor: true, forced: !USE_NATIVE_URL }, {
|
|
341
341
|
URLSearchParams: URLSearchParamsConstructor
|
|
342
342
|
});
|
|
343
343
|
|
|
@@ -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,
|
|
383
|
+
$({ global: true, constructor: true, noTargetGet: true, forced: true }, {
|
|
384
384
|
Request: RequestConstructor
|
|
385
385
|
});
|
|
386
386
|
}
|
|
@@ -7,8 +7,8 @@ var USE_NATIVE_URL = require('../internals/native-url');
|
|
|
7
7
|
var global = require('../internals/global');
|
|
8
8
|
var bind = require('../internals/function-bind-context');
|
|
9
9
|
var uncurryThis = require('../internals/function-uncurry-this');
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var defineBuiltIn = require('../internals/define-built-in');
|
|
11
|
+
var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
|
|
12
12
|
var anInstance = require('../internals/an-instance');
|
|
13
13
|
var hasOwn = require('../internals/has-own-property');
|
|
14
14
|
var assign = require('../internals/object-assign');
|
|
@@ -974,55 +974,53 @@ var accessorDescriptor = function (getter, setter) {
|
|
|
974
974
|
};
|
|
975
975
|
|
|
976
976
|
if (DESCRIPTORS) {
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
hash: accessorDescriptor('getHash', 'setHash')
|
|
1014
|
-
});
|
|
977
|
+
// `URL.prototype.href` accessors pair
|
|
978
|
+
// https://url.spec.whatwg.org/#dom-url-href
|
|
979
|
+
defineBuiltInAccessor(URLPrototype, 'href', accessorDescriptor('serialize', 'setHref'));
|
|
980
|
+
// `URL.prototype.origin` getter
|
|
981
|
+
// https://url.spec.whatwg.org/#dom-url-origin
|
|
982
|
+
defineBuiltInAccessor(URLPrototype, 'origin', accessorDescriptor('getOrigin'));
|
|
983
|
+
// `URL.prototype.protocol` accessors pair
|
|
984
|
+
// https://url.spec.whatwg.org/#dom-url-protocol
|
|
985
|
+
defineBuiltInAccessor(URLPrototype, 'protocol', accessorDescriptor('getProtocol', 'setProtocol'));
|
|
986
|
+
// `URL.prototype.username` accessors pair
|
|
987
|
+
// https://url.spec.whatwg.org/#dom-url-username
|
|
988
|
+
defineBuiltInAccessor(URLPrototype, 'username', accessorDescriptor('getUsername', 'setUsername'));
|
|
989
|
+
// `URL.prototype.password` accessors pair
|
|
990
|
+
// https://url.spec.whatwg.org/#dom-url-password
|
|
991
|
+
defineBuiltInAccessor(URLPrototype, 'password', accessorDescriptor('getPassword', 'setPassword'));
|
|
992
|
+
// `URL.prototype.host` accessors pair
|
|
993
|
+
// https://url.spec.whatwg.org/#dom-url-host
|
|
994
|
+
defineBuiltInAccessor(URLPrototype, 'host', accessorDescriptor('getHost', 'setHost'));
|
|
995
|
+
// `URL.prototype.hostname` accessors pair
|
|
996
|
+
// https://url.spec.whatwg.org/#dom-url-hostname
|
|
997
|
+
defineBuiltInAccessor(URLPrototype, 'hostname', accessorDescriptor('getHostname', 'setHostname'));
|
|
998
|
+
// `URL.prototype.port` accessors pair
|
|
999
|
+
// https://url.spec.whatwg.org/#dom-url-port
|
|
1000
|
+
defineBuiltInAccessor(URLPrototype, 'port', accessorDescriptor('getPort', 'setPort'));
|
|
1001
|
+
// `URL.prototype.pathname` accessors pair
|
|
1002
|
+
// https://url.spec.whatwg.org/#dom-url-pathname
|
|
1003
|
+
defineBuiltInAccessor(URLPrototype, 'pathname', accessorDescriptor('getPathname', 'setPathname'));
|
|
1004
|
+
// `URL.prototype.search` accessors pair
|
|
1005
|
+
// https://url.spec.whatwg.org/#dom-url-search
|
|
1006
|
+
defineBuiltInAccessor(URLPrototype, 'search', accessorDescriptor('getSearch', 'setSearch'));
|
|
1007
|
+
// `URL.prototype.searchParams` getter
|
|
1008
|
+
// https://url.spec.whatwg.org/#dom-url-searchparams
|
|
1009
|
+
defineBuiltInAccessor(URLPrototype, 'searchParams', accessorDescriptor('getSearchParams'));
|
|
1010
|
+
// `URL.prototype.hash` accessors pair
|
|
1011
|
+
// https://url.spec.whatwg.org/#dom-url-hash
|
|
1012
|
+
defineBuiltInAccessor(URLPrototype, 'hash', accessorDescriptor('getHash', 'setHash'));
|
|
1015
1013
|
}
|
|
1016
1014
|
|
|
1017
1015
|
// `URL.prototype.toJSON` method
|
|
1018
1016
|
// https://url.spec.whatwg.org/#dom-url-tojson
|
|
1019
|
-
|
|
1017
|
+
defineBuiltIn(URLPrototype, 'toJSON', function toJSON() {
|
|
1020
1018
|
return getInternalURLState(this).serialize();
|
|
1021
1019
|
}, { enumerable: true });
|
|
1022
1020
|
|
|
1023
1021
|
// `URL.prototype.toString` method
|
|
1024
1022
|
// https://url.spec.whatwg.org/#URL-stringification-behavior
|
|
1025
|
-
|
|
1023
|
+
defineBuiltIn(URLPrototype, 'toString', function toString() {
|
|
1026
1024
|
return getInternalURLState(this).serialize();
|
|
1027
1025
|
}, { enumerable: true });
|
|
1028
1026
|
|
|
@@ -1031,14 +1029,14 @@ if (NativeURL) {
|
|
|
1031
1029
|
var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
|
|
1032
1030
|
// `URL.createObjectURL` method
|
|
1033
1031
|
// https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
|
|
1034
|
-
if (nativeCreateObjectURL)
|
|
1032
|
+
if (nativeCreateObjectURL) defineBuiltIn(URLConstructor, 'createObjectURL', bind(nativeCreateObjectURL, NativeURL));
|
|
1035
1033
|
// `URL.revokeObjectURL` method
|
|
1036
1034
|
// https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
|
|
1037
|
-
if (nativeRevokeObjectURL)
|
|
1035
|
+
if (nativeRevokeObjectURL) defineBuiltIn(URLConstructor, 'revokeObjectURL', bind(nativeRevokeObjectURL, NativeURL));
|
|
1038
1036
|
}
|
|
1039
1037
|
|
|
1040
1038
|
setToStringTag(URLConstructor, 'URL');
|
|
1041
1039
|
|
|
1042
|
-
$({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
|
|
1040
|
+
$({ global: true, constructor: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
|
|
1043
1041
|
URL: URLConstructor
|
|
1044
1042
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "core-js",
|
|
3
3
|
"description": "Standard library",
|
|
4
|
-
"version": "3.22.
|
|
4
|
+
"version": "3.22.5",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/zloirock/core-js.git"
|
|
@@ -53,6 +53,5 @@
|
|
|
53
53
|
],
|
|
54
54
|
"scripts": {
|
|
55
55
|
"postinstall": "node -e \"try{require('./postinstall')}catch(e){}\""
|
|
56
|
-
}
|
|
57
|
-
"gitHead": "c949d92f76531a2fc31f0fdf7fda6c86e258d9b1"
|
|
56
|
+
}
|
|
58
57
|
}
|
package/internals/redefine.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
var global = require('../internals/global');
|
|
2
|
-
var isCallable = require('../internals/is-callable');
|
|
3
|
-
var hasOwn = require('../internals/has-own-property');
|
|
4
|
-
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
5
|
-
var setGlobal = require('../internals/set-global');
|
|
6
|
-
var inspectSource = require('../internals/inspect-source');
|
|
7
|
-
var InternalStateModule = require('../internals/internal-state');
|
|
8
|
-
var CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE;
|
|
9
|
-
|
|
10
|
-
var getInternalState = InternalStateModule.get;
|
|
11
|
-
var enforceInternalState = InternalStateModule.enforce;
|
|
12
|
-
var TEMPLATE = String(String).split('String');
|
|
13
|
-
|
|
14
|
-
(module.exports = function (O, key, value, options) {
|
|
15
|
-
var unsafe = options ? !!options.unsafe : false;
|
|
16
|
-
var simple = options ? !!options.enumerable : false;
|
|
17
|
-
var noTargetGet = options ? !!options.noTargetGet : false;
|
|
18
|
-
var name = options && options.name !== undefined ? options.name : key;
|
|
19
|
-
var state;
|
|
20
|
-
if (isCallable(value)) {
|
|
21
|
-
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
22
|
-
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
23
|
-
}
|
|
24
|
-
if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
25
|
-
createNonEnumerableProperty(value, 'name', name);
|
|
26
|
-
}
|
|
27
|
-
state = enforceInternalState(value);
|
|
28
|
-
if (!state.source) {
|
|
29
|
-
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if (O === global) {
|
|
33
|
-
if (simple) O[key] = value;
|
|
34
|
-
else setGlobal(key, value);
|
|
35
|
-
return;
|
|
36
|
-
} else if (!unsafe) {
|
|
37
|
-
delete O[key];
|
|
38
|
-
} else if (!noTargetGet && O[key]) {
|
|
39
|
-
simple = true;
|
|
40
|
-
}
|
|
41
|
-
if (simple) O[key] = value;
|
|
42
|
-
else createNonEnumerableProperty(O, key, value);
|
|
43
|
-
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
44
|
-
})(Function.prototype, 'toString', function toString() {
|
|
45
|
-
return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
|
46
|
-
});
|