This commit is contained in:
Denis Pushkarev
2025-10-09 21:46:57 +03:00
parent 2a4cacb9b9
commit e8a2545cc7
14 changed files with 77 additions and 55 deletions
+4
View File
@@ -1,5 +1,9 @@
# Changelog
### Unreleased
- Nothing
### [3.46.0 - 2025.10.09](https://github.com/zloirock/core-js/releases/tag/v3.46.0)
- Changes [v3.45.1...v3.46.0](https://github.com/zloirock/core-js/compare/v3.45.1...v3.46.0) (116 commits)
- [`Map` upsert stage 3 proposal](https://github.com/tc39/proposal-upsert):
- Fixed [a FF `WeakMap.prototype.getOrInsertComputed` bug with callback calling before validation a key](https://bugzilla.mozilla.org/show_bug.cgi?id=1988369)
- [`Iterator` chunking proposal](https://github.com/tc39/proposal-iterator-chunking):
+7 -7
View File
@@ -222,11 +222,11 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
### Installation:[⬆](#index)
```sh
// global version
npm install --save core-js@3.45.1
npm install --save core-js@3.46.0
// version without global namespace pollution
npm install --save core-js-pure@3.45.1
npm install --save core-js-pure@3.46.0
// bundled global version
npm install --save core-js-bundle@3.45.1
npm install --save core-js-bundle@3.46.0
```
Or you can use `core-js` [from CDN](https://www.jsdelivr.com/package/npm/core-js-bundle).
@@ -324,10 +324,10 @@ import 'regenerator-runtime/runtime';
#### `@babel/preset-env`[⬆](#index)
[`@babel/preset-env`](https://github.com/babel/babel/tree/master/packages/babel-preset-env) has `useBuiltIns` option, which optimizes the use of the global version of `core-js`. With `useBuiltIns` option, you should also set `corejs` option to the used version of `core-js`, like `corejs: '3.45'`.
[`@babel/preset-env`](https://github.com/babel/babel/tree/master/packages/babel-preset-env) has `useBuiltIns` option, which optimizes the use of the global version of `core-js`. With `useBuiltIns` option, you should also set `corejs` option to the used version of `core-js`, like `corejs: '3.46'`.
> [!IMPORTANT]
> It is recommended to specify the used minor `core-js` version, like `corejs: '3.45'`, instead of `corejs: 3`, since with `corejs: 3` will not be injected modules which were added in minor `core-js` releases.
> It is recommended to specify the used minor `core-js` version, like `corejs: '3.46'`, instead of `corejs: 3`, since with `corejs: 3` will not be injected modules which were added in minor `core-js` releases.
---
@@ -388,7 +388,7 @@ import 'core-js/modules/es.array.of';
var array = Array.of(1, 2, 3);
```
By default, `@babel/preset-env` with `useBuiltIns: 'usage'` option only polyfills stable features, but you can enable polyfilling of proposals by the `proposals` option, as `corejs: { version: '3.45', proposals: true }`.
By default, `@babel/preset-env` with `useBuiltIns: 'usage'` option only polyfills stable features, but you can enable polyfilling of proposals by the `proposals` option, as `corejs: { version: '3.46', proposals: true }`.
> [!IMPORTANT]
> In the case of `useBuiltIns: 'usage'`, you should not add `core-js` imports by yourself, they will be added automatically.
@@ -426,7 +426,7 @@ Fast JavaScript transpiler `swc` [contains integration with `core-js`](https://s
"env": {
"targets": "> 0.25%, not dead",
"mode": "entry",
"coreJs": "3.45"
"coreJs": "3.46"
}
}
```
+1 -1
View File
@@ -29,7 +29,7 @@
*Example*:
```js
import 'https://deno.land/x/corejs@v3.45.1/index.js'; // <- at the top of your entry point
import 'https://deno.land/x/corejs@v3.46.0/index.js'; // <- at the top of your entry point
Object.hasOwn({ foo: 42 }, 'foo'); // => true
+36 -18
View File
@@ -1,7 +1,7 @@
/**
* core-js 3.45.1
* core-js 3.46.0
* © 2014-2025 Denis Pushkarev (zloirock.ru)
* license: https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE
* license: https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE
* source: https://github.com/zloirock/core-js
*/
!function (undefined) { 'use strict'; /******/ (function(modules) { // webpackBootstrap
@@ -579,10 +579,10 @@ var SHARED = '__core-js_shared__';
var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
(store.versions || (store.versions = [])).push({
version: '3.45.1',
version: '3.46.0',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)',
license: 'https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE',
copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)',
license: 'https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE',
source: 'https://github.com/zloirock/core-js'
});
@@ -5400,6 +5400,7 @@ $({ target: 'Math', stat: true }, {
"use strict";
var $ = __webpack_require__(49);
var createProperty = __webpack_require__(149);
var getBuiltIn = __webpack_require__(35);
var uncurryThis = __webpack_require__(6);
var aCallable = __webpack_require__(38);
@@ -5433,7 +5434,7 @@ $({ target: 'Object', stat: true, forced: DOES_NOT_WORK_WITH_PRIMITIVES }, {
// in some IE versions, `hasOwnProperty` returns incorrect result on integer keys
// but since it's a `null` prototype object, we can safely use `in`
if (key in obj) push(obj[key], value);
else obj[key] = [value];
else createProperty(obj, key, [value]);
});
return obj;
}
@@ -12427,7 +12428,7 @@ var iteratorWindow = __webpack_require__(360);
// https://github.com/tc39/proposal-iterator-chunking
$({ target: 'Iterator', proto: true, real: true, forced: true }, {
sliding: function sliding(windowSize) {
return iteratorWindow(this, windowSize, true);
return iteratorWindow(this, windowSize, 'allow-partial');
}
});
@@ -12447,20 +12448,22 @@ var iteratorClose = __webpack_require__(104);
var uncurryThis = __webpack_require__(6);
var $RangeError = RangeError;
var $TypeError = TypeError;
var push = uncurryThis([].push);
var slice = uncurryThis([].slice);
var ALLOW_PARTIAL = 'allow-partial';
var IteratorProxy = createIteratorProxy(function () {
var iterator = this.iterator;
var next = this.next;
var buffer = this.buffer;
var windowSize = this.windowSize;
var sliding = this.sliding;
var allowPartial = this.allowPartial;
var result, done;
while (true) {
result = anObject(call(next, iterator));
done = this.done = !!result.done;
if (sliding && done && buffer.length && buffer.length < windowSize) return createIterResultObject(buffer, false);
if (allowPartial && done && buffer.length && buffer.length < windowSize) return createIterResultObject(buffer, false);
if (done) return createIterResultObject(undefined, true);
if (buffer.length === windowSize) this.buffer = buffer = slice(buffer, 1);
@@ -12469,17 +12472,20 @@ var IteratorProxy = createIteratorProxy(function () {
}
}, false, true);
// `Iterator.prototype.sliding` and `Iterator.prototype.windows` methods
// `Iterator.prototype.windows` and obsolete `Iterator.prototype.sliding` methods
// https://github.com/tc39/proposal-iterator-chunking
module.exports = function (O, windowSize, sliding) {
module.exports = function (O, windowSize, undersized) {
anObject(O);
if (typeof windowSize != 'number' || !windowSize || windowSize >>> 0 !== windowSize) {
return iteratorClose(O, 'throw', new $RangeError('windowSize must be integer in [1, 2^32-1]'));
return iteratorClose(O, 'throw', new $RangeError('`windowSize` must be integer in [1, 2^32-1]'));
}
if (undersized !== undefined && undersized !== 'only-full' && undersized !== ALLOW_PARTIAL) {
return iteratorClose(O, 'throw', new $TypeError('Incorrect `undersized` argument'));
}
return new IteratorProxy(getIteratorDirect(O), {
windowSize: windowSize,
buffer: [],
sliding: sliding
allowPartial: undersized === ALLOW_PARTIAL
});
};
@@ -12517,8 +12523,8 @@ var iteratorWindow = __webpack_require__(360);
// `Iterator.prototype.windows` method
// https://github.com/tc39/proposal-iterator-chunking
$({ target: 'Iterator', proto: true, real: true, forced: true }, {
windows: function windows(windowSize) {
return iteratorWindow(this, windowSize, false);
windows: function windows(windowSize /* , undersized */) {
return iteratorWindow(this, windowSize, arguments.length < 2 ? undefined : arguments[1]);
}
});
@@ -12685,7 +12691,7 @@ var IteratorProxy = createIteratorProxy(function () {
for (var i = 0; i < iterCount; i++) {
var iter = iters[i];
if (iter === null) {
push(results, padding[i]);
result = padding[i];
} else {
try {
result = call(iter.next, iter.iterator);
@@ -12766,6 +12772,7 @@ module.exports = function (iters, mode, padding, finishResults) {
var $ = __webpack_require__(49);
var anObject = __webpack_require__(30);
var anObjectOrUndefined = __webpack_require__(278);
var createProperty = __webpack_require__(149);
var call = __webpack_require__(33);
var uncurryThis = __webpack_require__(6);
var getBuiltIn = __webpack_require__(35);
@@ -12826,7 +12833,7 @@ $({ target: 'Iterator', stat: true, forced: true }, {
return iteratorZip(iters, mode, padding, function (results) {
var obj = create(null);
for (var j = 0; j < iterCount; j++) {
obj[keys[j]] = results[j];
createProperty(obj, keys[j], results[j]);
}
return obj;
});
@@ -16284,9 +16291,20 @@ var get = WeakMapHelpers.get;
var has = WeakMapHelpers.has;
var set = WeakMapHelpers.set;
var FORCED = IS_PURE || !function () {
try {
// eslint-disable-next-line es/no-weak-map, no-throw-literal -- testing
if (WeakMap.prototype.getOrInsertComputed) new WeakMap().getOrInsertComputed(1, function () { throw 1; });
} catch (error) {
// FF144 Nightly - Beta 3 bug
// https://bugzilla.mozilla.org/show_bug.cgi?id=1988369
return error instanceof TypeError;
}
}();
// `WeakMap.prototype.getOrInsertComputed` method
// https://github.com/tc39/proposal-upsert
$({ target: 'WeakMap', proto: true, real: true, forced: IS_PURE }, {
$({ target: 'WeakMap', proto: true, real: true, forced: FORCED }, {
getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {
aWeakMap(this);
aWeakKey(key);
+7 -7
View File
@@ -2,11 +2,11 @@
## Installation
```sh
// global version
npm install --save core-js@3.45.0
npm install --save core-js@3.46.0
// version without global namespace pollution
npm install --save core-js-pure@3.45.0
npm install --save core-js-pure@3.46.0
// bundled global version
npm install --save core-js-bundle@3.45.0
npm install --save core-js-bundle@3.46.0
```
Or you can use `core-js` [from CDN](https://www.jsdelivr.com/package/npm/core-js-bundle).
@@ -94,10 +94,10 @@ import 'regenerator-runtime/runtime';
## `@babel/preset-env`
[`@babel/preset-env`](https://github.com/babel/babel/tree/master/packages/babel-preset-env) has `useBuiltIns` option, which optimizes the use of the global version of `core-js`. With `useBuiltIns` option, you should also set `corejs` option to the used version of `core-js`, like `corejs: '3.45'`.
[`@babel/preset-env`](https://github.com/babel/babel/tree/master/packages/babel-preset-env) has `useBuiltIns` option, which optimizes the use of the global version of `core-js`. With `useBuiltIns` option, you should also set `corejs` option to the used version of `core-js`, like `corejs: '3.46'`.
> [!IMPORTANT]
> It is recommended to specify the used minor `core-js` version, like `corejs: '3.45'`, instead of `corejs: 3`, since with `corejs: 3` will not be injected modules which were added in minor `core-js` releases.
> It is recommended to specify the used minor `core-js` version, like `corejs: '3.46'`, instead of `corejs: 3`, since with `corejs: 3` will not be injected modules which were added in minor `core-js` releases.
---
@@ -158,7 +158,7 @@ import 'core-js/modules/es.array.of';
var array = Array.of(1, 2, 3);
```
By default, `@babel/preset-env` with `useBuiltIns: 'usage'` option only polyfills stable features, but you can enable polyfilling of proposals by the `proposals` option, as `corejs: { version: '3.45', proposals: true }`.
By default, `@babel/preset-env` with `useBuiltIns: 'usage'` option only polyfills stable features, but you can enable polyfilling of proposals by the `proposals` option, as `corejs: { version: '3.46', proposals: true }`.
> [!IMPORTANT]
> In the case of `useBuiltIns: 'usage'`, you should not add `core-js` imports by yourself, they will be added automatically.
@@ -196,7 +196,7 @@ Fast JavaScript transpiler `swc` [contains integration with `core-js`](https://s
"env": {
"targets": "> 0.25%, not dead",
"mode": "entry",
"coreJs": "3.45"
"coreJs": "3.46"
}
}
```
+9 -9
View File
@@ -1,11 +1,11 @@
{
"name": "core-js",
"version": "3.45.1",
"version": "3.46.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"version": "3.45.1",
"version": "3.46.0",
"license": "MIT",
"workspaces": [
"./packages/*"
@@ -5874,7 +5874,7 @@
}
},
"packages/core-js": {
"version": "3.45.1",
"version": "3.46.0",
"hasInstallScript": true,
"license": "MIT",
"funding": {
@@ -5883,11 +5883,11 @@
}
},
"packages/core-js-builder": {
"version": "3.45.1",
"version": "3.46.0",
"license": "MIT",
"dependencies": {
"core-js": "3.45.1",
"core-js-compat": "3.45.1",
"core-js": "3.46.0",
"core-js-compat": "3.46.0",
"mkdirp": ">=0.5.6 <1",
"webpack": ">=4.47.0 <5"
},
@@ -5900,7 +5900,7 @@
}
},
"packages/core-js-bundle": {
"version": "3.45.1",
"version": "3.46.0",
"hasInstallScript": true,
"license": "MIT",
"funding": {
@@ -5909,7 +5909,7 @@
}
},
"packages/core-js-compat": {
"version": "3.45.1",
"version": "3.46.0",
"license": "MIT",
"dependencies": {
"browserslist": "^4.26.3"
@@ -5920,7 +5920,7 @@
}
},
"packages/core-js-pure": {
"version": "3.45.1",
"version": "3.46.0",
"hasInstallScript": true,
"license": "MIT",
"funding": {
+1 -1
View File
@@ -1,5 +1,5 @@
{
"version": "3.45.1",
"version": "3.46.0",
"repository": {
"type": "git",
"url": "https://github.com/zloirock/core-js.git"
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "core-js-builder",
"version": "3.45.1",
"version": "3.46.0",
"type": "commonjs",
"description": "core-js builder",
"repository": {
@@ -26,8 +26,8 @@
"main": "index.js",
"types": "index.d.ts",
"dependencies": {
"core-js": "3.45.1",
"core-js-compat": "3.45.1",
"core-js": "3.46.0",
"core-js-compat": "3.46.0",
"mkdirp": ">=0.5.6 <1",
"webpack": ">=4.47.0 <5"
},
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "core-js-bundle",
"version": "3.45.1",
"version": "3.46.0",
"type": "commonjs",
"description": "Standard library",
"keywords": [
+3 -3
View File
@@ -27,7 +27,7 @@ const {
exclude: [ // optional list / filter of modules to exclude, the signature is similar to `modules` option
'web.atob',
],
version: '3.45', // used `core-js` version, by default - the latest
version: '3.46', // used `core-js` version, by default - the latest
inverse: false, // inverse of the result - shows modules that are NOT required for the target environment
});
@@ -129,9 +129,9 @@ require('core-js-compat/modules'); // => Array<ModuleName>
require('core-js-compat').modules; // => Array<ModuleName>
// the subset of modules which available in the passed `core-js` version:
require('core-js-compat/get-modules-list-for-target-version')('3.45'); // => Array<ModuleName>
require('core-js-compat/get-modules-list-for-target-version')('3.46'); // => Array<ModuleName>
// or
require('core-js-compat').getModulesListForTargetVersion('3.45'); // => Array<ModuleName>
require('core-js-compat').getModulesListForTargetVersion('3.46'); // => Array<ModuleName>
```
If you wanna help to improve this data, you could take a look at the related section of [`CONTRIBUTING.md`](https://github.com/zloirock/core-js/blob/master/CONTRIBUTING.md#how-to-update-core-js-compat-data). The visualization of compatibility data and the browser tests runner is available [here](http://zloirock.github.io/core-js/master/compat/), the example:
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "core-js-compat",
"version": "3.45.1",
"version": "3.46.0",
"type": "commonjs",
"description": "core-js compat",
"repository": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "core-js-pure",
"version": "3.45.1",
"version": "3.46.0",
"type": "commonjs",
"description": "Standard library",
"keywords": [
+2 -2
View File
@@ -7,9 +7,9 @@ var SHARED = '__core-js_shared__';
var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
(store.versions || (store.versions = [])).push({
version: '3.45.1',
version: '3.46.0',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)',
license: 'https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE',
license: 'https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE',
source: 'https://github.com/zloirock/core-js'
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "core-js",
"version": "3.45.1",
"version": "3.46.0",
"type": "commonjs",
"description": "Standard library",
"keywords": [