core-js-pure 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/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/define-built-in-accessor.js +5 -0
- package/internals/{redefine.js → define-built-in.js} +1 -0
- package/internals/{redefine-all.js → define-built-ins.js} +2 -2
- package/internals/define-iterator.js +4 -4
- package/internals/iterator-create-proxy.js +2 -2
- package/internals/iterators-core.js +2 -2
- package/internals/make-built-in.js +3 -0
- package/internals/shared.js +2 -2
- package/internals/symbol-define-to-primitive.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.concat.js +1 -1
- package/modules/es.array.includes.js +7 -1
- package/modules/es.data-view.constructor.js +1 -1
- package/modules/es.error.cause.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.object.assign.js +1 -1
- 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.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.weak-map.constructor.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/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
|
@@ -3,7 +3,7 @@ var apply = require('../internals/function-apply');
|
|
|
3
3
|
var anObject = require('../internals/an-object');
|
|
4
4
|
var create = require('../internals/object-create');
|
|
5
5
|
var getMethod = require('../internals/get-method');
|
|
6
|
-
var
|
|
6
|
+
var defineBuiltIns = require('../internals/define-built-ins');
|
|
7
7
|
var InternalStateModule = require('../internals/internal-state');
|
|
8
8
|
var getBuiltIn = require('../internals/get-built-in');
|
|
9
9
|
var AsyncIteratorPrototype = require('../internals/async-iterator-prototype');
|
|
@@ -29,7 +29,7 @@ var AsyncFromSyncIterator = function AsyncIterator(iterator) {
|
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
AsyncFromSyncIterator.prototype =
|
|
32
|
+
AsyncFromSyncIterator.prototype = defineBuiltIns(create(AsyncIteratorPrototype), {
|
|
33
33
|
next: function next(arg) {
|
|
34
34
|
var state = getInternalState(this);
|
|
35
35
|
var hasArg = !!arguments.length;
|
|
@@ -4,7 +4,7 @@ var aCallable = require('../internals/a-callable');
|
|
|
4
4
|
var anObject = require('../internals/an-object');
|
|
5
5
|
var create = require('../internals/object-create');
|
|
6
6
|
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
7
|
-
var
|
|
7
|
+
var defineBuiltIns = require('../internals/define-built-ins');
|
|
8
8
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
9
9
|
var InternalStateModule = require('../internals/internal-state');
|
|
10
10
|
var getBuiltIn = require('../internals/get-built-in');
|
|
@@ -28,7 +28,7 @@ module.exports = function (nextHandler, IS_ITERATOR) {
|
|
|
28
28
|
setInternalState(this, state);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
AsyncIteratorProxy.prototype =
|
|
31
|
+
AsyncIteratorProxy.prototype = defineBuiltIns(create(AsyncIteratorPrototype), {
|
|
32
32
|
next: function next(arg) {
|
|
33
33
|
var that = this;
|
|
34
34
|
var hasArgument = !!arguments.length;
|
|
@@ -3,7 +3,7 @@ var shared = require('../internals/shared-store');
|
|
|
3
3
|
var isCallable = require('../internals/is-callable');
|
|
4
4
|
var create = require('../internals/object-create');
|
|
5
5
|
var getPrototypeOf = require('../internals/object-get-prototype-of');
|
|
6
|
-
var
|
|
6
|
+
var defineBuiltIn = require('../internals/define-built-in');
|
|
7
7
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
8
8
|
var IS_PURE = require('../internals/is-pure');
|
|
9
9
|
|
|
@@ -29,7 +29,7 @@ if (!AsyncIteratorPrototype) AsyncIteratorPrototype = {};
|
|
|
29
29
|
else if (IS_PURE) AsyncIteratorPrototype = create(AsyncIteratorPrototype);
|
|
30
30
|
|
|
31
31
|
if (!isCallable(AsyncIteratorPrototype[ASYNC_ITERATOR])) {
|
|
32
|
-
|
|
32
|
+
defineBuiltIn(AsyncIteratorPrototype, ASYNC_ITERATOR, function () {
|
|
33
33
|
return this;
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var defineProperty = require('../internals/object-define-property').f;
|
|
3
3
|
var create = require('../internals/object-create');
|
|
4
|
-
var
|
|
4
|
+
var defineBuiltIns = require('../internals/define-built-ins');
|
|
5
5
|
var bind = require('../internals/function-bind-context');
|
|
6
6
|
var anInstance = require('../internals/an-instance');
|
|
7
7
|
var iterate = require('../internals/iterate');
|
|
@@ -71,7 +71,7 @@ module.exports = {
|
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
defineBuiltIns(Prototype, {
|
|
75
75
|
// `{ Map, Set }.prototype.clear()` methods
|
|
76
76
|
// https://tc39.es/ecma262/#sec-map.prototype.clear
|
|
77
77
|
// https://tc39.es/ecma262/#sec-set.prototype.clear
|
|
@@ -131,7 +131,7 @@ module.exports = {
|
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
defineBuiltIns(Prototype, IS_MAP ? {
|
|
135
135
|
// `Map.prototype.get(key)` method
|
|
136
136
|
// https://tc39.es/ecma262/#sec-map.prototype.get
|
|
137
137
|
get: function get(key) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var uncurryThis = require('../internals/function-uncurry-this');
|
|
3
|
-
var
|
|
3
|
+
var defineBuiltIns = require('../internals/define-built-ins');
|
|
4
4
|
var getWeakData = require('../internals/internal-metadata').getWeakData;
|
|
5
5
|
var anObject = require('../internals/an-object');
|
|
6
6
|
var isObject = require('../internals/is-object');
|
|
@@ -78,7 +78,7 @@ module.exports = {
|
|
|
78
78
|
return that;
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
defineBuiltIns(Prototype, {
|
|
82
82
|
// `{ WeakMap, WeakSet }.prototype.delete(key)` methods
|
|
83
83
|
// https://tc39.es/ecma262/#sec-weakmap.prototype.delete
|
|
84
84
|
// https://tc39.es/ecma262/#sec-weakset.prototype.delete
|
|
@@ -101,7 +101,7 @@ module.exports = {
|
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
defineBuiltIns(Prototype, IS_MAP ? {
|
|
105
105
|
// `WeakMap.prototype.get(key)` method
|
|
106
106
|
// https://tc39.es/ecma262/#sec-weakmap.prototype.get
|
|
107
107
|
get: function get(key) {
|
|
@@ -3,4 +3,5 @@ var createNonEnumerableProperty = require('../internals/create-non-enumerable-pr
|
|
|
3
3
|
module.exports = function (target, key, value, options) {
|
|
4
4
|
if (options && options.enumerable) target[key] = value;
|
|
5
5
|
else createNonEnumerableProperty(target, key, value);
|
|
6
|
+
return target;
|
|
6
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
1
|
+
var defineBuiltIn = require('../internals/define-built-in');
|
|
2
2
|
|
|
3
3
|
module.exports = function (target, src, options) {
|
|
4
4
|
for (var key in src) {
|
|
5
5
|
if (options && options.unsafe && target[key]) target[key] = src[key];
|
|
6
|
-
else
|
|
6
|
+
else defineBuiltIn(target, key, src[key], options);
|
|
7
7
|
} return target;
|
|
8
8
|
};
|
|
@@ -9,7 +9,7 @@ var getPrototypeOf = require('../internals/object-get-prototype-of');
|
|
|
9
9
|
var setPrototypeOf = require('../internals/object-set-prototype-of');
|
|
10
10
|
var setToStringTag = require('../internals/set-to-string-tag');
|
|
11
11
|
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
12
|
-
var
|
|
12
|
+
var defineBuiltIn = require('../internals/define-built-in');
|
|
13
13
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
14
14
|
var Iterators = require('../internals/iterators');
|
|
15
15
|
var IteratorsCore = require('../internals/iterators-core');
|
|
@@ -56,7 +56,7 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
|
|
|
56
56
|
if (setPrototypeOf) {
|
|
57
57
|
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
|
58
58
|
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
|
|
59
|
-
|
|
59
|
+
defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
// Set @@toStringTag to native iterators
|
|
@@ -84,14 +84,14 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
|
|
|
84
84
|
};
|
|
85
85
|
if (FORCED) for (KEY in methods) {
|
|
86
86
|
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
|
87
|
-
|
|
87
|
+
defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
|
|
88
88
|
}
|
|
89
89
|
} else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
// define iterator
|
|
93
93
|
if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
|
|
94
|
-
|
|
94
|
+
defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
|
|
95
95
|
}
|
|
96
96
|
Iterators[NAME] = defaultIterator;
|
|
97
97
|
|
|
@@ -4,7 +4,7 @@ var aCallable = require('../internals/a-callable');
|
|
|
4
4
|
var anObject = require('../internals/an-object');
|
|
5
5
|
var create = require('../internals/object-create');
|
|
6
6
|
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
7
|
-
var
|
|
7
|
+
var defineBuiltIns = require('../internals/define-built-ins');
|
|
8
8
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
9
9
|
var InternalStateModule = require('../internals/internal-state');
|
|
10
10
|
var getMethod = require('../internals/get-method');
|
|
@@ -25,7 +25,7 @@ module.exports = function (nextHandler, IS_ITERATOR) {
|
|
|
25
25
|
setInternalState(this, state);
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
IteratorProxy.prototype =
|
|
28
|
+
IteratorProxy.prototype = defineBuiltIns(create(IteratorPrototype), {
|
|
29
29
|
next: function next(arg) {
|
|
30
30
|
var state = getInternalState(this);
|
|
31
31
|
var args = arguments.length ? [state.ignoreArg ? undefined : arg] : IS_ITERATOR ? [] : [undefined];
|
|
@@ -3,7 +3,7 @@ var fails = require('../internals/fails');
|
|
|
3
3
|
var isCallable = require('../internals/is-callable');
|
|
4
4
|
var create = require('../internals/object-create');
|
|
5
5
|
var getPrototypeOf = require('../internals/object-get-prototype-of');
|
|
6
|
-
var
|
|
6
|
+
var defineBuiltIn = require('../internals/define-built-in');
|
|
7
7
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
8
8
|
var IS_PURE = require('../internals/is-pure');
|
|
9
9
|
|
|
@@ -37,7 +37,7 @@ else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
|
|
|
37
37
|
// `%IteratorPrototype%[@@iterator]()` method
|
|
38
38
|
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
39
39
|
if (!isCallable(IteratorPrototype[ITERATOR])) {
|
|
40
|
-
|
|
40
|
+
defineBuiltIn(IteratorPrototype, ITERATOR, function () {
|
|
41
41
|
return this;
|
|
42
42
|
});
|
|
43
43
|
}
|
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.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.22.
|
|
10
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.22.5/LICENSE',
|
|
11
11
|
source: 'https://github.com/zloirock/core-js'
|
|
12
12
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var call = require('../internals/function-call');
|
|
2
2
|
var getBuiltIn = require('../internals/get-built-in');
|
|
3
3
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
4
|
-
var
|
|
4
|
+
var defineBuiltIn = require('../internals/define-built-in');
|
|
5
5
|
|
|
6
6
|
module.exports = function () {
|
|
7
7
|
var Symbol = getBuiltIn('Symbol');
|
|
@@ -13,8 +13,8 @@ module.exports = function () {
|
|
|
13
13
|
// `Symbol.prototype[@@toPrimitive]` method
|
|
14
14
|
// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
|
|
15
15
|
// eslint-disable-next-line no-unused-vars -- required for .length
|
|
16
|
-
|
|
16
|
+
defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {
|
|
17
17
|
return call(valueOf, this);
|
|
18
|
-
});
|
|
18
|
+
}, { arity: 1 });
|
|
19
19
|
}
|
|
20
20
|
};
|
|
@@ -13,7 +13,7 @@ var FORCED = !fails(function () {
|
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
// https://github.com/tc39/proposal-error-cause
|
|
16
|
-
$({ global: true, forced: FORCED }, {
|
|
16
|
+
$({ global: true, constructor: true, arity: 2, forced: FORCED }, {
|
|
17
17
|
AggregateError: wrapErrorConstructorWithCause(AGGREGATE_ERROR, function (init) {
|
|
18
18
|
// eslint-disable-next-line no-unused-vars -- required for functions `.length`
|
|
19
19
|
return function AggregateError(errors, message) { return apply(init, this, arguments); };
|
|
@@ -49,6 +49,6 @@ var AggregateErrorPrototype = $AggregateError.prototype = create(Error.prototype
|
|
|
49
49
|
|
|
50
50
|
// `AggregateError` constructor
|
|
51
51
|
// https://tc39.es/ecma262/#sec-aggregate-error-constructor
|
|
52
|
-
$({ global: true }, {
|
|
52
|
+
$({ global: true, constructor: true, arity: 2 }, {
|
|
53
53
|
AggregateError: $AggregateError
|
|
54
54
|
});
|
|
@@ -39,7 +39,7 @@ var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
|
|
39
39
|
// `Array.prototype.concat` method
|
|
40
40
|
// https://tc39.es/ecma262/#sec-array.prototype.concat
|
|
41
41
|
// with adding support of @@isConcatSpreadable and @@species
|
|
42
|
-
$({ target: 'Array', proto: true, forced: FORCED }, {
|
|
42
|
+
$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
|
|
43
43
|
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
44
44
|
concat: function concat(arg) {
|
|
45
45
|
var O = toObject(this);
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var $ = require('../internals/export');
|
|
3
3
|
var $includes = require('../internals/array-includes').includes;
|
|
4
|
+
var fails = require('../internals/fails');
|
|
4
5
|
var addToUnscopables = require('../internals/add-to-unscopables');
|
|
5
6
|
|
|
7
|
+
// FF99+ bug
|
|
8
|
+
var BROKEN_ON_SPARSE = fails(function () {
|
|
9
|
+
return !Array(1).includes();
|
|
10
|
+
});
|
|
11
|
+
|
|
6
12
|
// `Array.prototype.includes` method
|
|
7
13
|
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
8
|
-
$({ target: 'Array', proto: true }, {
|
|
14
|
+
$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
|
|
9
15
|
includes: function includes(el /* , fromIndex = 0 */) {
|
|
10
16
|
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
|
11
17
|
}
|
|
@@ -4,6 +4,6 @@ var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native');
|
|
|
4
4
|
|
|
5
5
|
// `DataView` constructor
|
|
6
6
|
// https://tc39.es/ecma262/#sec-dataview-constructor
|
|
7
|
-
$({ global: true, forced: !NATIVE_ARRAY_BUFFER }, {
|
|
7
|
+
$({ global: true, constructor: true, forced: !NATIVE_ARRAY_BUFFER }, {
|
|
8
8
|
DataView: ArrayBufferModule.DataView
|
|
9
9
|
});
|
|
@@ -12,14 +12,14 @@ var FORCED = Error('e', { cause: 7 }).cause !== 7;
|
|
|
12
12
|
var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
|
|
13
13
|
var O = {};
|
|
14
14
|
O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);
|
|
15
|
-
$({ global: true, forced: FORCED }, O);
|
|
15
|
+
$({ global: true, constructor: true, arity: 1, forced: FORCED }, O);
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
|
|
19
19
|
if (WebAssembly && WebAssembly[ERROR_NAME]) {
|
|
20
20
|
var O = {};
|
|
21
21
|
O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);
|
|
22
|
-
$({ target: WEB_ASSEMBLY, stat: true, forced: FORCED }, O);
|
|
22
|
+
$({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -4,6 +4,7 @@ var isObject = require('../internals/is-object');
|
|
|
4
4
|
var definePropertyModule = require('../internals/object-define-property');
|
|
5
5
|
var getPrototypeOf = require('../internals/object-get-prototype-of');
|
|
6
6
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
7
|
+
var makeBuiltIn = require('../internals/make-built-in');
|
|
7
8
|
|
|
8
9
|
var HAS_INSTANCE = wellKnownSymbol('hasInstance');
|
|
9
10
|
var FunctionPrototype = Function.prototype;
|
|
@@ -11,12 +12,12 @@ var FunctionPrototype = Function.prototype;
|
|
|
11
12
|
// `Function.prototype[@@hasInstance]` method
|
|
12
13
|
// https://tc39.es/ecma262/#sec-function.prototype-@@hasinstance
|
|
13
14
|
if (!(HAS_INSTANCE in FunctionPrototype)) {
|
|
14
|
-
definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: function (O) {
|
|
15
|
+
definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: makeBuiltIn(function (O) {
|
|
15
16
|
if (!isCallable(this) || !isObject(O)) return false;
|
|
16
17
|
var P = this.prototype;
|
|
17
18
|
if (!isObject(P)) return O instanceof this;
|
|
18
19
|
// for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:
|
|
19
20
|
while (O = getPrototypeOf(O)) if (P === O) return true;
|
|
20
21
|
return false;
|
|
21
|
-
} });
|
|
22
|
+
}, HAS_INSTANCE) });
|
|
22
23
|
}
|
|
@@ -61,7 +61,7 @@ var fixIllFormed = function (match, offset, string) {
|
|
|
61
61
|
if ($stringify) {
|
|
62
62
|
// `JSON.stringify` method
|
|
63
63
|
// https://tc39.es/ecma262/#sec-json.stringify
|
|
64
|
-
$({ target: 'JSON', stat: true, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
|
|
64
|
+
$({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
|
|
65
65
|
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
66
66
|
stringify: function stringify(it, replacer, space) {
|
|
67
67
|
var args = arraySlice(arguments);
|
package/modules/es.math.hypot.js
CHANGED
|
@@ -11,7 +11,7 @@ var BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity;
|
|
|
11
11
|
|
|
12
12
|
// `Math.hypot` method
|
|
13
13
|
// https://tc39.es/ecma262/#sec-math.hypot
|
|
14
|
-
$({ target: 'Math', stat: true, forced: BUGGY }, {
|
|
14
|
+
$({ target: 'Math', stat: true, arity: 2, forced: BUGGY }, {
|
|
15
15
|
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
16
16
|
hypot: function hypot(value1, value2) {
|
|
17
17
|
var sum = 0;
|
|
@@ -4,6 +4,6 @@ var assign = require('../internals/object-assign');
|
|
|
4
4
|
// `Object.assign` method
|
|
5
5
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
6
6
|
// eslint-disable-next-line es-x/no-object-assign -- required for testing
|
|
7
|
-
$({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
|
|
7
|
+
$({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
|
8
8
|
assign: assign
|
|
9
9
|
});
|
|
@@ -5,7 +5,7 @@ var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detec
|
|
|
5
5
|
var NativePromiseConstructor = require('../internals/promise-native-constructor');
|
|
6
6
|
var getBuiltIn = require('../internals/get-built-in');
|
|
7
7
|
var isCallable = require('../internals/is-callable');
|
|
8
|
-
var
|
|
8
|
+
var defineBuiltIn = require('../internals/define-built-in');
|
|
9
9
|
|
|
10
10
|
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
|
11
11
|
|
|
@@ -21,6 +21,6 @@ $({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: tr
|
|
|
21
21
|
if (!IS_PURE && isCallable(NativePromiseConstructor)) {
|
|
22
22
|
var method = getBuiltIn('Promise').prototype['catch'];
|
|
23
23
|
if (NativePromisePrototype['catch'] !== method) {
|
|
24
|
-
|
|
24
|
+
defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -4,8 +4,7 @@ var IS_PURE = require('../internals/is-pure');
|
|
|
4
4
|
var IS_NODE = require('../internals/engine-is-node');
|
|
5
5
|
var global = require('../internals/global');
|
|
6
6
|
var call = require('../internals/function-call');
|
|
7
|
-
var
|
|
8
|
-
var redefineAll = require('../internals/redefine-all');
|
|
7
|
+
var defineBuiltIn = require('../internals/define-built-in');
|
|
9
8
|
var setPrototypeOf = require('../internals/object-set-prototype-of');
|
|
10
9
|
var setToStringTag = require('../internals/set-to-string-tag');
|
|
11
10
|
var setSpecies = require('../internals/set-species');
|
|
@@ -225,23 +224,20 @@ if (FORCED_PROMISE_CONSTRUCTOR) {
|
|
|
225
224
|
});
|
|
226
225
|
};
|
|
227
226
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
});
|
|
243
|
-
return reaction.promise;
|
|
244
|
-
}
|
|
227
|
+
// `Promise.prototype.then` method
|
|
228
|
+
// https://tc39.es/ecma262/#sec-promise.prototype.then
|
|
229
|
+
Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
|
230
|
+
var state = getInternalPromiseState(this);
|
|
231
|
+
var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
|
|
232
|
+
state.parent = true;
|
|
233
|
+
reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
|
|
234
|
+
reaction.fail = isCallable(onRejected) && onRejected;
|
|
235
|
+
reaction.domain = IS_NODE ? process.domain : undefined;
|
|
236
|
+
if (state.state == PENDING) state.reactions.add(reaction);
|
|
237
|
+
else microtask(function () {
|
|
238
|
+
callReaction(reaction, state);
|
|
239
|
+
});
|
|
240
|
+
return reaction.promise;
|
|
245
241
|
});
|
|
246
242
|
|
|
247
243
|
OwnPromiseCapability = function () {
|
|
@@ -263,7 +259,7 @@ if (FORCED_PROMISE_CONSTRUCTOR) {
|
|
|
263
259
|
|
|
264
260
|
if (!NATIVE_PROMISE_SUBCLASSING) {
|
|
265
261
|
// make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
|
|
266
|
-
|
|
262
|
+
defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
|
267
263
|
var that = this;
|
|
268
264
|
return new PromiseConstructor(function (resolve, reject) {
|
|
269
265
|
call(nativeThen, that, resolve, reject);
|
|
@@ -284,7 +280,7 @@ if (FORCED_PROMISE_CONSTRUCTOR) {
|
|
|
284
280
|
}
|
|
285
281
|
}
|
|
286
282
|
|
|
287
|
-
$({ global: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
|
|
283
|
+
$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
|
|
288
284
|
Promise: PromiseConstructor
|
|
289
285
|
});
|
|
290
286
|
|
|
@@ -7,7 +7,7 @@ var getBuiltIn = require('../internals/get-built-in');
|
|
|
7
7
|
var isCallable = require('../internals/is-callable');
|
|
8
8
|
var speciesConstructor = require('../internals/species-constructor');
|
|
9
9
|
var promiseResolve = require('../internals/promise-resolve');
|
|
10
|
-
var
|
|
10
|
+
var defineBuiltIn = require('../internals/define-built-in');
|
|
11
11
|
|
|
12
12
|
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
|
13
13
|
|
|
@@ -38,6 +38,6 @@ $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
|
|
|
38
38
|
if (!IS_PURE && isCallable(NativePromiseConstructor)) {
|
|
39
39
|
var method = getBuiltIn('Promise').prototype['finally'];
|
|
40
40
|
if (NativePromisePrototype['finally'] !== method) {
|
|
41
|
-
|
|
41
|
+
defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -14,7 +14,7 @@ var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length != 1;
|
|
|
14
14
|
|
|
15
15
|
// `String.fromCodePoint` method
|
|
16
16
|
// https://tc39.es/ecma262/#sec-string.fromcodepoint
|
|
17
|
-
$({ target: 'String', stat: true, forced: INCORRECT_LENGTH }, {
|
|
17
|
+
$({ target: 'String', stat: true, arity: 1, forced: INCORRECT_LENGTH }, {
|
|
18
18
|
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
19
19
|
fromCodePoint: function fromCodePoint(x) {
|
|
20
20
|
var elements = [];
|
|
@@ -13,7 +13,7 @@ var classof = require('../internals/classof-raw');
|
|
|
13
13
|
var isRegExp = require('../internals/is-regexp');
|
|
14
14
|
var getRegExpFlags = require('../internals/regexp-get-flags');
|
|
15
15
|
var getMethod = require('../internals/get-method');
|
|
16
|
-
var
|
|
16
|
+
var defineBuiltIn = require('../internals/define-built-in');
|
|
17
17
|
var fails = require('../internals/fails');
|
|
18
18
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
19
19
|
var speciesConstructor = require('../internals/species-constructor');
|
|
@@ -95,4 +95,4 @@ $({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, {
|
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
-
IS_PURE || MATCH_ALL in RegExpPrototype ||
|
|
98
|
+
IS_PURE || MATCH_ALL in RegExpPrototype || defineBuiltIn(RegExpPrototype, MATCH_ALL, $matchAll);
|
|
@@ -23,7 +23,7 @@ var getOwnPropertyDescriptorModule = require('../internals/object-get-own-proper
|
|
|
23
23
|
var definePropertyModule = require('../internals/object-define-property');
|
|
24
24
|
var definePropertiesModule = require('../internals/object-define-properties');
|
|
25
25
|
var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');
|
|
26
|
-
var
|
|
26
|
+
var defineBuiltIn = require('../internals/define-built-in');
|
|
27
27
|
var shared = require('../internals/shared');
|
|
28
28
|
var sharedKey = require('../internals/shared-key');
|
|
29
29
|
var hiddenKeys = require('../internals/hidden-keys');
|
|
@@ -174,11 +174,11 @@ if (!NATIVE_SYMBOL) {
|
|
|
174
174
|
|
|
175
175
|
SymbolPrototype = $Symbol[PROTOTYPE];
|
|
176
176
|
|
|
177
|
-
|
|
177
|
+
defineBuiltIn(SymbolPrototype, 'toString', function toString() {
|
|
178
178
|
return getInternalState(this).tag;
|
|
179
179
|
});
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
defineBuiltIn($Symbol, 'withoutSetter', function (description) {
|
|
182
182
|
return wrap(uid(description), description);
|
|
183
183
|
});
|
|
184
184
|
|
|
@@ -202,12 +202,12 @@ if (!NATIVE_SYMBOL) {
|
|
|
202
202
|
}
|
|
203
203
|
});
|
|
204
204
|
if (!IS_PURE) {
|
|
205
|
-
|
|
205
|
+
defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
$({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
|
|
210
|
+
$({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
|
|
211
211
|
Symbol: $Symbol
|
|
212
212
|
});
|
|
213
213
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var global = require('../internals/global');
|
|
3
3
|
var uncurryThis = require('../internals/function-uncurry-this');
|
|
4
|
-
var
|
|
4
|
+
var defineBuiltIns = require('../internals/define-built-ins');
|
|
5
5
|
var InternalMetadataModule = require('../internals/internal-metadata');
|
|
6
6
|
var collection = require('../internals/collection');
|
|
7
7
|
var collectionWeak = require('../internals/collection-weak');
|
|
@@ -34,7 +34,7 @@ if (NATIVE_WEAK_MAP && IS_IE11) {
|
|
|
34
34
|
var nativeHas = uncurryThis(WeakMapPrototype.has);
|
|
35
35
|
var nativeGet = uncurryThis(WeakMapPrototype.get);
|
|
36
36
|
var nativeSet = uncurryThis(WeakMapPrototype.set);
|
|
37
|
-
|
|
37
|
+
defineBuiltIns(WeakMapPrototype, {
|
|
38
38
|
'delete': function (key) {
|
|
39
39
|
if (isObject(key) && !isExtensible(key)) {
|
|
40
40
|
var state = enforceInternalState(this);
|
|
@@ -10,7 +10,7 @@ var Array = global.Array;
|
|
|
10
10
|
|
|
11
11
|
// `Array.prototype.toSpliced` method
|
|
12
12
|
// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toSpliced
|
|
13
|
-
$({ target: 'Array', proto: true }, {
|
|
13
|
+
$({ target: 'Array', proto: true, arity: 2 }, {
|
|
14
14
|
// eslint-disable-next-line no-unused-vars -- required for .length
|
|
15
15
|
toSpliced: function toSpliced(start, deleteCount /* , ...items */) {
|
|
16
16
|
return arrayToSpliced(toIndexedObject(this), Array, arraySlice(arguments));
|
|
@@ -24,6 +24,6 @@ if (IS_PURE || !hasOwn(AsyncIteratorPrototype, 'constructor') || AsyncIteratorPr
|
|
|
24
24
|
createNonEnumerableProperty(AsyncIteratorPrototype, 'constructor', AsyncIteratorConstructor);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
$({ global: true, forced: IS_PURE }, {
|
|
27
|
+
$({ global: true, constructor: true, forced: IS_PURE }, {
|
|
28
28
|
AsyncIterator: AsyncIteratorConstructor
|
|
29
29
|
});
|
|
@@ -36,6 +36,6 @@ if (FORCED || !hasOwn(IteratorPrototype, 'constructor') || IteratorPrototype.con
|
|
|
36
36
|
|
|
37
37
|
IteratorConstructor.prototype = IteratorPrototype;
|
|
38
38
|
|
|
39
|
-
$({ global: true, forced: FORCED }, {
|
|
39
|
+
$({ global: true, constructor: true, forced: FORCED }, {
|
|
40
40
|
Iterator: IteratorConstructor
|
|
41
41
|
});
|
|
@@ -6,7 +6,7 @@ var iterate = require('../internals/iterate');
|
|
|
6
6
|
|
|
7
7
|
// `Map.prototype.merge` method
|
|
8
8
|
// https://github.com/tc39/proposal-collection-methods
|
|
9
|
-
$({ target: 'Map', proto: true, real: true, forced: true }, {
|
|
9
|
+
$({ target: 'Map', proto: true, real: true, arity: 1, forced: true }, {
|
|
10
10
|
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
11
11
|
merge: function merge(iterable /* ...iterables */) {
|
|
12
12
|
var map = anObject(this);
|
|
@@ -10,9 +10,9 @@ var anObject = require('../internals/an-object');
|
|
|
10
10
|
var isObject = require('../internals/is-object');
|
|
11
11
|
var anInstance = require('../internals/an-instance');
|
|
12
12
|
var getMethod = require('../internals/get-method');
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
13
|
+
var defineBuiltIn = require('../internals/define-built-in');
|
|
14
|
+
var defineBuiltIns = require('../internals/define-built-ins');
|
|
15
|
+
var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
|
|
16
16
|
var hostReportErrors = require('../internals/host-report-errors');
|
|
17
17
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
18
18
|
var InternalStateModule = require('../internals/internal-state');
|
|
@@ -83,7 +83,7 @@ var Subscription = function (observer, subscriber) {
|
|
|
83
83
|
} if (subscriptionState.isClosed()) subscriptionState.clean();
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
Subscription.prototype =
|
|
86
|
+
Subscription.prototype = defineBuiltIns({}, {
|
|
87
87
|
unsubscribe: function unsubscribe() {
|
|
88
88
|
var subscriptionState = getSubscriptionInternalState(this);
|
|
89
89
|
if (!subscriptionState.isClosed()) {
|
|
@@ -93,9 +93,9 @@ Subscription.prototype = redefineAll({}, {
|
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
if (DESCRIPTORS)
|
|
96
|
+
if (DESCRIPTORS) defineBuiltInAccessor(Subscription.prototype, 'closed', {
|
|
97
97
|
configurable: true,
|
|
98
|
-
get: function () {
|
|
98
|
+
get: function closed() {
|
|
99
99
|
return getSubscriptionInternalState(this).isClosed();
|
|
100
100
|
}
|
|
101
101
|
});
|
|
@@ -108,7 +108,7 @@ var SubscriptionObserver = function (subscriptionState) {
|
|
|
108
108
|
if (!DESCRIPTORS) this.closed = false;
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
-
SubscriptionObserver.prototype =
|
|
111
|
+
SubscriptionObserver.prototype = defineBuiltIns({}, {
|
|
112
112
|
next: function next(value) {
|
|
113
113
|
var subscriptionState = getSubscriptionObserverInternalState(this).subscriptionState;
|
|
114
114
|
if (!subscriptionState.isClosed()) {
|
|
@@ -150,9 +150,9 @@ SubscriptionObserver.prototype = redefineAll({}, {
|
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
|
|
153
|
-
if (DESCRIPTORS)
|
|
153
|
+
if (DESCRIPTORS) defineBuiltInAccessor(SubscriptionObserver.prototype, 'closed', {
|
|
154
154
|
configurable: true,
|
|
155
|
-
get: function () {
|
|
155
|
+
get: function closed() {
|
|
156
156
|
return getSubscriptionObserverInternalState(this).subscriptionState.isClosed();
|
|
157
157
|
}
|
|
158
158
|
});
|
|
@@ -167,7 +167,7 @@ var $Observable = function Observable(subscriber) {
|
|
|
167
167
|
|
|
168
168
|
var ObservablePrototype = $Observable.prototype;
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
defineBuiltIns(ObservablePrototype, {
|
|
171
171
|
subscribe: function subscribe(observer) {
|
|
172
172
|
var length = arguments.length;
|
|
173
173
|
return new Subscription(isCallable(observer) ? {
|
|
@@ -178,9 +178,9 @@ redefineAll(ObservablePrototype, {
|
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
defineBuiltIn(ObservablePrototype, $$OBSERVABLE, function () { return this; });
|
|
182
182
|
|
|
183
|
-
$({ global: true, forced: OBSERVABLE_FORCED }, {
|
|
183
|
+
$({ global: true, constructor: true, forced: OBSERVABLE_FORCED }, {
|
|
184
184
|
Observable: $Observable
|
|
185
185
|
});
|
|
186
186
|
|
|
@@ -6,8 +6,8 @@ var fails = require('../internals/fails');
|
|
|
6
6
|
var create = require('../internals/object-create');
|
|
7
7
|
var createPropertyDescriptor = require('../internals/create-property-descriptor');
|
|
8
8
|
var defineProperty = require('../internals/object-define-property').f;
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var defineBuiltIn = require('../internals/define-built-in');
|
|
10
|
+
var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
|
|
11
11
|
var hasOwn = require('../internals/has-own-property');
|
|
12
12
|
var anInstance = require('../internals/an-instance');
|
|
13
13
|
var anObject = require('../internals/an-object');
|
|
@@ -79,11 +79,11 @@ var getterFor = function (key) {
|
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
-
if (DESCRIPTORS)
|
|
83
|
-
|
|
84
|
-
message
|
|
85
|
-
|
|
86
|
-
}
|
|
82
|
+
if (DESCRIPTORS) {
|
|
83
|
+
defineBuiltInAccessor(DOMExceptionPrototype, 'code', getterFor('code'));
|
|
84
|
+
defineBuiltInAccessor(DOMExceptionPrototype, 'message', getterFor('message'));
|
|
85
|
+
defineBuiltInAccessor(DOMExceptionPrototype, 'name', getterFor('name'));
|
|
86
|
+
}
|
|
87
87
|
|
|
88
88
|
defineProperty(DOMExceptionPrototype, 'constructor', createPropertyDescriptor(1, $DOMException));
|
|
89
89
|
|
|
@@ -111,7 +111,7 @@ var FORCED_CONSTRUCTOR = IS_PURE ? INCORRECT_TO_STRING || INCORRECT_CODE || MISS
|
|
|
111
111
|
|
|
112
112
|
// `DOMException` constructor
|
|
113
113
|
// https://webidl.spec.whatwg.org/#idl-DOMException
|
|
114
|
-
$({ global: true, forced: FORCED_CONSTRUCTOR }, {
|
|
114
|
+
$({ global: true, constructor: true, forced: FORCED_CONSTRUCTOR }, {
|
|
115
115
|
DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException
|
|
116
116
|
});
|
|
117
117
|
|
|
@@ -119,11 +119,11 @@ var PolyfilledDOMException = getBuiltIn(DOM_EXCEPTION);
|
|
|
119
119
|
var PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype;
|
|
120
120
|
|
|
121
121
|
if (INCORRECT_TO_STRING && (IS_PURE || NativeDOMException === PolyfilledDOMException)) {
|
|
122
|
-
|
|
122
|
+
defineBuiltIn(PolyfilledDOMExceptionPrototype, 'toString', errorToString);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
if (INCORRECT_CODE && DESCRIPTORS && NativeDOMException === PolyfilledDOMException) {
|
|
126
|
-
|
|
126
|
+
defineBuiltInAccessor(PolyfilledDOMExceptionPrototype, 'code', createGetterDescriptor(function () {
|
|
127
127
|
return codeFor(anObject(this).name);
|
|
128
128
|
}));
|
|
129
129
|
}
|
|
@@ -36,7 +36,7 @@ var FORCED_CONSTRUCTOR = ERROR_HAS_STACK && !DOM_EXCEPTION_HAS_STACK;
|
|
|
36
36
|
|
|
37
37
|
// `DOMException` constructor patch for `.stack` where it's required
|
|
38
38
|
// https://webidl.spec.whatwg.org/#es-DOMException-specialness
|
|
39
|
-
$({ global: true, forced: IS_PURE || FORCED_CONSTRUCTOR }, { // TODO: fix export logic
|
|
39
|
+
$({ global: true, constructor: true, forced: IS_PURE || FORCED_CONSTRUCTOR }, { // TODO: fix export logic
|
|
40
40
|
DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException
|
|
41
41
|
});
|
|
42
42
|
|
|
@@ -61,30 +61,42 @@ var checkBasicSemantic = function (structuredCloneImplementation) {
|
|
|
61
61
|
}) && structuredCloneImplementation;
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
+
var checkErrorsCloning = function (structuredCloneImplementation) {
|
|
65
|
+
return !fails(function () {
|
|
66
|
+
var error = new Error();
|
|
67
|
+
var test = structuredCloneImplementation({ a: error, b: error });
|
|
68
|
+
return !(test && test.a === test.b && test.a instanceof Error);
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
64
72
|
// https://github.com/whatwg/html/pull/5749
|
|
65
|
-
var
|
|
73
|
+
var checkNewErrorsCloningSemantic = function (structuredCloneImplementation) {
|
|
66
74
|
return !fails(function () {
|
|
67
75
|
var test = structuredCloneImplementation(new global.AggregateError([1], PERFORMANCE_MARK, { cause: 3 }));
|
|
68
76
|
return test.name != 'AggregateError' || test.errors[0] != 1 || test.message != PERFORMANCE_MARK || test.cause != 3;
|
|
69
|
-
})
|
|
77
|
+
});
|
|
70
78
|
};
|
|
71
79
|
|
|
72
|
-
// FF94+, Safari
|
|
73
|
-
//
|
|
80
|
+
// FF94+, Safari 15.4+, Chrome 98+, NodeJS 17.0+, Deno 1.13+
|
|
81
|
+
// FF and Safari implementations can't clone errors
|
|
74
82
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1556604
|
|
83
|
+
// Chrome <103 returns `null` if cloned object contains multiple references to one error
|
|
84
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=12542
|
|
75
85
|
// no one of current implementations supports new (html/5749) error cloning semantic
|
|
76
86
|
var nativeStructuredClone = global.structuredClone;
|
|
77
87
|
|
|
78
|
-
var FORCED_REPLACEMENT = IS_PURE || !
|
|
88
|
+
var FORCED_REPLACEMENT = IS_PURE || !checkErrorsCloning(nativeStructuredClone) || !checkNewErrorsCloningSemantic(nativeStructuredClone);
|
|
79
89
|
|
|
80
90
|
// Chrome 82+, Safari 14.1+, Deno 1.11+
|
|
81
91
|
// Chrome 78-81 implementation swaps `.name` and `.message` of cloned `DOMException`
|
|
92
|
+
// Chrome returns `null` if cloned object contains multiple references to one error
|
|
82
93
|
// Safari 14.1 implementation doesn't clone some `RegExp` flags, so requires a workaround
|
|
83
|
-
//
|
|
94
|
+
// Safari implementation can't clone errors
|
|
84
95
|
// Deno 1.2-1.10 implementations too naive
|
|
85
|
-
// NodeJS 16.0+ does not have `PerformanceMark` constructor
|
|
86
|
-
//
|
|
87
|
-
//
|
|
96
|
+
// NodeJS 16.0+ does not have `PerformanceMark` constructor
|
|
97
|
+
// NodeJS <17.2 structured cloning implementation from `performance.mark` is too naive
|
|
98
|
+
// and can't clone, for example, `RegExp` or some boxed primitives
|
|
99
|
+
// https://github.com/nodejs/node/issues/40840
|
|
88
100
|
// no one of current implementations supports new (html/5749) error cloning semantic
|
|
89
101
|
var structuredCloneFromMark = !nativeStructuredClone && checkBasicSemantic(function (value) {
|
|
90
102
|
return new PerformanceMark(PERFORMANCE_MARK, { detail: value }).detail;
|
|
@@ -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-pure",
|
|
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
|
}
|