Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: zloirock/core-js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.23.1
Choose a base ref
...
head repository: zloirock/core-js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.23.2
Choose a head ref
  • 13 commits
  • 41 files changed
  • 1 contributor

Commits on Jun 14, 2022

  1. disable forced replacement of Math constants from proposals since a…

    …nyway they are non-writable non-configurable
    zloirock committed Jun 14, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c0508b5 View commit details
  2. update dependencies

    zloirock committed Jun 14, 2022
    Copy the full SHA
    83e5a92 View commit details
  3. update zx

    zloirock committed Jun 14, 2022
    Copy the full SHA
    18fdb83 View commit details
  4. Copy the full SHA
    0233e1f View commit details
  5. sort by semver

    zloirock committed Jun 14, 2022
    Copy the full SHA
    bac1385 View commit details

Commits on Jun 15, 2022

  1. some stylistic changes

    zloirock committed Jun 15, 2022
    Copy the full SHA
    7e1d9e7 View commit details

Commits on Jun 16, 2022

  1. drop unused shortcuts

    zloirock committed Jun 16, 2022
    Copy the full SHA
    fbba5ab View commit details
  2. update dependencies

    zloirock committed Jun 16, 2022
    Copy the full SHA
    3142b4d View commit details

Commits on Jun 17, 2022

  1. Copy the full SHA
    ca95307 View commit details

Commits on Jun 18, 2022

  1. some stylistic changes

    zloirock committed Jun 18, 2022
    Copy the full SHA
    553c26e View commit details
  2. Copy the full SHA
    4ecb193 View commit details

Commits on Jun 19, 2022

  1. update dependencies

    zloirock committed Jun 19, 2022
    Copy the full SHA
    c1be398 View commit details

Commits on Jun 20, 2022

  1. 3.23.2

    zloirock committed Jun 20, 2022
    Copy the full SHA
    4c29e0a View commit details
Showing with 169 additions and 139 deletions.
  1. +13 −3 .eslintrc.js
  2. +4 −0 CHANGELOG.md
  3. +3 −3 README.md
  4. +1 −1 deno/corejs/README.md
  5. +32 −26 deno/corejs/index.js
  6. +9 −11 package.json
  7. +3 −3 packages/core-js-builder/package.json
  8. +1 −1 packages/core-js-bundle/package.json
  9. +1 −1 packages/core-js-compat/package.json
  10. +1 −0 packages/core-js-compat/src/mapping.mjs
  11. +1 −1 packages/core-js-pure/package.json
  12. +14 −4 packages/core-js/internals/array-buffer-view-core.js
  13. +2 −2 packages/core-js/internals/shared.js
  14. +2 −2 packages/core-js/internals/typed-array-constructor.js
  15. +2 −2 packages/core-js/internals/typed-array-species-constructor.js
  16. +2 −4 packages/core-js/modules/esnext.math.deg-per-rad.js
  17. +2 −4 packages/core-js/modules/esnext.math.rad-per-deg.js
  18. +2 −2 packages/core-js/modules/esnext.typed-array.to-reversed.js
  19. +2 −2 packages/core-js/modules/esnext.typed-array.to-sorted.js
  20. +2 −2 packages/core-js/modules/esnext.typed-array.to-spliced.js
  21. +2 −2 packages/core-js/modules/esnext.typed-array.with.js
  22. +1 −1 packages/core-js/package.json
  23. +1 −1 scripts/build-compat-data.mjs
  24. +2 −2 scripts/build-compat-entries.mjs
  25. +1 −1 scripts/build-compat-modules-by-versions.mjs
  26. +1 −1 scripts/bundle.mjs
  27. +2 −2 scripts/check-compat-data-mapping.mjs
  28. +3 −3 scripts/check-compat-data-modules-by-versions.mjs
  29. +4 −4 scripts/check-compat-tests.mjs
  30. +3 −3 scripts/check-dependencies.mjs
  31. +5 −5 scripts/check-unused-modules.mjs
  32. +6 −6 scripts/clean-and-copy.mjs
  33. +21 −16 scripts/downloads-by-versions.mjs
  34. +1 −1 scripts/generate-indexes.mjs
  35. +4 −4 scripts/update-version.mjs
  36. +4 −4 scripts/usage.mjs
  37. +3 −3 tests/commonjs-entries-content.mjs
  38. +3 −3 tests/commonjs.mjs
  39. +1 −1 tests/compat-tools/compat.mjs
  40. +1 −1 tests/compat-tools/get-modules-list-for-target-version.mjs
  41. +1 −1 tests/compat-tools/targets-parser.mjs
16 changes: 13 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -160,7 +160,11 @@ const base = {
// restrict what can be thrown as an exception
'no-throw-literal': ERROR,
// disallow usage of expressions in statement position
'no-unused-expressions': [ERROR, { allowShortCircuit: true, allowTernary: true }],
'no-unused-expressions': [ERROR, {
allowShortCircuit: true,
allowTernary: true,
allowTaggedTemplates: true,
}],
// disallow unused labels
'no-unused-labels': ERROR,
// disallow unnecessary catch clauses
@@ -1241,17 +1245,23 @@ module.exports = {
argv: READONLY,
cd: READONLY,
chalk: READONLY,
echo: READONLY,
fetch: READONLY,
fs: READONLY,
globby: READONLY,
glob: READONLY,
nothrow: READONLY,
os: READONLY,
path: READONLY,
question: READONLY,
require: READONLY,
sleep: READONLY,
stdin: READONLY,
which: READONLY,
within: READONLY,
YAML: READONLY,
},
rules: {
// disallow use of console
// allow use of console
'no-console': OFF,
},
},
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,10 @@
##### Unreleased
- Nothing

##### [3.23.2 - 2022.06.21](https://github.com/zloirock/core-js/releases/tag/v3.23.2)
- Avoided creation of extra properties for the handling of `%TypedArray%` constructors in new methods, [#1092 (comment)](https://github.com/zloirock/core-js/issues/1092#issuecomment-1158760512)
- Added Deno 1.23 compat data mapping

##### [3.23.1 - 2022.06.14](https://github.com/zloirock/core-js/releases/tag/v3.23.1)
- Fixed possible error on multiple `core-js` copies, [#1091](https://github.com/zloirock/core-js/issues/1091)
- Added `v` flag to `RegExp.prototype.flags` implementation in case if current V8 bugs will not be fixed before this flag implementation
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -176,11 +176,11 @@ queueMicrotask(() => console.log('called as microtask'));
### Installation:[](#index)
```
// global version
npm install --save core-js@3.23.1
npm install --save core-js@3.23.2
// version without global namespace pollution
npm install --save core-js-pure@3.23.1
npm install --save core-js-pure@3.23.2
// bundled global version
npm install --save core-js-bundle@3.23.1
npm install --save core-js-bundle@3.23.2
```

Or you can use `core-js` [from CDN](https://www.jsdelivr.com/package/npm/core-js-bundle).
2 changes: 1 addition & 1 deletion deno/corejs/README.md
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@

*Example*:
```js
import 'https://deno.land/x/corejs@v3.23.1/index.js'; // <- at the top of your entry point
import 'https://deno.land/x/corejs@v3.23.2/index.js'; // <- at the top of your entry point

Object.hasOwn({ foo: 42 }, 'foo'); // => true

58 changes: 32 additions & 26 deletions deno/corejs/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* core-js 3.23.1
* core-js 3.23.2
* © 2014-2022 Denis Pushkarev (zloirock.ru)
* license: https://github.com/zloirock/core-js/blob/v3.23.1/LICENSE
* license: https://github.com/zloirock/core-js/blob/v3.23.2/LICENSE
* source: https://github.com/zloirock/core-js
*/
!function (undefined) { 'use strict'; /******/ (function(modules) { // webpackBootstrap
@@ -879,10 +879,10 @@ var store = __webpack_require__(34);
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: '3.23.1',
version: '3.23.2',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
license: 'https://github.com/zloirock/core-js/blob/v3.23.1/LICENSE',
license: 'https://github.com/zloirock/core-js/blob/v3.23.2/LICENSE',
source: 'https://github.com/zloirock/core-js'
});

@@ -3025,7 +3025,10 @@ var getPrototypeOf = __webpack_require__(81);
var setPrototypeOf = __webpack_require__(68);
var wellKnownSymbol = __webpack_require__(31);
var uid = __webpack_require__(38);
var InternalStateModule = __webpack_require__(49);

var enforceInternalState = InternalStateModule.enforce;
var getInternalState = InternalStateModule.get;
var Int8Array = global.Int8Array;
var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
var Uint8ClampedArray = global.Uint8ClampedArray;
@@ -3037,7 +3040,7 @@ var TypeError = global.TypeError;

var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
var TYPED_ARRAY_CONSTRUCTOR = uid('TYPED_ARRAY_CONSTRUCTOR');
var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor';
// Fixing native typed arrays in Opera Presto crashes the browser, see #595
var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera';
var TYPED_ARRAY_TAG_REQUIRED = false;
@@ -3068,6 +3071,13 @@ var isView = function isView(it) {
|| hasOwn(BigIntArrayConstructorsList, klass);
};

var getTypedArrayConstructor = function (it) {
var proto = getPrototypeOf(it);
if (!isObject(proto)) return;
var state = getInternalState(proto);
return (state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR)) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor(proto);
};

var isTypedArray = function (it) {
if (!isObject(it)) return false;
var klass = classof(it);
@@ -3132,14 +3142,14 @@ var exportTypedArrayStaticMethod = function (KEY, property, forced) {
for (NAME in TypedArrayConstructorsList) {
Constructor = global[NAME];
Prototype = Constructor && Constructor.prototype;
if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);
if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;
else NATIVE_ARRAY_BUFFER_VIEWS = false;
}

for (NAME in BigIntArrayConstructorsList) {
Constructor = global[NAME];
Prototype = Constructor && Constructor.prototype;
if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);
if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;
}

// WebKit bug - typed arrays constructors prototype is Object.prototype
@@ -3177,12 +3187,12 @@ if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) {

module.exports = {
NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
TYPED_ARRAY_CONSTRUCTOR: TYPED_ARRAY_CONSTRUCTOR,
TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,
aTypedArray: aTypedArray,
aTypedArrayConstructor: aTypedArrayConstructor,
exportTypedArrayMethod: exportTypedArrayMethod,
exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
getTypedArrayConstructor: getTypedArrayConstructor,
isView: isView,
isTypedArray: isTypedArray,
TypedArray: TypedArray,
@@ -7526,12 +7536,10 @@ $({ target: 'Math', stat: true, forced: true }, {

var $ = __webpack_require__(2);

var DEG_PER_RAD = Math.PI / 180;

// `Math.DEG_PER_RAD` constant
// https://rwaldron.github.io/proposal-math-extensions/
$({ target: 'Math', stat: true, nonConfigurable: true, nonWritable: true, forced: Math.DEG_PER_RAD !== DEG_PER_RAD }, {
DEG_PER_RAD: DEG_PER_RAD
$({ target: 'Math', stat: true, nonConfigurable: true, nonWritable: true }, {
DEG_PER_RAD: Math.PI / 180
});


@@ -7643,12 +7651,10 @@ module.exports = Math.sign || function sign(x) {

var $ = __webpack_require__(2);

var RAD_PER_DEG = 180 / Math.PI;

// `Math.RAD_PER_DEG` constant
// https://rwaldron.github.io/proposal-math-extensions/
$({ target: 'Math', stat: true, nonConfigurable: true, nonWritable: true, forced: Math.RAD_PER_DEG !== RAD_PER_DEG }, {
RAD_PER_DEG: RAD_PER_DEG
$({ target: 'Math', stat: true, nonConfigurable: true, nonWritable: true }, {
RAD_PER_DEG: 180 / Math.PI
});


@@ -9270,13 +9276,13 @@ module.exports = function (instance, list) {
var ArrayBufferViewCore = __webpack_require__(117);
var speciesConstructor = __webpack_require__(226);

var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;

// a part of `TypedArraySpeciesCreate` abstract operation
// https://tc39.es/ecma262/#typedarray-species-create
module.exports = function (originalArray) {
return aTypedArrayConstructor(speciesConstructor(originalArray, originalArray[TYPED_ARRAY_CONSTRUCTOR]));
return aTypedArrayConstructor(speciesConstructor(originalArray, getTypedArrayConstructor(originalArray)));
};


@@ -9313,12 +9319,12 @@ var ArrayBufferViewCore = __webpack_require__(117);

var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;

// `%TypedArray%.prototype.toReversed` method
// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toReversed
exportTypedArrayMethod('toReversed', function toReversed() {
return arrayToReversed(aTypedArray(this), this[TYPED_ARRAY_CONSTRUCTOR]);
return arrayToReversed(aTypedArray(this), getTypedArrayConstructor(this));
});


@@ -9334,16 +9340,16 @@ var aCallable = __webpack_require__(28);
var arrayFromConstructorAndList = __webpack_require__(140);

var aTypedArray = ArrayBufferViewCore.aTypedArray;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
var sort = uncurryThis(ArrayBufferViewCore.TypedArrayPrototype.sort);

// `%TypedArray%.prototype.toSorted` method
// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toSorted
exportTypedArrayMethod('toSorted', function toSorted(compareFn) {
if (compareFn !== undefined) aCallable(compareFn);
var O = aTypedArray(this);
var A = arrayFromConstructorAndList(O[TYPED_ARRAY_CONSTRUCTOR], O);
var A = arrayFromConstructorAndList(getTypedArrayConstructor(O), O);
return sort(A, compareFn);
});

@@ -9359,14 +9365,14 @@ var arraySlice = __webpack_require__(153);
var arrayToSpliced = __webpack_require__(154);

var aTypedArray = ArrayBufferViewCore.aTypedArray;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;

// `%TypedArray%.prototype.toSpliced` method
// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toSpliced
// eslint-disable-next-line no-unused-vars -- required for .length
exportTypedArrayMethod('toSpliced', function toSpliced(start, deleteCount /* , ...items */) {
return arrayToSpliced(aTypedArray(this), this[TYPED_ARRAY_CONSTRUCTOR], arraySlice(arguments));
return arrayToSpliced(aTypedArray(this), getTypedArrayConstructor(this), arraySlice(arguments));
}, { arity: 2 });


@@ -9406,8 +9412,8 @@ var classof = __webpack_require__(74);
var uncurryThis = __webpack_require__(13);

var aTypedArray = ArrayBufferViewCore.aTypedArray;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
var slice = uncurryThis(''.slice);

var PROPER_ORDER = !!function () {
@@ -9427,7 +9433,7 @@ exportTypedArrayMethod('with', { 'with': function (index, value) {
aTypedArray(this);
var relativeIndex = toIntegerOrInfinity(index);
var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value;
return arrayWith(this, this[TYPED_ARRAY_CONSTRUCTOR], relativeIndex, actualValue);
return arrayWith(this, getTypedArrayConstructor(this), relativeIndex, actualValue);
} }['with'], !PROPER_ORDER);


20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"version": "3.23.1",
"version": "3.23.2",
"workspaces": [
"./packages/*"
],
"devDependencies": {
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.2",
"@babel/core": "^7.18.5",
"@babel/plugin-proposal-class-properties": "^7.17.12",
"@babel/plugin-proposal-class-static-block": "^7.18.0",
"@babel/plugin-proposal-logical-assignment-operators": "^7.17.12",
@@ -27,7 +27,7 @@
"@babel/plugin-transform-literals": "^7.17.12",
"@babel/plugin-transform-member-expression-literals": "^7.16.7",
"@babel/plugin-transform-modules-commonjs": "^7.18.2",
"@babel/plugin-transform-new-target": "^7.17.12",
"@babel/plugin-transform-new-target": "^7.18.5",
"@babel/plugin-transform-object-super": "^7.16.7",
"@babel/plugin-transform-parameters": "^7.17.12",
"@babel/plugin-transform-property-literals": "^7.16.7",
@@ -41,26 +41,26 @@
"confusing-browser-globals": "^1.0.11",
"david": "^12.0.0",
"es-observable": "git+https://github.com/tc39/proposal-observable.git#d3404f06bc70c7c578a5047dfb3dc813730e3319",
"eslint": "^8.17.0",
"eslint": "^8.18.0",
"eslint-plugin-array-func": "^3.1.7",
"eslint-plugin-es-x": "^5.2.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsonc": "^2.3.0",
"eslint-plugin-n": "^15.2.2",
"eslint-plugin-n": "^15.2.3",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-qunit": "^7.3.0",
"eslint-plugin-regexp": "^1.7.0",
"eslint-plugin-sonarjs": "~0.13.0",
"eslint-plugin-unicorn": "^42.0.0",
"jsonc-eslint-parser": "^2.1.0",
"jszip": "^3.10.0",
"karma": "^6.3.20",
"karma": "^6.4.0",
"karma-phantomjs-launcher": "~1.0.4",
"karma-qunit": "^4.1.2",
"konan": "^2.1.1",
"moon-unit": "0.2.2",
"npm": "8.12.1",
"npm": "8.12.2",
"npm-run-all": "^4.1.5",
"p-timeout": "^5.1.0",
"phantomjs-prebuilt": "~2.1.16",
@@ -73,8 +73,8 @@
"test262": "github:tc39/test262",
"test262-harness": "^10.0.0",
"webpack": "^5.73.0",
"webpack-cli": "^4.9.2",
"zx": "^6.2.4"
"webpack-cli": "^4.10.0",
"zx": "^7.0.0"
},
"license": "MIT",
"repository": {
@@ -152,9 +152,7 @@
"update-version": "zx scripts/update-version.mjs && zx scripts/bundle.mjs --deno",
"publish": "npm publish --workspaces",
"c": "npm run check",
"d": "npm run check-dependencies",
"l": "npm run lint",
"m": "npm run check-mapping",
"r": "npm run refresh",
"u": "npm run update-version"
}
6 changes: 3 additions & 3 deletions packages/core-js-builder/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "core-js-builder",
"description": "core-js builder",
"version": "3.23.1",
"version": "3.23.2",
"repository": {
"type": "git",
"url": "https://github.com/zloirock/core-js.git",
"directory": "packages/core-js-builder"
},
"main": "index.js",
"dependencies": {
"core-js": "3.23.1",
"core-js-compat": "3.23.1",
"core-js": "3.23.2",
"core-js-compat": "3.23.2",
"mkdirp": ">=0.5.5 <1",
"webpack": ">=4.46.0 <5"
},
2 changes: 1 addition & 1 deletion packages/core-js-bundle/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "core-js-bundle",
"description": "Standard library",
"version": "3.23.1",
"version": "3.23.2",
"repository": {
"type": "git",
"url": "https://github.com/zloirock/core-js.git"
2 changes: 1 addition & 1 deletion packages/core-js-compat/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "core-js-compat",
"description": "core-js compat",
"version": "3.23.1",
"version": "3.23.2",
"repository": {
"type": "git",
"url": "https://github.com/zloirock/core-js.git",
1 change: 1 addition & 0 deletions packages/core-js-compat/src/mapping.mjs
Original file line number Diff line number Diff line change
@@ -83,6 +83,7 @@ export default {
[100, '1.20'],
[100, '1.21'],
[100, '1.22'],
[104, '1.23'],
],
// https://github.com/Kilian/electron-to-chromium/blob/master/chromium-versions.js
// Maybe also required to handle used Node versions?
Loading