core-js-pure
Advanced tools
Comparing version 3.36.0 to 3.36.1
@@ -29,5 +29,5 @@ 'use strict'; | ||
if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) { | ||
result = IS_CONSTRUCTOR ? new this() : []; | ||
iterator = getIterator(O, iteratorMethod); | ||
next = iterator.next; | ||
result = IS_CONSTRUCTOR ? new this() : []; | ||
for (;!(step = call(next, iterator)).done; index++) { | ||
@@ -34,0 +34,0 @@ value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; |
'use strict'; | ||
/* eslint-disable no-proto -- safe */ | ||
var uncurryThisAccessor = require('../internals/function-uncurry-this-accessor'); | ||
var anObject = require('../internals/an-object'); | ||
var isObject = require('../internals/is-object'); | ||
var requireObjectCoercible = require('../internals/require-object-coercible'); | ||
var aPossiblePrototype = require('../internals/a-possible-prototype'); | ||
@@ -21,4 +22,5 @@ | ||
return function setPrototypeOf(O, proto) { | ||
anObject(O); | ||
requireObjectCoercible(O); | ||
aPossiblePrototype(proto); | ||
if (!isObject(O)) return O; | ||
if (CORRECT_SETTER) setter(O, proto); | ||
@@ -25,0 +27,0 @@ else O.__proto__ = proto; |
@@ -10,7 +10,7 @@ 'use strict'; | ||
(store.versions || (store.versions = [])).push({ | ||
version: '3.36.0', | ||
version: '3.36.1', | ||
mode: IS_PURE ? 'pure' : 'global', | ||
copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)', | ||
license: 'https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE', | ||
license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE', | ||
source: 'https://github.com/zloirock/core-js' | ||
}); |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var globalThis = require('../internals/global'); | ||
var isPrototypeOf = require('../internals/object-is-prototype-of'); | ||
@@ -13,6 +14,19 @@ var getPrototypeOf = require('../internals/object-get-prototype-of'); | ||
var wellKnownSymbol = require('../internals/well-known-symbol'); | ||
var fails = require('../internals/fails'); | ||
var IS_PURE = require('../internals/is-pure'); | ||
var NativeSuppressedError = globalThis.SuppressedError; | ||
var TO_STRING_TAG = wellKnownSymbol('toStringTag'); | ||
var $Error = Error; | ||
// https://github.com/oven-sh/bun/issues/9282 | ||
var WRONG_ARITY = !!NativeSuppressedError && NativeSuppressedError.length !== 3; | ||
// https://github.com/oven-sh/bun/issues/9283 | ||
var EXTRA_ARGS_SUPPORT = !!NativeSuppressedError && fails(function () { | ||
return NativeSuppressedError(1, 2, 3, { cause: 4 }).cause === 4; | ||
}); | ||
var PATCH = WRONG_ARITY || EXTRA_ARGS_SUPPORT; | ||
var $SuppressedError = function SuppressedError(error, suppressed, message) { | ||
@@ -22,3 +36,5 @@ var isInstance = isPrototypeOf(SuppressedErrorPrototype, this); | ||
if (setPrototypeOf) { | ||
that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : SuppressedErrorPrototype); | ||
that = PATCH && (!isInstance || getPrototypeOf(this) === SuppressedErrorPrototype) | ||
? new NativeSuppressedError() | ||
: setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : SuppressedErrorPrototype); | ||
} else { | ||
@@ -38,3 +54,3 @@ that = isInstance ? this : create(SuppressedErrorPrototype); | ||
var SuppressedErrorPrototype = $SuppressedError.prototype = create($Error.prototype, { | ||
var SuppressedErrorPrototype = $SuppressedError.prototype = PATCH ? NativeSuppressedError.prototype : create($Error.prototype, { | ||
constructor: createPropertyDescriptor(1, $SuppressedError), | ||
@@ -45,6 +61,8 @@ message: createPropertyDescriptor(1, ''), | ||
if (PATCH && !IS_PURE) SuppressedErrorPrototype.constructor = $SuppressedError; | ||
// `SuppressedError` constructor | ||
// https://github.com/tc39/proposal-explicit-resource-management | ||
$({ global: true, constructor: true, arity: 3 }, { | ||
$({ global: true, constructor: true, arity: 3, forced: PATCH }, { | ||
SuppressedError: $SuppressedError | ||
}); |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var globalThis = require('../internals/global'); | ||
var microtask = require('../internals/microtask'); | ||
var aCallable = require('../internals/a-callable'); | ||
var validateArgumentsLength = require('../internals/validate-arguments-length'); | ||
var fails = require('../internals/fails'); | ||
var DESCRIPTORS = require('../internals/descriptors'); | ||
// Bun ~ 1.0.30 bug | ||
// https://github.com/oven-sh/bun/issues/9249 | ||
var WRONG_ARITY = fails(function () { | ||
// getOwnPropertyDescriptor for prevent experimental warning in Node 11 | ||
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe | ||
return DESCRIPTORS && Object.getOwnPropertyDescriptor(globalThis, 'queueMicrotask').value.length !== 1; | ||
}); | ||
// `queueMicrotask` method | ||
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask | ||
$({ global: true, enumerable: true, dontCallGetSet: true }, { | ||
$({ global: true, enumerable: true, dontCallGetSet: true, forced: WRONG_ARITY }, { | ||
queueMicrotask: function queueMicrotask(fn) { | ||
@@ -11,0 +22,0 @@ validateArgumentsLength(arguments.length, 1); |
@@ -17,5 +17,11 @@ 'use strict'; | ||
// Bun ~ 1.0.30 bug | ||
// https://github.com/oven-sh/bun/issues/9250 | ||
var WRONG_ARITY = fails(function () { | ||
return URL.canParse.length !== 1; | ||
}); | ||
// `URL.canParse` method | ||
// https://url.spec.whatwg.org/#dom-url-canparse | ||
$({ target: 'URL', stat: true, forced: !THROWS_WITHOUT_ARGUMENTS }, { | ||
$({ target: 'URL', stat: true, forced: !THROWS_WITHOUT_ARGUMENTS || WRONG_ARITY }, { | ||
canParse: function canParse(url) { | ||
@@ -22,0 +28,0 @@ var length = validateArgumentsLength(arguments.length, 1); |
{ | ||
"name": "core-js-pure", | ||
"version": "3.36.0", | ||
"version": "3.36.1", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "description": "Standard library", |
1074305
27066