core-js-pure
Advanced tools
Comparing version 3.22.4 to 3.22.5
@@ -7,7 +7,7 @@ var IS_PURE = require('../internals/is-pure'); | ||
})('versions', []).push({ | ||
version: '3.22.4', | ||
version: '3.22.5', | ||
mode: IS_PURE ? 'pure' : 'global', | ||
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)', | ||
license: 'https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE', | ||
license: 'https://github.com/zloirock/core-js/blob/v3.22.5/LICENSE', | ||
source: 'https://github.com/zloirock/core-js' | ||
}); |
@@ -16,3 +16,3 @@ var $ = require('../internals/export'); | ||
// https://github.com/tc39/proposal-error-cause | ||
$({ global: true, arity: 2, forced: FORCED }, { | ||
$({ global: true, constructor: true, arity: 2, forced: FORCED }, { | ||
AggregateError: wrapErrorConstructorWithCause(AGGREGATE_ERROR, function (init) { | ||
@@ -19,0 +19,0 @@ // eslint-disable-next-line no-unused-vars -- required for functions `.length` |
@@ -52,4 +52,4 @@ 'use strict'; | ||
// https://tc39.es/ecma262/#sec-aggregate-error-constructor | ||
$({ global: true }, { | ||
$({ global: true, constructor: true, arity: 2 }, { | ||
AggregateError: $AggregateError | ||
}); |
@@ -7,4 +7,4 @@ var $ = require('../internals/export'); | ||
// https://tc39.es/ecma262/#sec-dataview-constructor | ||
$({ global: true, forced: !NATIVE_ARRAY_BUFFER }, { | ||
$({ global: true, constructor: true, forced: !NATIVE_ARRAY_BUFFER }, { | ||
DataView: ArrayBufferModule.DataView | ||
}); |
@@ -15,3 +15,3 @@ /* eslint-disable no-unused-vars -- required for functions `.length` */ | ||
O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED); | ||
$({ global: true, arity: 1, forced: FORCED }, O); | ||
$({ global: true, constructor: true, arity: 1, forced: FORCED }, O); | ||
}; | ||
@@ -23,3 +23,3 @@ | ||
O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED); | ||
$({ target: WEB_ASSEMBLY, stat: true, arity: 1, forced: FORCED }, O); | ||
$({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O); | ||
} | ||
@@ -26,0 +26,0 @@ }; |
@@ -283,3 +283,3 @@ 'use strict'; | ||
$({ global: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { | ||
$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { | ||
Promise: PromiseConstructor | ||
@@ -286,0 +286,0 @@ }); |
@@ -210,3 +210,3 @@ 'use strict'; | ||
$({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, { | ||
$({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, { | ||
Symbol: $Symbol | ||
@@ -213,0 +213,0 @@ }); |
@@ -27,4 +27,4 @@ 'use strict'; | ||
$({ global: true, forced: IS_PURE }, { | ||
$({ global: true, constructor: true, forced: IS_PURE }, { | ||
AsyncIterator: AsyncIteratorConstructor | ||
}); |
@@ -39,4 +39,4 @@ 'use strict'; | ||
$({ global: true, forced: FORCED }, { | ||
$({ global: true, constructor: true, forced: FORCED }, { | ||
Iterator: IteratorConstructor | ||
}); |
@@ -183,3 +183,3 @@ 'use strict'; | ||
$({ global: true, forced: OBSERVABLE_FORCED }, { | ||
$({ global: true, constructor: true, forced: OBSERVABLE_FORCED }, { | ||
Observable: $Observable | ||
@@ -186,0 +186,0 @@ }); |
@@ -114,3 +114,3 @@ 'use strict'; | ||
// https://webidl.spec.whatwg.org/#idl-DOMException | ||
$({ global: true, forced: FORCED_CONSTRUCTOR }, { | ||
$({ global: true, constructor: true, forced: FORCED_CONSTRUCTOR }, { | ||
DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException | ||
@@ -117,0 +117,0 @@ }); |
@@ -39,3 +39,3 @@ 'use strict'; | ||
// https://webidl.spec.whatwg.org/#es-DOMException-specialness | ||
$({ global: true, forced: IS_PURE || FORCED_CONSTRUCTOR }, { // TODO: fix export logic | ||
$({ global: true, constructor: true, forced: IS_PURE || FORCED_CONSTRUCTOR }, { // TODO: fix export logic | ||
DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException | ||
@@ -42,0 +42,0 @@ }); |
@@ -64,26 +64,38 @@ var IS_PURE = require('../internals/is-pure'); | ||
var checkErrorsCloning = function (structuredCloneImplementation) { | ||
return !fails(function () { | ||
var error = new Error(); | ||
var test = structuredCloneImplementation({ a: error, b: error }); | ||
return !(test && test.a === test.b && test.a instanceof Error); | ||
}); | ||
}; | ||
// https://github.com/whatwg/html/pull/5749 | ||
var checkNewErrorsSemantic = function (structuredCloneImplementation) { | ||
var checkNewErrorsCloningSemantic = function (structuredCloneImplementation) { | ||
return !fails(function () { | ||
var test = structuredCloneImplementation(new global.AggregateError([1], PERFORMANCE_MARK, { cause: 3 })); | ||
return test.name != 'AggregateError' || test.errors[0] != 1 || test.message != PERFORMANCE_MARK || test.cause != 3; | ||
}) && structuredCloneImplementation; | ||
}); | ||
}; | ||
// FF94+, Safari TP134+, Chrome Canary 98+, NodeJS 17.0+, Deno 1.13+ | ||
// current FF and Safari implementations can't clone errors | ||
// FF94+, Safari 15.4+, Chrome 98+, NodeJS 17.0+, Deno 1.13+ | ||
// FF and Safari implementations can't clone errors | ||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1556604 | ||
// Chrome <103 returns `null` if cloned object contains multiple references to one error | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=12542 | ||
// no one of current implementations supports new (html/5749) error cloning semantic | ||
var nativeStructuredClone = global.structuredClone; | ||
var FORCED_REPLACEMENT = IS_PURE || !checkNewErrorsSemantic(nativeStructuredClone); | ||
var FORCED_REPLACEMENT = IS_PURE || !checkErrorsCloning(nativeStructuredClone) || !checkNewErrorsCloningSemantic(nativeStructuredClone); | ||
// Chrome 82+, Safari 14.1+, Deno 1.11+ | ||
// Chrome 78-81 implementation swaps `.name` and `.message` of cloned `DOMException` | ||
// Chrome returns `null` if cloned object contains multiple references to one error | ||
// Safari 14.1 implementation doesn't clone some `RegExp` flags, so requires a workaround | ||
// current Safari implementation can't clone errors | ||
// Safari implementation can't clone errors | ||
// Deno 1.2-1.10 implementations too naive | ||
// NodeJS 16.0+ does not have `PerformanceMark` constructor, structured cloning implementation | ||
// from `performance.mark` is too naive and can't clone, for example, `RegExp` or some boxed primitives | ||
// https://github.com/nodejs/node/issues/40840 | ||
// NodeJS 16.0+ does not have `PerformanceMark` constructor | ||
// NodeJS <17.2 structured cloning implementation from `performance.mark` is too naive | ||
// and can't clone, for example, `RegExp` or some boxed primitives | ||
// https://github.com/nodejs/node/issues/40840 | ||
// no one of current implementations supports new (html/5749) error cloning semantic | ||
@@ -90,0 +102,0 @@ var structuredCloneFromMark = !nativeStructuredClone && checkBasicSemantic(function (value) { |
@@ -340,3 +340,3 @@ 'use strict'; | ||
$({ global: true, forced: !USE_NATIVE_URL }, { | ||
$({ global: true, constructor: true, forced: !USE_NATIVE_URL }, { | ||
URLSearchParams: URLSearchParamsConstructor | ||
@@ -384,3 +384,3 @@ }); | ||
$({ global: true, forced: true, noTargetGet: true }, { | ||
$({ global: true, constructor: true, noTargetGet: true, forced: true }, { | ||
Request: RequestConstructor | ||
@@ -387,0 +387,0 @@ }); |
@@ -1040,4 +1040,4 @@ 'use strict'; | ||
$({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, { | ||
$({ global: true, constructor: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, { | ||
URL: URLConstructor | ||
}); |
{ | ||
"name": "core-js-pure", | ||
"description": "Standard library", | ||
"version": "3.22.4", | ||
"version": "3.22.5", | ||
"repository": { | ||
@@ -56,4 +56,3 @@ "type": "git", | ||
"postinstall": "node -e \"try{require('./postinstall')}catch(e){}\"" | ||
}, | ||
"gitHead": "6ba79a5aada7286aa44ca9e4029cbb74dd84ffd6" | ||
} | ||
} |
868725
20285