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.15.2
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.16.0
Choose a head ref
Loading
Showing 444 changed files with 10,486 additions and 1,323 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
/deno/corejs/
/packages/core-js-bundle/
/packages/core-js-compat/*.json
/packages/core-js-pure/override/
63 changes: 49 additions & 14 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
const RESTRICTED_GLOBALS = require('confusing-browser-globals');
const SUPPORTED_NODE_VERSIONS = require('core-js-builder/package').engines.node;
const DEV_NODE_VERSIONS = '^10.17';
const DEV_NODE_VERSIONS = '^14.15';

function disable(rules) {
return Object.keys(rules).reduce((memo, rule) => {
@@ -314,8 +314,6 @@ const base = {
// node:
// disallow deprecated APIs
'node/no-deprecated-api': 'error',
// enforce the style of file extensions in `import` declarations
'node/file-extension-in-import': ['error', 'never'],
// require require() calls to be placed at top-level module scope
'node/global-require': 'error',
// disallow the assignment to `exports`
@@ -356,6 +354,8 @@ const base = {
'prefer-exponentiation-operator': 'error',
// require template literals instead of string concatenation
'prefer-template': 'error',
// disallow generator functions that do not have `yield`
'require-yield': 'error',
// enforce spacing between rest and spread operators and their expressions
'rest-spread-spacing': 'error',
// require or disallow spacing around embedded expressions of template strings
@@ -417,8 +417,12 @@ const base = {
'sonarjs/no-duplicated-branches': 'error',
// collection elements should not be replaced unconditionally
'sonarjs/no-element-overwrite': 'error',
// empty collections should not be accessed or iterated
'sonarjs/no-empty-collection': 'error',
// function calls should not pass extra arguments
'sonarjs/no-extra-arguments': 'error',
// goolean expressions should not be gratuitous
'sonarjs/no-gratuitous-expressions': 'error',
// functions should not have identical implementations
'sonarjs/no-identical-functions': 'error',
// boolean checks should not be inverted
@@ -435,6 +439,8 @@ const base = {
'sonarjs/no-unused-collection': 'error',
// the output of functions that don't return anything should not be used
'sonarjs/no-use-of-empty-return-value': 'error',
// non-existent operators '=+', '=-' and '=!' should not be used
'sonarjs/non-existent-operator': 'error',
// local variables should not be declared and then immediately returned or thrown
'sonarjs/prefer-immediate-return': 'error',
// object literal syntax should be used
@@ -492,6 +498,8 @@ const base = {
'regexp/no-potentially-useless-backreference': 'error',
// disallow standalone backslashes
'regexp/no-standalone-backslash': 'error',
// disallow exponential and polynomial backtracking
'regexp/no-super-linear-backtracking': 'error',
// disallow trivially nested assertions
'regexp/no-trivially-nested-assertion': 'error',
// disallow nested quantifiers that can be rewritten as one quantifier
@@ -760,8 +768,6 @@ const transpiledAndPolyfilled = {
};

const nodePackages = {
// disallow unsupported ECMAScript syntax on the specified version
'node/no-unsupported-features/es-syntax': ['error', { version: SUPPORTED_NODE_VERSIONS }],
// disallow unsupported ECMAScript built-ins on the specified version
'node/no-unsupported-features/node-builtins': ['error', { version: SUPPORTED_NODE_VERSIONS }],
...disable(forbidES5BuiltIns),
@@ -777,16 +783,11 @@ const nodePackages = {
};

const nodeDev = {
...nodePackages,
// disallow unsupported ECMAScript syntax on the specified version
'node/no-unsupported-features/es-syntax': ['error', { version: DEV_NODE_VERSIONS }],
// disallow unsupported ECMAScript built-ins on the specified version
'node/no-unsupported-features/node-builtins': ['error', { version: DEV_NODE_VERSIONS }],
...disable(forbidES5BuiltIns),
...disable(forbidES2015BuiltIns),
...disable(forbidES2016BuiltIns),
...disable(forbidES2017BuiltIns),
...disable(forbidES2018BuiltIns),
...disable(forbidModernESBuiltIns),
...forbidES2021BuiltIns,
'es/no-weakrefs': 'off',
};

const tests = {
@@ -938,7 +939,7 @@ const json = {
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2021,
ecmaVersion: 'latest',
},
env: {
// unnececery global builtins disabled by related rules
@@ -1064,6 +1065,40 @@ module.exports = {
Observable: true,
},
},
{
files: ['*.mjs'],
parser: '@babel/eslint-parser',
parserOptions: {
babelOptions: {
plugins: ['@babel/plugin-syntax-top-level-await'],
},
ecmaVersion: 2022,
requireConfigFile: false,
sourceType: 'module',
},
},
{
files: [
'packages/core-js-compat/src/**',
'scripts/**',
],
// zx
globals: {
$: true,
__dirname: true,
__filename: true,
argv: true,
cd: true,
chalk: true,
fetch: true,
fs: true,
os: true,
nothrow: true,
question: true,
require: true,
sleep: true,
},
},
{
files: ['*.json'],
parser: 'jsonc-eslint-parser',
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
open_collective: core-js
patreon: zloirock
custom: paypal.me/zloirock
tidelift: npm/core-js
2 changes: 0 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -14,8 +14,6 @@ jobs:
'macos-latest',
]
node: [
'10.17',
'12.13',
'14.15',
'16',
]
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,38 @@
##### Unreleased
- Nothing

##### 3.16.0 - 2021.07.30
- [`Array` find from last proposal](https://github.com/tc39/proposal-array-find-from-last) moved to the stage 3, [July 2021 TC39 meeting](https://github.com/tc39/proposal-array-find-from-last/pull/47)
- [`Array` filtering stage 1 proposal](https://github.com/tc39/proposal-array-filtering):
- `Array.prototype.filterReject` replaces `Array.prototype.filterOut`
- `%TypedArray%.prototype.filterReject` replaces `%TypedArray%.prototype.filterOut`
- Added [`Array` grouping stage 1 proposal](https://github.com/tc39/proposal-array-grouping):
- `Array.prototype.groupBy`
- `%TypedArray%.prototype.groupBy`
- Work with symbols made stricter: some missed before cases of methods that should throw an error on symbols now works as they should
- Handling `@@toPrimitive` in some cases of `ToPrimitive` internal logic made stricter
- Fixed work of `Request` with polyfilled `URLSearchParams`, [#965](https://github.com/zloirock/core-js/issues/965)
- Fixed possible exposing of collections elements metadata in some cases, [#427](https://github.com/zloirock/core-js/issues/427)
- Fixed crashing of `Object.create(null)` on WSH, [#966](https://github.com/zloirock/core-js/issues/966)
- Fixed some cases of typed arrays subclassing logic
- Fixed a minor bug related to string conversion in `RegExp#exec`
- Fixed `Date.prototype.getYear` feature detection
- Fixed content of some entry points
- Some minor optimizations and refactoring
- Deno:
- Added Deno support (sure, after bundling since Deno does not support CommonJS)
- Allowed `deno` target in `core-js-compat` / `core-js-builder`
- A bundle for Deno published on [deno.land/x/corejs](https://deno.land/x/corejs)
- Added / updated compat data / mapping:
- Deno 1.0-1.13
- NodeJS up to 16.6
- iOS Safari up to 15.0
- Samsung Internet up to 15.0
- Opera Android up to 64
- `Object.hasOwn` marked as supported from [V8 9.3](https://chromestatus.com/feature/5662263404920832) and [FF92](https://bugzilla.mozilla.org/show_bug.cgi?id=1721149)
- `Date.prototype.getYear` marked as not supported in IE8-
- Added `summary` option to `core-js-builder`, see more info in the [`README`](https://github.com/zloirock/core-js/blob/master/packages/core-js-builder/README.md), [#910](https://github.com/zloirock/core-js/issues/910)

##### 3.15.2 - 2021.06.29
- Worked around breakage related to `zone.js` loaded before `core-js`, [#953](https://github.com/zloirock/core-js/issues/953)
- Added NodeJS 16.4 -> Chrome 91 compat data mapping
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@ Contributions are always welcome. If you don't know how you can help, you can ch
- Any shared helpers should be added to the [`packages/core-js/internals`](./packages/core-js/internals) directory.
- If the implementation for the `pure` version differs from the global version, add it to [`packages/core-js-pure/override`](./packages/core-js-pure/override) directory. The rest parts of `core-js-pure` will be copied from `core-js` package.
- For export the polyfill, in almost all cases use `internals/export` helper.
- Add feature detection of the polyfill to [`tests/compat/tests.js`](./tests/compat/tests.js) and compatibility data to [`packages/core-js-compat/src/data.js`](./packages/core-js-compat/src/data.js) and [`packages/core-js-compat/src/modules-by-versions.js`](./packages/core-js-compat/src/modules-by-versions.js) (this data also used for getting the default list of polyfills at bundling).
- Add feature detection of the polyfill to [`tests/compat/tests.js`](./tests/compat/tests.js) and compatibility data to [`packages/core-js-compat/src/data.mjs`](./packages/core-js-compat/src/data.mjs) and [`packages/core-js-compat/src/modules-by-versions.mjs`](./packages/core-js-compat/src/modules-by-versions.mjs) (this data also used for getting the default list of polyfills at bundling).
- Add it to entry points where it's required: directories [`packages/core-js/features`](./packages/core-js/features), [`packages/core-js/es`](./packages/core-js/es), [`packages/core-js/proposals`](./packages/core-js/proposals), [`packages/core-js/stage`](./packages/core-js/stage) and [`packages/core-js/web`](./packages/core-js/web).
- Add unit tests to [`tests/tests`](./tests/tests) and [`tests/pure`](./tests/pure).
- Add tests of entry points to [`tests/commonjs.js`](./tests/commonjs).
- Add tests of entry points to [`tests/commonjs.js`](./tests/commonjs.js).
- Add documentation to [README.md](./README.md).

## Style and standards
@@ -78,6 +78,6 @@ For updating `core-js-compat` data:
- Clone `core-js` repo.
- If you wanna add new data for a browser, run in this browser `tests/compat/index.html` and you will see which `core-js` modules required for this browser.
- If you wanna add new data for Node.js, run `tests/compat/node-runner.js` in required Node.js version and you will see results in the console.
- After getting this data, add it to [`packages/core-js-compat/src/data.js`](./packages/core-js-compat/src/data.js).
- If you wanna add new mapping (for example, add a new iOS Safari version based on Safari or Node.js based on Chrome), add it to [`packages/core-js-compat/src/mapping.js`](./packages/core-js-compat/src/mapping.js).
- After getting this data, add it to [`packages/core-js-compat/src/data.mjs`](./packages/core-js-compat/src/data.mjs).
- If you wanna add new mapping (for example, add a new iOS Safari version based on Safari or Node.js based on Chrome), add it to [`packages/core-js-compat/src/mapping.mjs`](./packages/core-js-compat/src/mapping.mjs).
- Add a pull request to `core-js` repo.
Loading