diff --git a/CHANGELOG.md b/CHANGELOG.md index 5165e16fd650..3b2ba5aec7f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## Changelog ##### Unreleased +- Nothing + +##### [3.35.1 - 2024.01.21](https://github.com/zloirock/core-js/releases/tag/v3.35.1) - Fixed internal `ToLength` operation with bigints, [#1318](https://github.com/zloirock/core-js/issues/1318) - Removed significant redundant code from `String#split` polyfill - Fixed setting names of methods with symbol keys in some old engines diff --git a/README.md b/README.md index 679d525c614d..9801aeeefe50 100644 --- a/README.md +++ b/README.md @@ -210,11 +210,11 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3]) ### Installation:[⬆](#index) ```sh // global version -npm install --save core-js@3.35.0 +npm install --save core-js@3.35.1 // version without global namespace pollution -npm install --save core-js-pure@3.35.0 +npm install --save core-js-pure@3.35.1 // bundled global version -npm install --save core-js-bundle@3.35.0 +npm install --save core-js-bundle@3.35.1 ``` Or you can use `core-js` [from CDN](https://www.jsdelivr.com/package/npm/core-js-bundle). diff --git a/deno/corejs/README.md b/deno/corejs/README.md index 361aa5e8abd6..3ac6b9bcd598 100644 --- a/deno/corejs/README.md +++ b/deno/corejs/README.md @@ -29,7 +29,7 @@ *Example*: ```js -import 'https://deno.land/x/corejs@v3.35.0/index.js'; // <- at the top of your entry point +import 'https://deno.land/x/corejs@v3.35.1/index.js'; // <- at the top of your entry point Object.hasOwn({ foo: 42 }, 'foo'); // => true diff --git a/deno/corejs/index.js b/deno/corejs/index.js index 5c45ca4fd2b4..8b98cadb7dd4 100644 --- a/deno/corejs/index.js +++ b/deno/corejs/index.js @@ -1,7 +1,7 @@ /** - * core-js 3.35.0 - * © 2014-2023 Denis Pushkarev (zloirock.ru) - * license: https://github.com/zloirock/core-js/blob/v3.35.0/LICENSE + * core-js 3.35.1 + * © 2014-2024 Denis Pushkarev (zloirock.ru) + * license: https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE * source: https://github.com/zloirock/core-js */ !function (undefined) { 'use strict'; /******/ (function(modules) { // webpackBootstrap @@ -403,7 +403,7 @@ module.exports = function (options, source) { } else if (STATIC) { target = global[TARGET] || defineGlobalProperty(TARGET, {}); } else { - target = (global[TARGET] || {}).prototype; + target = global[TARGET] && global[TARGET].prototype; } if (target) for (key in source) { sourceProperty = source[key]; @@ -1010,10 +1010,10 @@ var store = __webpack_require__(35); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ - version: '3.35.0', + version: '3.35.1', mode: IS_PURE ? 'pure' : 'global', - copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)', - license: 'https://github.com/zloirock/core-js/blob/v3.35.0/LICENSE', + copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)', + license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE', source: 'https://github.com/zloirock/core-js' }); @@ -1326,7 +1326,7 @@ var TEMPLATE = String(String).split('String'); var makeBuiltIn = module.exports = function (value, name, options) { if (stringSlice($String(name), 0, 7) === 'Symbol(') { - name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']'; + name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']'; } if (options && options.getter) name = 'get ' + name; if (options && options.setter) name = 'set ' + name; @@ -1736,7 +1736,8 @@ var min = Math.min; // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength module.exports = function (argument) { - return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 + var len = toIntegerOrInfinity(argument); + return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; @@ -3738,7 +3739,6 @@ var getBuiltIn = __webpack_require__(22); var inspectSource = __webpack_require__(49); var noop = function () { /* empty */ }; -var empty = []; var construct = getBuiltIn('Reflect', 'construct'); var constructorRegExp = /^\s*(?:class|function)\b/; var exec = uncurryThis(constructorRegExp.exec); @@ -3747,7 +3747,7 @@ var INCORRECT_TO_STRING = !constructorRegExp.test(noop); var isConstructorModern = function isConstructor(argument) { if (!isCallable(argument)) return false; try { - construct(noop, empty, argument); + construct(noop, [], argument); return true; } catch (error) { return false; @@ -4868,12 +4868,6 @@ var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); var max = Math.max; -var stringIndexOf = function (string, searchValue, fromIndex) { - if (fromIndex > string.length) return -1; - if (searchValue === '') return fromIndex; - return indexOf(string, searchValue, fromIndex); -}; - // `String.prototype.replaceAll` method // https://tc39.es/ecma262/#sec-string.prototype.replaceall $({ target: 'String', proto: true }, { @@ -4902,14 +4896,14 @@ $({ target: 'String', proto: true }, { if (!functionalReplace) replaceValue = toString(replaceValue); searchLength = searchString.length; advanceBy = max(1, searchLength); - position = stringIndexOf(string, searchString, 0); + position = indexOf(string, searchString); while (position !== -1) { replacement = functionalReplace ? toString(replaceValue(searchString, position, string)) : getSubstitution(searchString, string, position, [], undefined, replaceValue); result += stringSlice(string, endOfLastMatch, position) + replacement; endOfLastMatch = position + searchLength; - position = stringIndexOf(string, searchString, position + advanceBy); + position = position + advanceBy > string.length ? -1 : indexOf(string, searchString, position + advanceBy); } if (endOfLastMatch < string.length) { result += stringSlice(string, endOfLastMatch); diff --git a/docs/compat/compat-data.js b/docs/compat/compat-data.js index e3df6dd2074f..f759a0a2170a 100644 --- a/docs/compat/compat-data.js +++ b/docs/compat/compat-data.js @@ -994,6 +994,7 @@ "chrome": "122", "chrome-android": "122", "edge": "122", + "electron": "29.0", "firefox": "55", "firefox-android": "55", "hermes": "0.2", @@ -3502,9 +3503,11 @@ "electron": "28.0", "firefox": "121", "firefox-android": "121", + "oculus": "31.0", "opera": "105", "opera-android": "79", - "opera_mobile": "79" + "opera_mobile": "79", + "quest": "31.0" }, "es.reflect.apply": { "android": "49", @@ -5830,7 +5833,9 @@ "safari": "14.0", "samsung": "14.0" }, - "esnext.suppressed-error.constructor": {}, + "esnext.suppressed-error.constructor": { + "bun": "1.0.23" + }, "esnext.array.from-async": { "android": "121", "bun": "0.3.0", @@ -6108,47 +6113,125 @@ "samsung": "10.0" }, "esnext.iterator.constructor": { - "deno": "1.37" + "android": "122", + "chrome": "122", + "chrome-android": "122", + "deno": "1.37", + "edge": "122", + "electron": "29.0", + "opera": "108" }, "esnext.iterator.as-indexed-pairs": {}, "esnext.iterator.dispose": {}, "esnext.iterator.drop": { - "deno": "1.37" + "android": "122", + "chrome": "122", + "chrome-android": "122", + "deno": "1.37", + "edge": "122", + "electron": "29.0", + "opera": "108" }, "esnext.iterator.every": { - "deno": "1.37" + "android": "122", + "chrome": "122", + "chrome-android": "122", + "deno": "1.37", + "edge": "122", + "electron": "29.0", + "opera": "108" }, "esnext.iterator.filter": { - "deno": "1.37" + "android": "122", + "chrome": "122", + "chrome-android": "122", + "deno": "1.37", + "edge": "122", + "electron": "29.0", + "opera": "108" }, "esnext.iterator.find": { - "deno": "1.37" + "android": "122", + "chrome": "122", + "chrome-android": "122", + "deno": "1.37", + "edge": "122", + "electron": "29.0", + "opera": "108" }, "esnext.iterator.flat-map": { - "deno": "1.37" + "android": "122", + "chrome": "122", + "chrome-android": "122", + "deno": "1.37", + "edge": "122", + "electron": "29.0", + "opera": "108" }, "esnext.iterator.for-each": { - "deno": "1.37" + "android": "122", + "chrome": "122", + "chrome-android": "122", + "deno": "1.37", + "edge": "122", + "electron": "29.0", + "opera": "108" }, "esnext.iterator.from": { - "deno": "1.37" + "android": "122", + "chrome": "122", + "chrome-android": "122", + "deno": "1.37", + "edge": "122", + "electron": "29.0", + "opera": "108" }, "esnext.iterator.indexed": {}, "esnext.iterator.map": { - "deno": "1.37" + "android": "122", + "chrome": "122", + "chrome-android": "122", + "deno": "1.37", + "edge": "122", + "electron": "29.0", + "opera": "108" }, "esnext.iterator.range": {}, "esnext.iterator.reduce": { - "deno": "1.37" + "android": "122", + "chrome": "122", + "chrome-android": "122", + "deno": "1.37", + "edge": "122", + "electron": "29.0", + "opera": "108" }, "esnext.iterator.some": { - "deno": "1.37" + "android": "122", + "chrome": "122", + "chrome-android": "122", + "deno": "1.37", + "edge": "122", + "electron": "29.0", + "opera": "108" }, "esnext.iterator.take": { - "deno": "1.37" + "android": "122", + "chrome": "122", + "chrome-android": "122", + "deno": "1.37", + "edge": "122", + "electron": "29.0", + "opera": "108" }, "esnext.iterator.to-array": { - "deno": "1.37" + "android": "122", + "chrome": "122", + "chrome-android": "122", + "deno": "1.37", + "edge": "122", + "electron": "29.0", + "opera": "108" }, "esnext.iterator.to-async": {}, "esnext.json.is-raw-json": { @@ -6347,9 +6430,11 @@ "electron": "28.0", "firefox": "121", "firefox-android": "121", + "oculus": "31.0", "opera": "105", "opera-android": "79", - "opera_mobile": "79" + "opera_mobile": "79", + "quest": "31.0" }, "esnext.reflect.define-metadata": {}, "esnext.reflect.delete-metadata": {}, @@ -6475,10 +6560,12 @@ "samsung": "22.0" }, "esnext.symbol.async-dispose": { + "bun": "1.0.23", "deno": "1.38", "node": "20.5.0" }, "esnext.symbol.dispose": { + "bun": "1.0.23", "deno": "1.38", "node": "20.5.0" }, @@ -6801,6 +6888,7 @@ }, "web.self": { "android": "86", + "bun": "1.0.22", "chrome": "86", "chrome-android": "86", "deno": "1.29.3", @@ -6950,9 +7038,11 @@ "firefox-android": "115", "ios": "17.0", "node": "20.1.0", + "oculus": "31.0", "opera": "106", "opera-android": "80", "opera_mobile": "80", + "quest": "31.0", "safari": "17.0" }, "web.url.to-json": { diff --git a/package-lock.json b/package-lock.json index 3d0760d973f8..209c204f99cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "core-js", - "version": "3.35.0", + "version": "3.35.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "version": "3.35.0", + "version": "3.35.1", "license": "MIT", "workspaces": [ "./packages/*" @@ -6170,7 +6170,7 @@ } }, "packages/core-js": { - "version": "3.35.0", + "version": "3.35.1", "hasInstallScript": true, "license": "MIT", "funding": { @@ -6179,11 +6179,11 @@ } }, "packages/core-js-builder": { - "version": "3.35.0", + "version": "3.35.1", "license": "MIT", "dependencies": { - "core-js": "3.35.0", - "core-js-compat": "3.35.0", + "core-js": "3.35.1", + "core-js-compat": "3.35.1", "mkdirp": ">=0.5.5 <1", "webpack": ">=4.47.0 <5" }, @@ -6196,7 +6196,7 @@ } }, "packages/core-js-bundle": { - "version": "3.35.0", + "version": "3.35.1", "hasInstallScript": true, "license": "MIT", "funding": { @@ -6205,7 +6205,7 @@ } }, "packages/core-js-compat": { - "version": "3.35.0", + "version": "3.35.1", "license": "MIT", "dependencies": { "browserslist": "^4.22.2" @@ -6216,7 +6216,7 @@ } }, "packages/core-js-pure": { - "version": "3.35.0", + "version": "3.35.1", "hasInstallScript": true, "license": "MIT", "funding": { diff --git a/package.json b/package.json index d67f05000f6f..a932455fa514 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "3.35.0", + "version": "3.35.1", "repository": { "type": "git", "url": "https://github.com/zloirock/core-js.git" diff --git a/packages/core-js-builder/package.json b/packages/core-js-builder/package.json index 746bdfef47c6..bdef14ceb965 100644 --- a/packages/core-js-builder/package.json +++ b/packages/core-js-builder/package.json @@ -1,6 +1,6 @@ { "name": "core-js-builder", - "version": "3.35.0", + "version": "3.35.1", "type": "commonjs", "description": "core-js builder", "repository": { @@ -22,8 +22,8 @@ "main": "index.js", "types": "index.d.ts", "dependencies": { - "core-js": "3.35.0", - "core-js-compat": "3.35.0", + "core-js": "3.35.1", + "core-js-compat": "3.35.1", "mkdirp": ">=0.5.5 <1", "webpack": ">=4.47.0 <5" }, diff --git a/packages/core-js-bundle/package.json b/packages/core-js-bundle/package.json index 1147eddafac1..b797aa9c1fd2 100644 --- a/packages/core-js-bundle/package.json +++ b/packages/core-js-bundle/package.json @@ -1,6 +1,6 @@ { "name": "core-js-bundle", - "version": "3.35.0", + "version": "3.35.1", "type": "commonjs", "description": "Standard library", "keywords": [ diff --git a/packages/core-js-compat/package.json b/packages/core-js-compat/package.json index cc2ca0850d22..4dd880fd30fa 100644 --- a/packages/core-js-compat/package.json +++ b/packages/core-js-compat/package.json @@ -1,6 +1,6 @@ { "name": "core-js-compat", - "version": "3.35.0", + "version": "3.35.1", "type": "commonjs", "description": "core-js compat", "repository": { diff --git a/packages/core-js-pure/package.json b/packages/core-js-pure/package.json index 15d0203a3f85..c0cb5ae3c17c 100644 --- a/packages/core-js-pure/package.json +++ b/packages/core-js-pure/package.json @@ -1,6 +1,6 @@ { "name": "core-js-pure", - "version": "3.35.0", + "version": "3.35.1", "type": "commonjs", "description": "Standard library", "keywords": [ diff --git a/packages/core-js/internals/shared.js b/packages/core-js/internals/shared.js index 49259bfbafd3..f434a2b0d2c4 100644 --- a/packages/core-js/internals/shared.js +++ b/packages/core-js/internals/shared.js @@ -5,9 +5,9 @@ var store = require('../internals/shared-store'); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ - version: '3.35.0', + version: '3.35.1', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)', - license: 'https://github.com/zloirock/core-js/blob/v3.35.0/LICENSE', + license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE', source: 'https://github.com/zloirock/core-js' }); diff --git a/packages/core-js/package.json b/packages/core-js/package.json index 900765e90211..8d155ac69a51 100644 --- a/packages/core-js/package.json +++ b/packages/core-js/package.json @@ -1,6 +1,6 @@ { "name": "core-js", - "version": "3.35.0", + "version": "3.35.1", "type": "commonjs", "description": "Standard library", "keywords": [