From 3471a2a9db3fd71a3a814ed041f3d4f997ed8db0 Mon Sep 17 00:00:00 2001 From: Denis Pushkarev Date: Wed, 5 Aug 2026 12:53:17 +0300 Subject: [PATCH] update `core-js` --- README.md | 2 +- package.json | 2 +- .../babel-plugin-polyfill-corejs3/README.md | 4 +- .../package.json | 6 +- .../src/built-in-definitions.ts | 22 +- .../src/shipped-proposals.ts | 6 +- .../actual-chrome-107-corejs-3.43/output.mjs | 2 + .../actual-chrome-107-corejs-3.44/output.mjs | 2 + .../actual-chrome-107-corejs-3.45/output.mjs | 2 + .../actual-chrome-107-corejs-3.46/output.mjs | 2 + .../actual-chrome-107-corejs-3.47/output.mjs | 2 + .../actual-chrome-107-corejs-3.48/output.mjs | 2 + .../actual-chrome-107-corejs-3.50/input.mjs | 1 + .../options.json | 15 + .../actual-chrome-107-corejs-3.50/output.mjs | 104 ++++ .../actual-corejs-3.43/output.mjs | 2 + .../actual-corejs-3.44/output.mjs | 2 + .../actual-corejs-3.45/output.mjs | 2 + .../actual-corejs-3.46/output.mjs | 2 + .../actual-corejs-3.47/output.mjs | 2 + .../actual-corejs-3.48/output.mjs | 2 + .../entry-global/actual-corejs-3.50/input.mjs | 1 + .../actual-corejs-3.50/options.json | 15 + .../actual-corejs-3.50/output.mjs | 342 +++++++++++++ .../entry-global/all-corejs-3.50/input.mjs | 1 + .../entry-global/all-corejs-3.50/options.json | 15 + .../entry-global/all-corejs-3.50/output.mjs | 457 ++++++++++++++++++ .../usage-global/all-corejs-3.43/output.mjs | 2 + .../usage-global/all-corejs-3.44/output.mjs | 2 + .../usage-global/all-corejs-3.45/output.mjs | 2 + .../usage-global/all-corejs-3.46/output.mjs | 2 + .../usage-global/all-corejs-3.47/output.mjs | 2 + .../usage-global/all-corejs-3.48/input.mjs | 6 + .../usage-global/all-corejs-3.48/output.mjs | 9 + .../usage-global/all-corejs-3.50/input.mjs | 126 +++++ .../usage-global/all-corejs-3.50/options.json | 15 + .../usage-global/all-corejs-3.50/output.mjs | 221 +++++++++ .../input.mjs | 6 + .../output.mjs | 4 + .../input.mjs | 126 +++++ .../options.json | 16 + .../output.mjs | 229 +++++++++ .../destructuring-iife/output.mjs | 1 + .../test/fixtures/usage-global/in/output.mjs | 1 + .../shippedProposals-corejs-3.43/output.mjs | 2 + .../shippedProposals-corejs-3.44/output.mjs | 2 + .../shippedProposals-corejs-3.45/output.mjs | 2 + .../shippedProposals-corejs-3.46/output.mjs | 2 + .../shippedProposals-corejs-3.47/output.mjs | 2 + .../shippedProposals-corejs-3.48/input.mjs | 5 + .../shippedProposals-corejs-3.48/output.mjs | 9 + .../shippedProposals-corejs-3.50/input.mjs | 126 +++++ .../shippedProposals-corejs-3.50/options.json | 16 + .../shippedProposals-corejs-3.50/output.mjs | 226 +++++++++ .../usage-pure/all-corejs-3.43/output.mjs | 6 +- .../usage-pure/all-corejs-3.44/output.mjs | 6 +- .../usage-pure/all-corejs-3.45/output.mjs | 6 +- .../usage-pure/all-corejs-3.46/output.mjs | 6 +- .../usage-pure/all-corejs-3.47/output.mjs | 6 +- .../usage-pure/all-corejs-3.48/input.mjs | 6 + .../usage-pure/all-corejs-3.48/output.mjs | 12 +- .../usage-pure/all-corejs-3.50/input.mjs | 126 +++++ .../usage-pure/all-corejs-3.50/options.json | 15 + .../usage-pure/all-corejs-3.50/output.mjs | 134 +++++ .../input.mjs | 6 + .../output.mjs | 4 + .../input.mjs | 126 +++++ .../options.json | 16 + .../output.mjs | 140 ++++++ yarn.lock | 84 ++-- 70 files changed, 2812 insertions(+), 66 deletions(-) create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.50/input.mjs create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.50/options.json create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.50/output.mjs create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.50/input.mjs create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.50/options.json create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.50/output.mjs create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.50/input.mjs create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.50/options.json create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.50/output.mjs create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.50/input.mjs create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.50/options.json create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.50/output.mjs create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.50/input.mjs create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.50/options.json create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.50/output.mjs create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.50/input.mjs create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.50/options.json create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.50/output.mjs create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.50/input.mjs create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.50/options.json create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.50/output.mjs create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.50/input.mjs create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.50/options.json create mode 100644 packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.50/output.mjs diff --git a/README.md b/README.md index dbb8f838..441d18f1 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The main Babel packages only transform JavaScript _syntax_: you also need to loa The easiest way to do so is to directly load the polyfill using a ` + ``` However, this simple approach can potentially include a lot of unnecessary code. The Babel plugins implemented in this repository automatically inject the polyfills in your code, while trying to only load what is really needed. It does this based on your compilation targets and on what you are using in your code. diff --git a/package.json b/package.json index 4cf6534b..8db848f5 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "@lerna/package": "patch:@lerna/package@npm:3.16.0#.yarn-patches/@lerna/package.patch", "@lerna/package-graph": "patch:@lerna/package-graph@npm:3.18.5#.yarn-patches/@lerna/package-graph.patch", "@lerna/pack-directory": "patch:@lerna/pack-directory@npm:3.16.4#.yarn-patches/@lerna/pack-directory.patch", - "@babel/preset-env/core-js-compat": "^3.48.0" + "@babel/preset-env/core-js-compat": "^3.50.0" }, "engines": { "node": "^20.19.0 || >=22.12.0", diff --git a/packages/babel-plugin-polyfill-corejs3/README.md b/packages/babel-plugin-polyfill-corejs3/README.md index 11f3e7c0..6d51890c 100644 --- a/packages/babel-plugin-polyfill-corejs3/README.md +++ b/packages/babel-plugin-polyfill-corejs3/README.md @@ -20,7 +20,7 @@ Add this plugin to your Babel configuration: ```json { - "plugins": [["polyfill-corejs3", { "method": "usage-global", "version": "3.48" }]] + "plugins": [["polyfill-corejs3", { "method": "usage-global", "version": "3.50" }]] } ``` @@ -55,7 +55,7 @@ If you are a library author, specify a reasonably modern `core-js` version in yo ```json { "dependencies": { - "core-js": "^3.48.0" + "core-js": "^3.50.0" } } ``` diff --git a/packages/babel-plugin-polyfill-corejs3/package.json b/packages/babel-plugin-polyfill-corejs3/package.json index 2ea02a16..c911a159 100644 --- a/packages/babel-plugin-polyfill-corejs3/package.json +++ b/packages/babel-plugin-polyfill-corejs3/package.json @@ -24,7 +24,7 @@ ], "dependencies": { "@babel/helper-define-polyfill-provider": "workspace:^1.0.0", - "core-js-compat": "^3.48.0" + "core-js-compat": "^3.50.0" }, "devDependencies": { "@babel/core": "^8.0.0", @@ -36,8 +36,8 @@ "@babel/plugin-transform-modules-commonjs": "^8.0.0", "@babel/plugin-transform-runtime": "^8.0.0", "@babel/plugin-transform-spread": "^8.0.0", - "core-js": "^3.48.0", - "core-js-pure": "^3.48.0" + "core-js": "^3.50.0", + "core-js-pure": "^3.50.0" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0" diff --git a/packages/babel-plugin-polyfill-corejs3/src/built-in-definitions.ts b/packages/babel-plugin-polyfill-corejs3/src/built-in-definitions.ts index cafb9d0b..0418773f 100644 --- a/packages/babel-plugin-polyfill-corejs3/src/built-in-definitions.ts +++ b/packages/babel-plugin-polyfill-corejs3/src/built-in-definitions.ts @@ -406,12 +406,12 @@ export const StaticProperties: ObjectMap2 = { ...IteratorDependencies, ]), zip: define("iterator/zip", [ - "esnext.iterator.zip", + "es.iterator.zip", ...IteratorDependencies, ...CommonIterators, ]), zipKeyed: define("iterator/zip-keyed", [ - "esnext.iterator.zip-keyed", + "es.iterator.zip-keyed", "es.object.create", "es.reflect.own-keys", ...IteratorDependencies, @@ -553,10 +553,20 @@ export const StaticProperties: ObjectMap2 = { Promise: { all: define(null, PromiseDependenciesWithIterators), + allKeyed: define("promise/all-keyed", [ + "esnext.promise.all-keyed", + "es.reflect.own-keys", + ...PromiseDependenciesWithIterators, + ]), allSettled: define("promise/all-settled", [ "es.promise.all-settled", ...PromiseDependenciesWithIterators, ]), + allSettledKeyed: define("promise/all-settled-keyed", [ + "esnext.promise.all-settled-keyed", + "es.reflect.own-keys", + ...PromiseDependenciesWithIterators, + ]), any: define("promise/any", [ "es.promise.any", "es.aggregate-error", @@ -905,6 +915,8 @@ export const InstanceProperties = { includes: define("instance/includes", [ "es.array.includes", "es.string.includes", + "esnext.iterator.includes", + ...IteratorDependencies, ]), indexed: define(null, [ "esnext.async-iterator.indexed", @@ -915,7 +927,11 @@ export const InstanceProperties = { indexOf: define("instance/index-of", ["es.array.index-of"]), isWellFormed: define("instance/is-well-formed", ["es.string.is-well-formed"]), italics: define(null, ["es.string.italics"]), - join: define(null, ["es.array.join"]), + join: define(null, [ + "es.array.join", + "esnext.iterator.join", + ...IteratorDependencies, + ]), keys: define("instance/keys", ArrayNatureIteratorsWithTag), lastIndex: define(null, ["esnext.array.last-index"]), lastIndexOf: define("instance/last-index-of", ["es.array.last-index-of"]), diff --git a/packages/babel-plugin-polyfill-corejs3/src/shipped-proposals.ts b/packages/babel-plugin-polyfill-corejs3/src/shipped-proposals.ts index 7e8bb449..e6aa9096 100644 --- a/packages/babel-plugin-polyfill-corejs3/src/shipped-proposals.ts +++ b/packages/babel-plugin-polyfill-corejs3/src/shipped-proposals.ts @@ -3,7 +3,9 @@ export default new Set([ "esnext.array.group", "esnext.array.group-to-map", - "esnext.iterator.zip", - "esnext.iterator.zip-keyed", + "esnext.iterator.chunks", + "esnext.iterator.includes", + "esnext.iterator.join", + "esnext.iterator.windows", "esnext.symbol.metadata", ]); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.43/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.43/output.mjs index 00bf1089..472bbcb9 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.43/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.43/output.mjs @@ -68,8 +68,10 @@ import "core-js/modules/esnext.async-iterator.some.js"; import "core-js/modules/esnext.async-iterator.take.js"; import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.44/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.44/output.mjs index 00bf1089..472bbcb9 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.44/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.44/output.mjs @@ -68,8 +68,10 @@ import "core-js/modules/esnext.async-iterator.some.js"; import "core-js/modules/esnext.async-iterator.take.js"; import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.45/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.45/output.mjs index 334fda9c..6bdb07e2 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.45/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.45/output.mjs @@ -75,8 +75,10 @@ import "core-js/modules/esnext.async-iterator.some.js"; import "core-js/modules/esnext.async-iterator.take.js"; import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.46/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.46/output.mjs index 334fda9c..6bdb07e2 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.46/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.46/output.mjs @@ -75,8 +75,10 @@ import "core-js/modules/esnext.async-iterator.some.js"; import "core-js/modules/esnext.async-iterator.take.js"; import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.47/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.47/output.mjs index a6ba60fc..478b0682 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.47/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.47/output.mjs @@ -79,7 +79,9 @@ import "core-js/modules/esnext.async-iterator.some.js"; import "core-js/modules/esnext.async-iterator.take.js"; import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.to-async.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.map.get-or-insert.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.48/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.48/output.mjs index bcf361bd..58b138b8 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.48/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.48/output.mjs @@ -83,7 +83,9 @@ import "core-js/modules/esnext.async-iterator.some.js"; import "core-js/modules/esnext.async-iterator.take.js"; import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.to-async.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.symbol.metadata.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.50/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.50/input.mjs new file mode 100644 index 00000000..a3a9078c --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.50/input.mjs @@ -0,0 +1 @@ +import 'core-js/actual'; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.50/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.50/options.json new file mode 100644 index 00000000..3372a374 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.50/options.json @@ -0,0 +1,15 @@ +{ + "externalHelpers": false, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "version": "3.50", + "method": "entry-global", + "targets": { + "chrome": 107 + } + } + ] + ] +} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.50/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.50/output.mjs new file mode 100644 index 00000000..777f4922 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.50/output.mjs @@ -0,0 +1,104 @@ +import "core-js/modules/es.symbol.async-dispose.js"; +import "core-js/modules/es.symbol.dispose.js"; +import "core-js/modules/es.error.is-error.js"; +import "core-js/modules/es.suppressed-error.constructor.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.array.to-reversed.js"; +import "core-js/modules/es.array.to-sorted.js"; +import "core-js/modules/es.array.to-spliced.js"; +import "core-js/modules/es.array.with.js"; +import "core-js/modules/es.data-view.get-float16.js"; +import "core-js/modules/es.data-view.set-float16.js"; +import "core-js/modules/es.array-buffer.detached.js"; +import "core-js/modules/es.array-buffer.transfer.js"; +import "core-js/modules/es.array-buffer.transfer-to-fixed-length.js"; +import "core-js/modules/es.disposable-stack.constructor.js"; +import "core-js/modules/es.iterator.constructor.js"; +import "core-js/modules/es.iterator.concat.js"; +import "core-js/modules/es.iterator.dispose.js"; +import "core-js/modules/es.iterator.drop.js"; +import "core-js/modules/es.iterator.every.js"; +import "core-js/modules/es.iterator.filter.js"; +import "core-js/modules/es.iterator.find.js"; +import "core-js/modules/es.iterator.flat-map.js"; +import "core-js/modules/es.iterator.for-each.js"; +import "core-js/modules/es.iterator.from.js"; +import "core-js/modules/es.iterator.map.js"; +import "core-js/modules/es.iterator.reduce.js"; +import "core-js/modules/es.iterator.some.js"; +import "core-js/modules/es.iterator.take.js"; +import "core-js/modules/es.iterator.to-array.js"; +import "core-js/modules/es.iterator.zip.js"; +import "core-js/modules/es.iterator.zip-keyed.js"; +import "core-js/modules/es.json.is-raw-json.js"; +import "core-js/modules/es.json.parse.js"; +import "core-js/modules/es.json.raw-json.js"; +import "core-js/modules/es.json.stringify.js"; +import "core-js/modules/es.map.group-by.js"; +import "core-js/modules/es.map.get-or-insert.js"; +import "core-js/modules/es.map.get-or-insert-computed.js"; +import "core-js/modules/es.math.f16round.js"; +import "core-js/modules/es.math.sum-precise.js"; +import "core-js/modules/es.object.group-by.js"; +import "core-js/modules/es.promise.try.js"; +import "core-js/modules/es.promise.with-resolvers.js"; +import "core-js/modules/es.array.from-async.js"; +import "core-js/modules/es.async-disposable-stack.constructor.js"; +import "core-js/modules/es.async-iterator.async-dispose.js"; +import "core-js/modules/es.regexp.escape.js"; +import "core-js/modules/es.regexp.flags.js"; +import "core-js/modules/es.set.difference.v2.js"; +import "core-js/modules/es.set.intersection.v2.js"; +import "core-js/modules/es.set.is-disjoint-from.v2.js"; +import "core-js/modules/es.set.is-subset-of.v2.js"; +import "core-js/modules/es.set.is-superset-of.v2.js"; +import "core-js/modules/es.set.symmetric-difference.v2.js"; +import "core-js/modules/es.set.union.v2.js"; +import "core-js/modules/es.string.is-well-formed.js"; +import "core-js/modules/es.string.to-well-formed.js"; +import "core-js/modules/es.typed-array.to-reversed.js"; +import "core-js/modules/es.typed-array.to-sorted.js"; +import "core-js/modules/es.typed-array.with.js"; +import "core-js/modules/es.uint8-array.from-base64.js"; +import "core-js/modules/es.uint8-array.from-hex.js"; +import "core-js/modules/es.uint8-array.set-from-base64.js"; +import "core-js/modules/es.uint8-array.set-from-hex.js"; +import "core-js/modules/es.uint8-array.to-base64.js"; +import "core-js/modules/es.uint8-array.to-hex.js"; +import "core-js/modules/es.weak-map.get-or-insert.js"; +import "core-js/modules/es.weak-map.get-or-insert-computed.js"; +import "core-js/modules/esnext.array.group.js"; +import "core-js/modules/esnext.array.group-by.js"; +import "core-js/modules/esnext.array.group-by-to-map.js"; +import "core-js/modules/esnext.array.group-to-map.js"; +import "core-js/modules/esnext.async-iterator.constructor.js"; +import "core-js/modules/esnext.async-iterator.drop.js"; +import "core-js/modules/esnext.async-iterator.every.js"; +import "core-js/modules/esnext.async-iterator.filter.js"; +import "core-js/modules/esnext.async-iterator.find.js"; +import "core-js/modules/esnext.async-iterator.flat-map.js"; +import "core-js/modules/esnext.async-iterator.for-each.js"; +import "core-js/modules/esnext.async-iterator.from.js"; +import "core-js/modules/esnext.async-iterator.map.js"; +import "core-js/modules/esnext.async-iterator.reduce.js"; +import "core-js/modules/esnext.async-iterator.some.js"; +import "core-js/modules/esnext.async-iterator.take.js"; +import "core-js/modules/esnext.async-iterator.to-array.js"; +import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.iterator.chunks.js"; +import "core-js/modules/esnext.iterator.includes.js"; +import "core-js/modules/esnext.iterator.join.js"; +import "core-js/modules/esnext.iterator.to-async.js"; +import "core-js/modules/esnext.iterator.windows.js"; +import "core-js/modules/esnext.promise.all-keyed.js"; +import "core-js/modules/esnext.promise.all-settled-keyed.js"; +import "core-js/modules/esnext.symbol.metadata.js"; +import "core-js/modules/esnext.typed-array.to-spliced.js"; +import "core-js/modules/web.dom-exception.stack.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.structured-clone.js"; +import "core-js/modules/web.url.can-parse.js"; +import "core-js/modules/web.url.parse.js"; +import "core-js/modules/web.url-search-params.delete.js"; +import "core-js/modules/web.url-search-params.has.js"; +import "core-js/modules/web.url-search-params.size.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.43/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.43/output.mjs index 3ca921a0..2c9a8ac2 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.43/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.43/output.mjs @@ -294,8 +294,10 @@ import "core-js/modules/esnext.async-iterator.some.js"; import "core-js/modules/esnext.async-iterator.take.js"; import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.44/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.44/output.mjs index 3ca921a0..2c9a8ac2 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.44/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.44/output.mjs @@ -294,8 +294,10 @@ import "core-js/modules/esnext.async-iterator.some.js"; import "core-js/modules/esnext.async-iterator.take.js"; import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.45/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.45/output.mjs index 04fc7ad1..61c43207 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.45/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.45/output.mjs @@ -301,8 +301,10 @@ import "core-js/modules/esnext.async-iterator.some.js"; import "core-js/modules/esnext.async-iterator.take.js"; import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.46/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.46/output.mjs index 04fc7ad1..61c43207 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.46/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.46/output.mjs @@ -301,8 +301,10 @@ import "core-js/modules/esnext.async-iterator.some.js"; import "core-js/modules/esnext.async-iterator.take.js"; import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.47/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.47/output.mjs index 0f600ac4..b52f2420 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.47/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.47/output.mjs @@ -305,7 +305,9 @@ import "core-js/modules/esnext.async-iterator.some.js"; import "core-js/modules/esnext.async-iterator.take.js"; import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.to-async.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.map.get-or-insert.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.48/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.48/output.mjs index 5a58e7a2..f3cbfd35 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.48/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.48/output.mjs @@ -309,7 +309,9 @@ import "core-js/modules/esnext.async-iterator.some.js"; import "core-js/modules/esnext.async-iterator.take.js"; import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.to-async.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.symbol.metadata.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.50/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.50/input.mjs new file mode 100644 index 00000000..a3a9078c --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.50/input.mjs @@ -0,0 +1 @@ +import 'core-js/actual'; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.50/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.50/options.json new file mode 100644 index 00000000..303d8f4b --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.50/options.json @@ -0,0 +1,15 @@ +{ + "externalHelpers": false, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "version": "3.50", + "method": "entry-global" + } + ] + ], + "targets": { + "ie": "5" + } +} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.50/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.50/output.mjs new file mode 100644 index 00000000..3b75e9f8 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.50/output.mjs @@ -0,0 +1,342 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-dispose.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.symbol.dispose.js"; +import "core-js/modules/es.symbol.has-instance.js"; +import "core-js/modules/es.symbol.is-concat-spreadable.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.symbol.match.js"; +import "core-js/modules/es.symbol.match-all.js"; +import "core-js/modules/es.symbol.replace.js"; +import "core-js/modules/es.symbol.search.js"; +import "core-js/modules/es.symbol.species.js"; +import "core-js/modules/es.symbol.split.js"; +import "core-js/modules/es.symbol.to-primitive.js"; +import "core-js/modules/es.symbol.to-string-tag.js"; +import "core-js/modules/es.symbol.unscopables.js"; +import "core-js/modules/es.error.cause.js"; +import "core-js/modules/es.error.is-error.js"; +import "core-js/modules/es.error.to-string.js"; +import "core-js/modules/es.aggregate-error.js"; +import "core-js/modules/es.aggregate-error.cause.js"; +import "core-js/modules/es.suppressed-error.constructor.js"; +import "core-js/modules/es.array.at.js"; +import "core-js/modules/es.array.concat.js"; +import "core-js/modules/es.array.copy-within.js"; +import "core-js/modules/es.array.every.js"; +import "core-js/modules/es.array.fill.js"; +import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.find.js"; +import "core-js/modules/es.array.find-index.js"; +import "core-js/modules/es.array.find-last.js"; +import "core-js/modules/es.array.find-last-index.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.for-each.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.includes.js"; +import "core-js/modules/es.array.index-of.js"; +import "core-js/modules/es.array.is-array.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.join.js"; +import "core-js/modules/es.array.last-index-of.js"; +import "core-js/modules/es.array.map.js"; +import "core-js/modules/es.array.of.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.array.reduce.js"; +import "core-js/modules/es.array.reduce-right.js"; +import "core-js/modules/es.array.reverse.js"; +import "core-js/modules/es.array.slice.js"; +import "core-js/modules/es.array.some.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.species.js"; +import "core-js/modules/es.array.splice.js"; +import "core-js/modules/es.array.to-reversed.js"; +import "core-js/modules/es.array.to-sorted.js"; +import "core-js/modules/es.array.to-spliced.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.array.unshift.js"; +import "core-js/modules/es.array.with.js"; +import "core-js/modules/es.array-buffer.constructor.js"; +import "core-js/modules/es.array-buffer.is-view.js"; +import "core-js/modules/es.array-buffer.slice.js"; +import "core-js/modules/es.data-view.js"; +import "core-js/modules/es.data-view.get-float16.js"; +import "core-js/modules/es.data-view.set-float16.js"; +import "core-js/modules/es.array-buffer.detached.js"; +import "core-js/modules/es.array-buffer.transfer.js"; +import "core-js/modules/es.array-buffer.transfer-to-fixed-length.js"; +import "core-js/modules/es.date.get-year.js"; +import "core-js/modules/es.date.now.js"; +import "core-js/modules/es.date.to-iso-string.js"; +import "core-js/modules/es.date.to-json.js"; +import "core-js/modules/es.date.to-primitive.js"; +import "core-js/modules/es.date.to-string.js"; +import "core-js/modules/es.disposable-stack.constructor.js"; +import "core-js/modules/es.function.bind.js"; +import "core-js/modules/es.function.has-instance.js"; +import "core-js/modules/es.function.name.js"; +import "core-js/modules/es.global-this.js"; +import "core-js/modules/es.iterator.constructor.js"; +import "core-js/modules/es.iterator.concat.js"; +import "core-js/modules/es.iterator.dispose.js"; +import "core-js/modules/es.iterator.drop.js"; +import "core-js/modules/es.iterator.every.js"; +import "core-js/modules/es.iterator.filter.js"; +import "core-js/modules/es.iterator.find.js"; +import "core-js/modules/es.iterator.flat-map.js"; +import "core-js/modules/es.iterator.for-each.js"; +import "core-js/modules/es.iterator.from.js"; +import "core-js/modules/es.iterator.map.js"; +import "core-js/modules/es.iterator.reduce.js"; +import "core-js/modules/es.iterator.some.js"; +import "core-js/modules/es.iterator.take.js"; +import "core-js/modules/es.iterator.to-array.js"; +import "core-js/modules/es.iterator.zip.js"; +import "core-js/modules/es.iterator.zip-keyed.js"; +import "core-js/modules/es.json.is-raw-json.js"; +import "core-js/modules/es.json.parse.js"; +import "core-js/modules/es.json.raw-json.js"; +import "core-js/modules/es.json.stringify.js"; +import "core-js/modules/es.json.to-string-tag.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.map.group-by.js"; +import "core-js/modules/es.map.get-or-insert.js"; +import "core-js/modules/es.map.get-or-insert-computed.js"; +import "core-js/modules/es.math.acosh.js"; +import "core-js/modules/es.math.asinh.js"; +import "core-js/modules/es.math.atanh.js"; +import "core-js/modules/es.math.cbrt.js"; +import "core-js/modules/es.math.clz32.js"; +import "core-js/modules/es.math.cosh.js"; +import "core-js/modules/es.math.expm1.js"; +import "core-js/modules/es.math.fround.js"; +import "core-js/modules/es.math.f16round.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.math.imul.js"; +import "core-js/modules/es.math.log10.js"; +import "core-js/modules/es.math.log1p.js"; +import "core-js/modules/es.math.log2.js"; +import "core-js/modules/es.math.sign.js"; +import "core-js/modules/es.math.sinh.js"; +import "core-js/modules/es.math.sum-precise.js"; +import "core-js/modules/es.math.tanh.js"; +import "core-js/modules/es.math.to-string-tag.js"; +import "core-js/modules/es.math.trunc.js"; +import "core-js/modules/es.number.constructor.js"; +import "core-js/modules/es.number.epsilon.js"; +import "core-js/modules/es.number.is-finite.js"; +import "core-js/modules/es.number.is-integer.js"; +import "core-js/modules/es.number.is-nan.js"; +import "core-js/modules/es.number.is-safe-integer.js"; +import "core-js/modules/es.number.max-safe-integer.js"; +import "core-js/modules/es.number.min-safe-integer.js"; +import "core-js/modules/es.number.parse-float.js"; +import "core-js/modules/es.number.parse-int.js"; +import "core-js/modules/es.number.to-exponential.js"; +import "core-js/modules/es.number.to-fixed.js"; +import "core-js/modules/es.number.to-precision.js"; +import "core-js/modules/es.object.assign.js"; +import "core-js/modules/es.object.create.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-properties.js"; +import "core-js/modules/es.object.define-property.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.entries.js"; +import "core-js/modules/es.object.freeze.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.get-own-property-descriptor.js"; +import "core-js/modules/es.object.get-own-property-descriptors.js"; +import "core-js/modules/es.object.get-own-property-names.js"; +import "core-js/modules/es.object.get-prototype-of.js"; +import "core-js/modules/es.object.group-by.js"; +import "core-js/modules/es.object.has-own.js"; +import "core-js/modules/es.object.is.js"; +import "core-js/modules/es.object.is-extensible.js"; +import "core-js/modules/es.object.is-frozen.js"; +import "core-js/modules/es.object.is-sealed.js"; +import "core-js/modules/es.object.keys.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.object.prevent-extensions.js"; +import "core-js/modules/es.object.proto.js"; +import "core-js/modules/es.object.seal.js"; +import "core-js/modules/es.object.set-prototype-of.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.object.values.js"; +import "core-js/modules/es.parse-float.js"; +import "core-js/modules/es.parse-int.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.all-settled.js"; +import "core-js/modules/es.promise.any.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.promise.try.js"; +import "core-js/modules/es.promise.with-resolvers.js"; +import "core-js/modules/es.array.from-async.js"; +import "core-js/modules/es.async-disposable-stack.constructor.js"; +import "core-js/modules/es.async-iterator.async-dispose.js"; +import "core-js/modules/es.reflect.apply.js"; +import "core-js/modules/es.reflect.construct.js"; +import "core-js/modules/es.reflect.define-property.js"; +import "core-js/modules/es.reflect.delete-property.js"; +import "core-js/modules/es.reflect.get.js"; +import "core-js/modules/es.reflect.get-own-property-descriptor.js"; +import "core-js/modules/es.reflect.get-prototype-of.js"; +import "core-js/modules/es.reflect.has.js"; +import "core-js/modules/es.reflect.is-extensible.js"; +import "core-js/modules/es.reflect.own-keys.js"; +import "core-js/modules/es.reflect.prevent-extensions.js"; +import "core-js/modules/es.reflect.set.js"; +import "core-js/modules/es.reflect.set-prototype-of.js"; +import "core-js/modules/es.reflect.to-string-tag.js"; +import "core-js/modules/es.regexp.constructor.js"; +import "core-js/modules/es.regexp.escape.js"; +import "core-js/modules/es.regexp.dot-all.js"; +import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/es.regexp.flags.js"; +import "core-js/modules/es.regexp.sticky.js"; +import "core-js/modules/es.regexp.test.js"; +import "core-js/modules/es.regexp.to-string.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.set.difference.v2.js"; +import "core-js/modules/es.set.intersection.v2.js"; +import "core-js/modules/es.set.is-disjoint-from.v2.js"; +import "core-js/modules/es.set.is-subset-of.v2.js"; +import "core-js/modules/es.set.is-superset-of.v2.js"; +import "core-js/modules/es.set.symmetric-difference.v2.js"; +import "core-js/modules/es.set.union.v2.js"; +import "core-js/modules/es.string.at-alternative.js"; +import "core-js/modules/es.string.code-point-at.js"; +import "core-js/modules/es.string.ends-with.js"; +import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.is-well-formed.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.match.js"; +import "core-js/modules/es.string.match-all.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.raw.js"; +import "core-js/modules/es.string.repeat.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.replace-all.js"; +import "core-js/modules/es.string.search.js"; +import "core-js/modules/es.string.split.js"; +import "core-js/modules/es.string.starts-with.js"; +import "core-js/modules/es.string.substr.js"; +import "core-js/modules/es.string.to-well-formed.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/es.string.anchor.js"; +import "core-js/modules/es.string.big.js"; +import "core-js/modules/es.string.blink.js"; +import "core-js/modules/es.string.bold.js"; +import "core-js/modules/es.string.fixed.js"; +import "core-js/modules/es.string.fontcolor.js"; +import "core-js/modules/es.string.fontsize.js"; +import "core-js/modules/es.string.italics.js"; +import "core-js/modules/es.string.link.js"; +import "core-js/modules/es.string.small.js"; +import "core-js/modules/es.string.strike.js"; +import "core-js/modules/es.string.sub.js"; +import "core-js/modules/es.string.sup.js"; +import "core-js/modules/es.typed-array.float32-array.js"; +import "core-js/modules/es.typed-array.float64-array.js"; +import "core-js/modules/es.typed-array.int8-array.js"; +import "core-js/modules/es.typed-array.int16-array.js"; +import "core-js/modules/es.typed-array.int32-array.js"; +import "core-js/modules/es.typed-array.uint8-array.js"; +import "core-js/modules/es.typed-array.uint8-clamped-array.js"; +import "core-js/modules/es.typed-array.uint16-array.js"; +import "core-js/modules/es.typed-array.uint32-array.js"; +import "core-js/modules/es.typed-array.at.js"; +import "core-js/modules/es.typed-array.copy-within.js"; +import "core-js/modules/es.typed-array.every.js"; +import "core-js/modules/es.typed-array.fill.js"; +import "core-js/modules/es.typed-array.filter.js"; +import "core-js/modules/es.typed-array.find.js"; +import "core-js/modules/es.typed-array.find-index.js"; +import "core-js/modules/es.typed-array.find-last.js"; +import "core-js/modules/es.typed-array.find-last-index.js"; +import "core-js/modules/es.typed-array.for-each.js"; +import "core-js/modules/es.typed-array.from.js"; +import "core-js/modules/es.typed-array.includes.js"; +import "core-js/modules/es.typed-array.index-of.js"; +import "core-js/modules/es.typed-array.iterator.js"; +import "core-js/modules/es.typed-array.join.js"; +import "core-js/modules/es.typed-array.last-index-of.js"; +import "core-js/modules/es.typed-array.map.js"; +import "core-js/modules/es.typed-array.of.js"; +import "core-js/modules/es.typed-array.reduce.js"; +import "core-js/modules/es.typed-array.reduce-right.js"; +import "core-js/modules/es.typed-array.reverse.js"; +import "core-js/modules/es.typed-array.set.js"; +import "core-js/modules/es.typed-array.slice.js"; +import "core-js/modules/es.typed-array.some.js"; +import "core-js/modules/es.typed-array.sort.js"; +import "core-js/modules/es.typed-array.subarray.js"; +import "core-js/modules/es.typed-array.to-locale-string.js"; +import "core-js/modules/es.typed-array.to-reversed.js"; +import "core-js/modules/es.typed-array.to-sorted.js"; +import "core-js/modules/es.typed-array.to-string.js"; +import "core-js/modules/es.typed-array.with.js"; +import "core-js/modules/es.uint8-array.from-base64.js"; +import "core-js/modules/es.uint8-array.from-hex.js"; +import "core-js/modules/es.uint8-array.set-from-base64.js"; +import "core-js/modules/es.uint8-array.set-from-hex.js"; +import "core-js/modules/es.uint8-array.to-base64.js"; +import "core-js/modules/es.uint8-array.to-hex.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/es.weak-map.get-or-insert.js"; +import "core-js/modules/es.weak-map.get-or-insert-computed.js"; +import "core-js/modules/es.weak-set.js"; +import "core-js/modules/esnext.array.group.js"; +import "core-js/modules/esnext.array.group-by.js"; +import "core-js/modules/esnext.array.group-by-to-map.js"; +import "core-js/modules/esnext.array.group-to-map.js"; +import "core-js/modules/esnext.async-iterator.constructor.js"; +import "core-js/modules/esnext.async-iterator.drop.js"; +import "core-js/modules/esnext.async-iterator.every.js"; +import "core-js/modules/esnext.async-iterator.filter.js"; +import "core-js/modules/esnext.async-iterator.find.js"; +import "core-js/modules/esnext.async-iterator.flat-map.js"; +import "core-js/modules/esnext.async-iterator.for-each.js"; +import "core-js/modules/esnext.async-iterator.from.js"; +import "core-js/modules/esnext.async-iterator.map.js"; +import "core-js/modules/esnext.async-iterator.reduce.js"; +import "core-js/modules/esnext.async-iterator.some.js"; +import "core-js/modules/esnext.async-iterator.take.js"; +import "core-js/modules/esnext.async-iterator.to-array.js"; +import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.iterator.chunks.js"; +import "core-js/modules/esnext.iterator.includes.js"; +import "core-js/modules/esnext.iterator.join.js"; +import "core-js/modules/esnext.iterator.to-async.js"; +import "core-js/modules/esnext.iterator.windows.js"; +import "core-js/modules/esnext.promise.all-keyed.js"; +import "core-js/modules/esnext.promise.all-settled-keyed.js"; +import "core-js/modules/esnext.symbol.metadata.js"; +import "core-js/modules/esnext.typed-array.to-spliced.js"; +import "core-js/modules/web.atob.js"; +import "core-js/modules/web.btoa.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.dom-exception.constructor.js"; +import "core-js/modules/web.dom-exception.stack.js"; +import "core-js/modules/web.dom-exception.to-string-tag.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.self.js"; +import "core-js/modules/web.structured-clone.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.can-parse.js"; +import "core-js/modules/web.url.parse.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/web.url-search-params.delete.js"; +import "core-js/modules/web.url-search-params.has.js"; +import "core-js/modules/web.url-search-params.size.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.50/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.50/input.mjs new file mode 100644 index 00000000..66bfb4d1 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.50/input.mjs @@ -0,0 +1 @@ +import 'core-js'; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.50/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.50/options.json new file mode 100644 index 00000000..303d8f4b --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.50/options.json @@ -0,0 +1,15 @@ +{ + "externalHelpers": false, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "version": "3.50", + "method": "entry-global" + } + ] + ], + "targets": { + "ie": "5" + } +} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.50/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.50/output.mjs new file mode 100644 index 00000000..ff7c7ee0 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.50/output.mjs @@ -0,0 +1,457 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-dispose.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.symbol.dispose.js"; +import "core-js/modules/es.symbol.has-instance.js"; +import "core-js/modules/es.symbol.is-concat-spreadable.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.symbol.match.js"; +import "core-js/modules/es.symbol.match-all.js"; +import "core-js/modules/es.symbol.replace.js"; +import "core-js/modules/es.symbol.search.js"; +import "core-js/modules/es.symbol.species.js"; +import "core-js/modules/es.symbol.split.js"; +import "core-js/modules/es.symbol.to-primitive.js"; +import "core-js/modules/es.symbol.to-string-tag.js"; +import "core-js/modules/es.symbol.unscopables.js"; +import "core-js/modules/es.error.cause.js"; +import "core-js/modules/es.error.is-error.js"; +import "core-js/modules/es.error.to-string.js"; +import "core-js/modules/es.aggregate-error.js"; +import "core-js/modules/es.aggregate-error.cause.js"; +import "core-js/modules/es.suppressed-error.constructor.js"; +import "core-js/modules/es.array.at.js"; +import "core-js/modules/es.array.concat.js"; +import "core-js/modules/es.array.copy-within.js"; +import "core-js/modules/es.array.every.js"; +import "core-js/modules/es.array.fill.js"; +import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.find.js"; +import "core-js/modules/es.array.find-index.js"; +import "core-js/modules/es.array.find-last.js"; +import "core-js/modules/es.array.find-last-index.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.for-each.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.includes.js"; +import "core-js/modules/es.array.index-of.js"; +import "core-js/modules/es.array.is-array.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.join.js"; +import "core-js/modules/es.array.last-index-of.js"; +import "core-js/modules/es.array.map.js"; +import "core-js/modules/es.array.of.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.array.reduce.js"; +import "core-js/modules/es.array.reduce-right.js"; +import "core-js/modules/es.array.reverse.js"; +import "core-js/modules/es.array.slice.js"; +import "core-js/modules/es.array.some.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.species.js"; +import "core-js/modules/es.array.splice.js"; +import "core-js/modules/es.array.to-reversed.js"; +import "core-js/modules/es.array.to-sorted.js"; +import "core-js/modules/es.array.to-spliced.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.array.unshift.js"; +import "core-js/modules/es.array.with.js"; +import "core-js/modules/es.array-buffer.constructor.js"; +import "core-js/modules/es.array-buffer.is-view.js"; +import "core-js/modules/es.array-buffer.slice.js"; +import "core-js/modules/es.data-view.js"; +import "core-js/modules/es.data-view.get-float16.js"; +import "core-js/modules/es.data-view.set-float16.js"; +import "core-js/modules/es.array-buffer.detached.js"; +import "core-js/modules/es.array-buffer.transfer.js"; +import "core-js/modules/es.array-buffer.transfer-to-fixed-length.js"; +import "core-js/modules/es.date.get-year.js"; +import "core-js/modules/es.date.now.js"; +import "core-js/modules/es.date.to-iso-string.js"; +import "core-js/modules/es.date.to-json.js"; +import "core-js/modules/es.date.to-primitive.js"; +import "core-js/modules/es.date.to-string.js"; +import "core-js/modules/es.disposable-stack.constructor.js"; +import "core-js/modules/es.function.bind.js"; +import "core-js/modules/es.function.has-instance.js"; +import "core-js/modules/es.function.name.js"; +import "core-js/modules/es.global-this.js"; +import "core-js/modules/es.iterator.constructor.js"; +import "core-js/modules/es.iterator.concat.js"; +import "core-js/modules/es.iterator.dispose.js"; +import "core-js/modules/es.iterator.drop.js"; +import "core-js/modules/es.iterator.every.js"; +import "core-js/modules/es.iterator.filter.js"; +import "core-js/modules/es.iterator.find.js"; +import "core-js/modules/es.iterator.flat-map.js"; +import "core-js/modules/es.iterator.for-each.js"; +import "core-js/modules/es.iterator.from.js"; +import "core-js/modules/es.iterator.map.js"; +import "core-js/modules/es.iterator.reduce.js"; +import "core-js/modules/es.iterator.some.js"; +import "core-js/modules/es.iterator.take.js"; +import "core-js/modules/es.iterator.to-array.js"; +import "core-js/modules/es.iterator.zip.js"; +import "core-js/modules/es.iterator.zip-keyed.js"; +import "core-js/modules/es.json.is-raw-json.js"; +import "core-js/modules/es.json.parse.js"; +import "core-js/modules/es.json.raw-json.js"; +import "core-js/modules/es.json.stringify.js"; +import "core-js/modules/es.json.to-string-tag.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.map.group-by.js"; +import "core-js/modules/es.map.get-or-insert.js"; +import "core-js/modules/es.map.get-or-insert-computed.js"; +import "core-js/modules/es.math.acosh.js"; +import "core-js/modules/es.math.asinh.js"; +import "core-js/modules/es.math.atanh.js"; +import "core-js/modules/es.math.cbrt.js"; +import "core-js/modules/es.math.clz32.js"; +import "core-js/modules/es.math.cosh.js"; +import "core-js/modules/es.math.expm1.js"; +import "core-js/modules/es.math.fround.js"; +import "core-js/modules/es.math.f16round.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.math.imul.js"; +import "core-js/modules/es.math.log10.js"; +import "core-js/modules/es.math.log1p.js"; +import "core-js/modules/es.math.log2.js"; +import "core-js/modules/es.math.sign.js"; +import "core-js/modules/es.math.sinh.js"; +import "core-js/modules/es.math.sum-precise.js"; +import "core-js/modules/es.math.tanh.js"; +import "core-js/modules/es.math.to-string-tag.js"; +import "core-js/modules/es.math.trunc.js"; +import "core-js/modules/es.number.constructor.js"; +import "core-js/modules/es.number.epsilon.js"; +import "core-js/modules/es.number.is-finite.js"; +import "core-js/modules/es.number.is-integer.js"; +import "core-js/modules/es.number.is-nan.js"; +import "core-js/modules/es.number.is-safe-integer.js"; +import "core-js/modules/es.number.max-safe-integer.js"; +import "core-js/modules/es.number.min-safe-integer.js"; +import "core-js/modules/es.number.parse-float.js"; +import "core-js/modules/es.number.parse-int.js"; +import "core-js/modules/es.number.to-exponential.js"; +import "core-js/modules/es.number.to-fixed.js"; +import "core-js/modules/es.number.to-precision.js"; +import "core-js/modules/es.object.assign.js"; +import "core-js/modules/es.object.create.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-properties.js"; +import "core-js/modules/es.object.define-property.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.entries.js"; +import "core-js/modules/es.object.freeze.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.get-own-property-descriptor.js"; +import "core-js/modules/es.object.get-own-property-descriptors.js"; +import "core-js/modules/es.object.get-own-property-names.js"; +import "core-js/modules/es.object.get-prototype-of.js"; +import "core-js/modules/es.object.group-by.js"; +import "core-js/modules/es.object.has-own.js"; +import "core-js/modules/es.object.is.js"; +import "core-js/modules/es.object.is-extensible.js"; +import "core-js/modules/es.object.is-frozen.js"; +import "core-js/modules/es.object.is-sealed.js"; +import "core-js/modules/es.object.keys.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.object.prevent-extensions.js"; +import "core-js/modules/es.object.proto.js"; +import "core-js/modules/es.object.seal.js"; +import "core-js/modules/es.object.set-prototype-of.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.object.values.js"; +import "core-js/modules/es.parse-float.js"; +import "core-js/modules/es.parse-int.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.all-settled.js"; +import "core-js/modules/es.promise.any.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.promise.try.js"; +import "core-js/modules/es.promise.with-resolvers.js"; +import "core-js/modules/es.array.from-async.js"; +import "core-js/modules/es.async-disposable-stack.constructor.js"; +import "core-js/modules/es.async-iterator.async-dispose.js"; +import "core-js/modules/es.reflect.apply.js"; +import "core-js/modules/es.reflect.construct.js"; +import "core-js/modules/es.reflect.define-property.js"; +import "core-js/modules/es.reflect.delete-property.js"; +import "core-js/modules/es.reflect.get.js"; +import "core-js/modules/es.reflect.get-own-property-descriptor.js"; +import "core-js/modules/es.reflect.get-prototype-of.js"; +import "core-js/modules/es.reflect.has.js"; +import "core-js/modules/es.reflect.is-extensible.js"; +import "core-js/modules/es.reflect.own-keys.js"; +import "core-js/modules/es.reflect.prevent-extensions.js"; +import "core-js/modules/es.reflect.set.js"; +import "core-js/modules/es.reflect.set-prototype-of.js"; +import "core-js/modules/es.reflect.to-string-tag.js"; +import "core-js/modules/es.regexp.constructor.js"; +import "core-js/modules/es.regexp.escape.js"; +import "core-js/modules/es.regexp.dot-all.js"; +import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/es.regexp.flags.js"; +import "core-js/modules/es.regexp.sticky.js"; +import "core-js/modules/es.regexp.test.js"; +import "core-js/modules/es.regexp.to-string.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.set.difference.v2.js"; +import "core-js/modules/es.set.intersection.v2.js"; +import "core-js/modules/es.set.is-disjoint-from.v2.js"; +import "core-js/modules/es.set.is-subset-of.v2.js"; +import "core-js/modules/es.set.is-superset-of.v2.js"; +import "core-js/modules/es.set.symmetric-difference.v2.js"; +import "core-js/modules/es.set.union.v2.js"; +import "core-js/modules/es.string.at-alternative.js"; +import "core-js/modules/es.string.code-point-at.js"; +import "core-js/modules/es.string.ends-with.js"; +import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.is-well-formed.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.match.js"; +import "core-js/modules/es.string.match-all.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.raw.js"; +import "core-js/modules/es.string.repeat.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.replace-all.js"; +import "core-js/modules/es.string.search.js"; +import "core-js/modules/es.string.split.js"; +import "core-js/modules/es.string.starts-with.js"; +import "core-js/modules/es.string.substr.js"; +import "core-js/modules/es.string.to-well-formed.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/es.string.anchor.js"; +import "core-js/modules/es.string.big.js"; +import "core-js/modules/es.string.blink.js"; +import "core-js/modules/es.string.bold.js"; +import "core-js/modules/es.string.fixed.js"; +import "core-js/modules/es.string.fontcolor.js"; +import "core-js/modules/es.string.fontsize.js"; +import "core-js/modules/es.string.italics.js"; +import "core-js/modules/es.string.link.js"; +import "core-js/modules/es.string.small.js"; +import "core-js/modules/es.string.strike.js"; +import "core-js/modules/es.string.sub.js"; +import "core-js/modules/es.string.sup.js"; +import "core-js/modules/es.typed-array.float32-array.js"; +import "core-js/modules/es.typed-array.float64-array.js"; +import "core-js/modules/es.typed-array.int8-array.js"; +import "core-js/modules/es.typed-array.int16-array.js"; +import "core-js/modules/es.typed-array.int32-array.js"; +import "core-js/modules/es.typed-array.uint8-array.js"; +import "core-js/modules/es.typed-array.uint8-clamped-array.js"; +import "core-js/modules/es.typed-array.uint16-array.js"; +import "core-js/modules/es.typed-array.uint32-array.js"; +import "core-js/modules/es.typed-array.at.js"; +import "core-js/modules/es.typed-array.copy-within.js"; +import "core-js/modules/es.typed-array.every.js"; +import "core-js/modules/es.typed-array.fill.js"; +import "core-js/modules/es.typed-array.filter.js"; +import "core-js/modules/es.typed-array.find.js"; +import "core-js/modules/es.typed-array.find-index.js"; +import "core-js/modules/es.typed-array.find-last.js"; +import "core-js/modules/es.typed-array.find-last-index.js"; +import "core-js/modules/es.typed-array.for-each.js"; +import "core-js/modules/es.typed-array.from.js"; +import "core-js/modules/es.typed-array.includes.js"; +import "core-js/modules/es.typed-array.index-of.js"; +import "core-js/modules/es.typed-array.iterator.js"; +import "core-js/modules/es.typed-array.join.js"; +import "core-js/modules/es.typed-array.last-index-of.js"; +import "core-js/modules/es.typed-array.map.js"; +import "core-js/modules/es.typed-array.of.js"; +import "core-js/modules/es.typed-array.reduce.js"; +import "core-js/modules/es.typed-array.reduce-right.js"; +import "core-js/modules/es.typed-array.reverse.js"; +import "core-js/modules/es.typed-array.set.js"; +import "core-js/modules/es.typed-array.slice.js"; +import "core-js/modules/es.typed-array.some.js"; +import "core-js/modules/es.typed-array.sort.js"; +import "core-js/modules/es.typed-array.subarray.js"; +import "core-js/modules/es.typed-array.to-locale-string.js"; +import "core-js/modules/es.typed-array.to-reversed.js"; +import "core-js/modules/es.typed-array.to-sorted.js"; +import "core-js/modules/es.typed-array.to-string.js"; +import "core-js/modules/es.typed-array.with.js"; +import "core-js/modules/es.uint8-array.from-base64.js"; +import "core-js/modules/es.uint8-array.from-hex.js"; +import "core-js/modules/es.uint8-array.set-from-base64.js"; +import "core-js/modules/es.uint8-array.set-from-hex.js"; +import "core-js/modules/es.uint8-array.to-base64.js"; +import "core-js/modules/es.uint8-array.to-hex.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/es.weak-map.get-or-insert.js"; +import "core-js/modules/es.weak-map.get-or-insert-computed.js"; +import "core-js/modules/es.weak-set.js"; +import "core-js/modules/esnext.array.filter-out.js"; +import "core-js/modules/esnext.array.filter-reject.js"; +import "core-js/modules/esnext.array.group.js"; +import "core-js/modules/esnext.array.group-by.js"; +import "core-js/modules/esnext.array.group-by-to-map.js"; +import "core-js/modules/esnext.array.group-to-map.js"; +import "core-js/modules/esnext.array.is-template-object.js"; +import "core-js/modules/esnext.array.last-index.js"; +import "core-js/modules/esnext.array.last-item.js"; +import "core-js/modules/esnext.array.unique-by.js"; +import "core-js/modules/esnext.async-iterator.constructor.js"; +import "core-js/modules/esnext.async-iterator.as-indexed-pairs.js"; +import "core-js/modules/esnext.async-iterator.drop.js"; +import "core-js/modules/esnext.async-iterator.every.js"; +import "core-js/modules/esnext.async-iterator.filter.js"; +import "core-js/modules/esnext.async-iterator.find.js"; +import "core-js/modules/esnext.async-iterator.flat-map.js"; +import "core-js/modules/esnext.async-iterator.for-each.js"; +import "core-js/modules/esnext.async-iterator.from.js"; +import "core-js/modules/esnext.async-iterator.indexed.js"; +import "core-js/modules/esnext.async-iterator.map.js"; +import "core-js/modules/esnext.async-iterator.reduce.js"; +import "core-js/modules/esnext.async-iterator.some.js"; +import "core-js/modules/esnext.async-iterator.take.js"; +import "core-js/modules/esnext.async-iterator.to-array.js"; +import "core-js/modules/esnext.bigint.range.js"; +import "core-js/modules/esnext.composite-key.js"; +import "core-js/modules/esnext.composite-symbol.js"; +import "core-js/modules/esnext.data-view.get-uint8-clamped.js"; +import "core-js/modules/esnext.data-view.set-uint8-clamped.js"; +import "core-js/modules/esnext.function.demethodize.js"; +import "core-js/modules/esnext.function.is-callable.js"; +import "core-js/modules/esnext.function.is-constructor.js"; +import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.function.un-this.js"; +import "core-js/modules/esnext.iterator.as-indexed-pairs.js"; +import "core-js/modules/esnext.iterator.chunks.js"; +import "core-js/modules/esnext.iterator.includes.js"; +import "core-js/modules/esnext.iterator.indexed.js"; +import "core-js/modules/esnext.iterator.join.js"; +import "core-js/modules/esnext.iterator.range.js"; +import "core-js/modules/esnext.iterator.sliding.js"; +import "core-js/modules/esnext.iterator.to-async.js"; +import "core-js/modules/esnext.iterator.windows.js"; +import "core-js/modules/esnext.map.delete-all.js"; +import "core-js/modules/esnext.map.emplace.js"; +import "core-js/modules/esnext.map.every.js"; +import "core-js/modules/esnext.map.filter.js"; +import "core-js/modules/esnext.map.find.js"; +import "core-js/modules/esnext.map.find-key.js"; +import "core-js/modules/esnext.map.from.js"; +import "core-js/modules/esnext.map.includes.js"; +import "core-js/modules/esnext.map.key-by.js"; +import "core-js/modules/esnext.map.key-of.js"; +import "core-js/modules/esnext.map.map-keys.js"; +import "core-js/modules/esnext.map.map-values.js"; +import "core-js/modules/esnext.map.merge.js"; +import "core-js/modules/esnext.map.of.js"; +import "core-js/modules/esnext.map.reduce.js"; +import "core-js/modules/esnext.map.some.js"; +import "core-js/modules/esnext.map.update.js"; +import "core-js/modules/esnext.map.update-or-insert.js"; +import "core-js/modules/esnext.map.upsert.js"; +import "core-js/modules/esnext.math.clamp.js"; +import "core-js/modules/esnext.math.deg-per-rad.js"; +import "core-js/modules/esnext.math.degrees.js"; +import "core-js/modules/esnext.math.fscale.js"; +import "core-js/modules/esnext.math.iaddh.js"; +import "core-js/modules/esnext.math.imulh.js"; +import "core-js/modules/esnext.math.isubh.js"; +import "core-js/modules/esnext.math.rad-per-deg.js"; +import "core-js/modules/esnext.math.radians.js"; +import "core-js/modules/esnext.math.scale.js"; +import "core-js/modules/esnext.math.seeded-prng.js"; +import "core-js/modules/esnext.math.signbit.js"; +import "core-js/modules/esnext.math.umulh.js"; +import "core-js/modules/esnext.number.clamp.js"; +import "core-js/modules/esnext.number.from-string.js"; +import "core-js/modules/esnext.number.range.js"; +import "core-js/modules/esnext.object.iterate-entries.js"; +import "core-js/modules/esnext.object.iterate-keys.js"; +import "core-js/modules/esnext.object.iterate-values.js"; +import "core-js/modules/esnext.observable.js"; +import "core-js/modules/esnext.promise.all-keyed.js"; +import "core-js/modules/esnext.promise.all-settled-keyed.js"; +import "core-js/modules/esnext.reflect.define-metadata.js"; +import "core-js/modules/esnext.reflect.delete-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata-keys.js"; +import "core-js/modules/esnext.reflect.get-own-metadata.js"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; +import "core-js/modules/esnext.reflect.has-metadata.js"; +import "core-js/modules/esnext.reflect.has-own-metadata.js"; +import "core-js/modules/esnext.reflect.metadata.js"; +import "core-js/modules/esnext.set.add-all.js"; +import "core-js/modules/esnext.set.delete-all.js"; +import "core-js/modules/esnext.set.difference.js"; +import "core-js/modules/esnext.set.every.js"; +import "core-js/modules/esnext.set.filter.js"; +import "core-js/modules/esnext.set.find.js"; +import "core-js/modules/esnext.set.from.js"; +import "core-js/modules/esnext.set.intersection.js"; +import "core-js/modules/esnext.set.is-disjoint-from.js"; +import "core-js/modules/esnext.set.is-subset-of.js"; +import "core-js/modules/esnext.set.is-superset-of.js"; +import "core-js/modules/esnext.set.join.js"; +import "core-js/modules/esnext.set.map.js"; +import "core-js/modules/esnext.set.of.js"; +import "core-js/modules/esnext.set.reduce.js"; +import "core-js/modules/esnext.set.some.js"; +import "core-js/modules/esnext.set.symmetric-difference.js"; +import "core-js/modules/esnext.set.union.js"; +import "core-js/modules/esnext.string.at.js"; +import "core-js/modules/esnext.string.cooked.js"; +import "core-js/modules/esnext.string.code-points.js"; +import "core-js/modules/esnext.string.dedent.js"; +import "core-js/modules/esnext.symbol.custom-matcher.js"; +import "core-js/modules/esnext.symbol.is-registered-symbol.js"; +import "core-js/modules/esnext.symbol.is-registered.js"; +import "core-js/modules/esnext.symbol.is-well-known-symbol.js"; +import "core-js/modules/esnext.symbol.is-well-known.js"; +import "core-js/modules/esnext.symbol.matcher.js"; +import "core-js/modules/esnext.symbol.metadata.js"; +import "core-js/modules/esnext.symbol.metadata-key.js"; +import "core-js/modules/esnext.symbol.observable.js"; +import "core-js/modules/esnext.symbol.pattern-match.js"; +import "core-js/modules/esnext.symbol.replace-all.js"; +import "core-js/modules/esnext.typed-array.from-async.js"; +import "core-js/modules/esnext.typed-array.filter-out.js"; +import "core-js/modules/esnext.typed-array.filter-reject.js"; +import "core-js/modules/esnext.typed-array.group-by.js"; +import "core-js/modules/esnext.typed-array.to-spliced.js"; +import "core-js/modules/esnext.typed-array.unique-by.js"; +import "core-js/modules/esnext.weak-map.delete-all.js"; +import "core-js/modules/esnext.weak-map.from.js"; +import "core-js/modules/esnext.weak-map.of.js"; +import "core-js/modules/esnext.weak-map.emplace.js"; +import "core-js/modules/esnext.weak-map.upsert.js"; +import "core-js/modules/esnext.weak-set.add-all.js"; +import "core-js/modules/esnext.weak-set.delete-all.js"; +import "core-js/modules/esnext.weak-set.from.js"; +import "core-js/modules/esnext.weak-set.of.js"; +import "core-js/modules/web.atob.js"; +import "core-js/modules/web.btoa.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.dom-exception.constructor.js"; +import "core-js/modules/web.dom-exception.stack.js"; +import "core-js/modules/web.dom-exception.to-string-tag.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.self.js"; +import "core-js/modules/web.structured-clone.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.can-parse.js"; +import "core-js/modules/web.url.parse.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/web.url-search-params.delete.js"; +import "core-js/modules/web.url-search-params.has.js"; +import "core-js/modules/web.url-search-params.size.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.43/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.43/output.mjs index d2813567..03fa8bd9 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.43/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.43/output.mjs @@ -97,6 +97,8 @@ import "core-js/modules/es.typed-array.to-string.js"; import "core-js/modules/es.typed-array.with.js"; import "core-js/modules/es.weak-map.js"; import "core-js/modules/esnext.iterator.concat.js"; +import "core-js/modules/esnext.iterator.zip.js"; +import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; import "core-js/modules/esnext.json.parse.js"; import "core-js/modules/esnext.json.raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.44/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.44/output.mjs index f8afe48d..616968e7 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.44/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.44/output.mjs @@ -97,6 +97,8 @@ import "core-js/modules/es.typed-array.to-string.js"; import "core-js/modules/es.typed-array.with.js"; import "core-js/modules/es.weak-map.js"; import "core-js/modules/esnext.iterator.concat.js"; +import "core-js/modules/esnext.iterator.zip.js"; +import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; import "core-js/modules/esnext.json.parse.js"; import "core-js/modules/esnext.json.raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.45/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.45/output.mjs index 46064f98..ecc2a763 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.45/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.45/output.mjs @@ -104,6 +104,8 @@ import "core-js/modules/es.uint8-array.to-base64.js"; import "core-js/modules/es.uint8-array.to-hex.js"; import "core-js/modules/es.weak-map.js"; import "core-js/modules/esnext.iterator.concat.js"; +import "core-js/modules/esnext.iterator.zip.js"; +import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; import "core-js/modules/esnext.json.parse.js"; import "core-js/modules/esnext.json.raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.46/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.46/output.mjs index 46064f98..ecc2a763 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.46/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.46/output.mjs @@ -104,6 +104,8 @@ import "core-js/modules/es.uint8-array.to-base64.js"; import "core-js/modules/es.uint8-array.to-hex.js"; import "core-js/modules/es.weak-map.js"; import "core-js/modules/esnext.iterator.concat.js"; +import "core-js/modules/esnext.iterator.zip.js"; +import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; import "core-js/modules/esnext.json.parse.js"; import "core-js/modules/esnext.json.raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.47/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.47/output.mjs index 2cd8d78d..19e7cba9 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.47/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.47/output.mjs @@ -107,6 +107,8 @@ import "core-js/modules/es.uint8-array.set-from-hex.js"; import "core-js/modules/es.uint8-array.to-base64.js"; import "core-js/modules/es.uint8-array.to-hex.js"; import "core-js/modules/es.weak-map.js"; +import "core-js/modules/esnext.iterator.zip.js"; +import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.map.get-or-insert.js"; import "core-js/modules/esnext.map.get-or-insert-computed.js"; import "core-js/modules/web.btoa.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.48/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.48/input.mjs index 122b5acc..5dc555e5 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.48/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.48/input.mjs @@ -118,3 +118,9 @@ a.sliding(b); a.windows(b); a.clamp(b, c); + +Promise.allKeyed(a); +Promise.allSettledKeyed(a); + +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.48/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.48/output.mjs index 4cc55975..ac91ee30 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.48/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.48/output.mjs @@ -9,7 +9,9 @@ import "core-js/modules/es.array.filter.js"; import "core-js/modules/es.array.find-last.js"; import "core-js/modules/es.array.find-last-index.js"; import "core-js/modules/es.array.for-each.js"; +import "core-js/modules/es.array.includes.js"; import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.join.js"; import "core-js/modules/es.array.map.js"; import "core-js/modules/es.array.push.js"; import "core-js/modules/es.array.with.js"; @@ -66,6 +68,7 @@ import "core-js/modules/es.set.is-superset-of.v2.js"; import "core-js/modules/es.set.symmetric-difference.v2.js"; import "core-js/modules/es.set.union.v2.js"; import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.includes.js"; import "core-js/modules/es.string.is-well-formed.js"; import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.string.match-all.js"; @@ -109,6 +112,8 @@ import "core-js/modules/es.uint8-array.set-from-hex.js"; import "core-js/modules/es.uint8-array.to-base64.js"; import "core-js/modules/es.uint8-array.to-hex.js"; import "core-js/modules/es.weak-map.js"; +import "core-js/modules/esnext.iterator.zip.js"; +import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/web.btoa.js"; import "core-js/modules/web.dom-collections.for-each.js"; import "core-js/modules/web.dom-collections.iterator.js"; @@ -210,3 +215,7 @@ a.chunks(b); a.sliding(b); a.windows(b); a.clamp(b, c); +Promise.allKeyed(a); +Promise.allSettledKeyed(a); +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.50/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.50/input.mjs new file mode 100644 index 00000000..5dc555e5 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.50/input.mjs @@ -0,0 +1,126 @@ +[].findLast(fn); +[].findLastIndex(fn); + +[].asIndexedPairs(); + +Iterator.from({ + next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 }) + }).forEach(console.log).toArray(); + +AsyncIterator.from([1, 2, 3, 4, 5, 6, 7]) + .drop(1) + .take(5) + .filter(it => it % 2) + .groupBy(it => id % 4) + .map(it => it ** 2) + .toArray() + .then(console.log); + +[1, 2, 3, 4, 5, 6, 7, 7].uniqueBy(x => x).groupBy(x => x % 2); + +Number.range(1, 2); +BigInt.range(1n, 2n); + +Array.isTemplateObject((x => x)`a${ x }z`) + +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0}); + +/x/.dotAll; +/x/.sticky + +Symbol.asyncDispose +Symbol.matcher +Symbol.matchAll +Symbol.metadata +Symbol.replaceAll + +new URL(url); + +const foo = [1, 2, 3].groupByToMap(bar); + +const push = [].push.unThis(); + +Function.isConstructor; + +throw new DOMException(); + +structuredClone(72); + +btoa('hi'); + +foo.indexed; +bar.with; +buz.push; +fuz.__proto__; + +string.isWellFormed; +string.toWellFormed; + +String.dedent`42`; + +self; +SuppressedError +DisposableStack; +AsyncDisposableStack; + +Iterator.range(foo, bar); +JSON.parse(foo); +JSON.isRawJSON(foo); +JSON.rawJSON(foo); +Symbol.isWellKnown(foo); +Symbol.isRegistered(foo); +Function.demethodize(); + +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + +URL.canParse(foo); + +Symbol.isWellKnownSymbol(foo); +Symbol.isRegisteredSymbol(foo); +Symbol.metadata; +Object.groupBy(a, b); +Map.groupBy(a, b); +Promise.withResolvers(); +new URLSearchParams().has(a, b); + +Math.f16round(foo); +foo.getFloat16(0); +foo.setFloat16(0, 1); +foo.getUint8Clamped(0); +foo.setUint8Clamped(0, 1); + +RegExp.escape(foo); + +Uint8Array.fromBase64(string); +Uint8Array.fromHex(string); +new Uint8Array(foo).setFromBase64(string); +new Uint8Array(foo).setFromHex(string); +new Uint8Array(foo).toBase64(); +new Uint8Array(foo).toHex(); + +URL.parse(x); +Math.sumPrecise(x); +Symbol.customMatcher; + +Iterator.concat(a, b); +new Map().getOrInsert(a, b); + +SyntaxError.isError(a); + +Array.fromAsync(a); + +Iterator.zip(a, b); +Iterator.zipKeyed(a, b); + +a.chunks(b); +a.sliding(b); +a.windows(b); + +a.clamp(b, c); + +Promise.allKeyed(a); +Promise.allSettledKeyed(a); + +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.50/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.50/options.json new file mode 100644 index 00000000..61ce5432 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.50/options.json @@ -0,0 +1,15 @@ +{ + "externalHelpers": false, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "version": "3.50", + "method": "usage-global" + } + ] + ], + "targets": { + "ie": "5" + } +} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.50/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.50/output.mjs new file mode 100644 index 00000000..934c1041 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.50/output.mjs @@ -0,0 +1,221 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.async-dispose.js"; +import "core-js/modules/es.symbol.match-all.js"; +import "core-js/modules/es.error.cause.js"; +import "core-js/modules/es.error.is-error.js"; +import "core-js/modules/es.error.to-string.js"; +import "core-js/modules/es.suppressed-error.constructor.js"; +import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.find-last.js"; +import "core-js/modules/es.array.find-last-index.js"; +import "core-js/modules/es.array.for-each.js"; +import "core-js/modules/es.array.includes.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.join.js"; +import "core-js/modules/es.array.map.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.array.with.js"; +import "core-js/modules/es.array-buffer.constructor.js"; +import "core-js/modules/es.array-buffer.slice.js"; +import "core-js/modules/es.data-view.js"; +import "core-js/modules/es.data-view.get-float16.js"; +import "core-js/modules/es.data-view.set-float16.js"; +import "core-js/modules/es.array-buffer.detached.js"; +import "core-js/modules/es.array-buffer.transfer.js"; +import "core-js/modules/es.array-buffer.transfer-to-fixed-length.js"; +import "core-js/modules/es.disposable-stack.constructor.js"; +import "core-js/modules/es.iterator.constructor.js"; +import "core-js/modules/es.iterator.concat.js"; +import "core-js/modules/es.iterator.dispose.js"; +import "core-js/modules/es.iterator.drop.js"; +import "core-js/modules/es.iterator.filter.js"; +import "core-js/modules/es.iterator.for-each.js"; +import "core-js/modules/es.iterator.from.js"; +import "core-js/modules/es.iterator.map.js"; +import "core-js/modules/es.iterator.take.js"; +import "core-js/modules/es.iterator.to-array.js"; +import "core-js/modules/es.iterator.zip.js"; +import "core-js/modules/es.iterator.zip-keyed.js"; +import "core-js/modules/es.json.is-raw-json.js"; +import "core-js/modules/es.json.parse.js"; +import "core-js/modules/es.json.raw-json.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.map.group-by.js"; +import "core-js/modules/es.map.get-or-insert.js"; +import "core-js/modules/es.map.get-or-insert-computed.js"; +import "core-js/modules/es.math.f16round.js"; +import "core-js/modules/es.math.sum-precise.js"; +import "core-js/modules/es.object.create.js"; +import "core-js/modules/es.object.freeze.js"; +import "core-js/modules/es.object.group-by.js"; +import "core-js/modules/es.object.keys.js"; +import "core-js/modules/es.object.proto.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.with-resolvers.js"; +import "core-js/modules/es.array.from-async.js"; +import "core-js/modules/es.async-disposable-stack.constructor.js"; +import "core-js/modules/es.async-iterator.async-dispose.js"; +import "core-js/modules/es.reflect.own-keys.js"; +import "core-js/modules/es.regexp.escape.js"; +import "core-js/modules/es.regexp.dot-all.js"; +import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/es.regexp.sticky.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.set.difference.v2.js"; +import "core-js/modules/es.set.intersection.v2.js"; +import "core-js/modules/es.set.is-disjoint-from.v2.js"; +import "core-js/modules/es.set.is-subset-of.v2.js"; +import "core-js/modules/es.set.is-superset-of.v2.js"; +import "core-js/modules/es.set.symmetric-difference.v2.js"; +import "core-js/modules/es.set.union.v2.js"; +import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.is-well-formed.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.match-all.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.replace-all.js"; +import "core-js/modules/es.string.to-well-formed.js"; +import "core-js/modules/es.typed-array.uint8-array.js"; +import "core-js/modules/es.typed-array.at.js"; +import "core-js/modules/es.typed-array.copy-within.js"; +import "core-js/modules/es.typed-array.every.js"; +import "core-js/modules/es.typed-array.fill.js"; +import "core-js/modules/es.typed-array.filter.js"; +import "core-js/modules/es.typed-array.find.js"; +import "core-js/modules/es.typed-array.find-index.js"; +import "core-js/modules/es.typed-array.find-last.js"; +import "core-js/modules/es.typed-array.find-last-index.js"; +import "core-js/modules/es.typed-array.for-each.js"; +import "core-js/modules/es.typed-array.includes.js"; +import "core-js/modules/es.typed-array.index-of.js"; +import "core-js/modules/es.typed-array.iterator.js"; +import "core-js/modules/es.typed-array.join.js"; +import "core-js/modules/es.typed-array.last-index-of.js"; +import "core-js/modules/es.typed-array.map.js"; +import "core-js/modules/es.typed-array.reduce.js"; +import "core-js/modules/es.typed-array.reduce-right.js"; +import "core-js/modules/es.typed-array.reverse.js"; +import "core-js/modules/es.typed-array.set.js"; +import "core-js/modules/es.typed-array.slice.js"; +import "core-js/modules/es.typed-array.some.js"; +import "core-js/modules/es.typed-array.sort.js"; +import "core-js/modules/es.typed-array.subarray.js"; +import "core-js/modules/es.typed-array.to-locale-string.js"; +import "core-js/modules/es.typed-array.to-reversed.js"; +import "core-js/modules/es.typed-array.to-sorted.js"; +import "core-js/modules/es.typed-array.to-string.js"; +import "core-js/modules/es.typed-array.with.js"; +import "core-js/modules/es.uint8-array.from-base64.js"; +import "core-js/modules/es.uint8-array.from-hex.js"; +import "core-js/modules/es.uint8-array.set-from-base64.js"; +import "core-js/modules/es.uint8-array.set-from-hex.js"; +import "core-js/modules/es.uint8-array.to-base64.js"; +import "core-js/modules/es.uint8-array.to-hex.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/web.btoa.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.dom-exception.constructor.js"; +import "core-js/modules/web.dom-exception.stack.js"; +import "core-js/modules/web.dom-exception.to-string-tag.js"; +import "core-js/modules/web.self.js"; +import "core-js/modules/web.structured-clone.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.can-parse.js"; +import "core-js/modules/web.url.parse.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/web.url-search-params.delete.js"; +import "core-js/modules/web.url-search-params.has.js"; +import "core-js/modules/web.url-search-params.size.js"; +[].findLast(fn); +[].findLastIndex(fn); +[].asIndexedPairs(); +Iterator.from({ + next: () => ({ + done: Math.random() > .9, + value: Math.random() * 10 | 0 + }) +}).forEach(console.log).toArray(); +AsyncIterator.from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2).groupBy(it => id % 4).map(it => it ** 2).toArray().then(console.log); +[1, 2, 3, 4, 5, 6, 7, 7].uniqueBy(x => x).groupBy(x => x % 2); +Number.range(1, 2); +BigInt.range(1n, 2n); +Array.isTemplateObject((x => x)`a${x}z`); +new Map([['x', 1]]).emplace('x', { + update: x => x + 1, + insert: () => 0 +}); +/x/.dotAll; +/x/.sticky; +Symbol.asyncDispose; +Symbol.matcher; +Symbol.matchAll; +Symbol.metadata; +Symbol.replaceAll; +new URL(url); +const foo = [1, 2, 3].groupByToMap(bar); +const push = [].push.unThis(); +Function.isConstructor; +throw new DOMException(); +structuredClone(72); +btoa('hi'); +foo.indexed; +bar.with; +buz.push; +fuz.__proto__; +string.isWellFormed; +string.toWellFormed; +String.dedent`42`; +self; +SuppressedError; +DisposableStack; +AsyncDisposableStack; +Iterator.range(foo, bar); +JSON.parse(foo); +JSON.isRawJSON(foo); +JSON.rawJSON(foo); +Symbol.isWellKnown(foo); +Symbol.isRegistered(foo); +Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); +URL.canParse(foo); +Symbol.isWellKnownSymbol(foo); +Symbol.isRegisteredSymbol(foo); +Symbol.metadata; +Object.groupBy(a, b); +Map.groupBy(a, b); +Promise.withResolvers(); +new URLSearchParams().has(a, b); +Math.f16round(foo); +foo.getFloat16(0); +foo.setFloat16(0, 1); +foo.getUint8Clamped(0); +foo.setUint8Clamped(0, 1); +RegExp.escape(foo); +Uint8Array.fromBase64(string); +Uint8Array.fromHex(string); +new Uint8Array(foo).setFromBase64(string); +new Uint8Array(foo).setFromHex(string); +new Uint8Array(foo).toBase64(); +new Uint8Array(foo).toHex(); +URL.parse(x); +Math.sumPrecise(x); +Symbol.customMatcher; +Iterator.concat(a, b); +new Map().getOrInsert(a, b); +SyntaxError.isError(a); +Array.fromAsync(a); +Iterator.zip(a, b); +Iterator.zipKeyed(a, b); +a.chunks(b); +a.sliding(b); +a.windows(b); +a.clamp(b, c); +Promise.allKeyed(a); +Promise.allSettledKeyed(a); +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.48/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.48/input.mjs index 122b5acc..5dc555e5 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.48/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.48/input.mjs @@ -118,3 +118,9 @@ a.sliding(b); a.windows(b); a.clamp(b, c); + +Promise.allKeyed(a); +Promise.allSettledKeyed(a); + +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.48/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.48/output.mjs index 61677c04..6b18d408 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.48/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.48/output.mjs @@ -219,3 +219,7 @@ a.chunks(b); a.sliding(b); a.windows(b); a.clamp(b, c); +Promise.allKeyed(a); +Promise.allSettledKeyed(a); +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.50/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.50/input.mjs new file mode 100644 index 00000000..5dc555e5 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.50/input.mjs @@ -0,0 +1,126 @@ +[].findLast(fn); +[].findLastIndex(fn); + +[].asIndexedPairs(); + +Iterator.from({ + next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 }) + }).forEach(console.log).toArray(); + +AsyncIterator.from([1, 2, 3, 4, 5, 6, 7]) + .drop(1) + .take(5) + .filter(it => it % 2) + .groupBy(it => id % 4) + .map(it => it ** 2) + .toArray() + .then(console.log); + +[1, 2, 3, 4, 5, 6, 7, 7].uniqueBy(x => x).groupBy(x => x % 2); + +Number.range(1, 2); +BigInt.range(1n, 2n); + +Array.isTemplateObject((x => x)`a${ x }z`) + +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0}); + +/x/.dotAll; +/x/.sticky + +Symbol.asyncDispose +Symbol.matcher +Symbol.matchAll +Symbol.metadata +Symbol.replaceAll + +new URL(url); + +const foo = [1, 2, 3].groupByToMap(bar); + +const push = [].push.unThis(); + +Function.isConstructor; + +throw new DOMException(); + +structuredClone(72); + +btoa('hi'); + +foo.indexed; +bar.with; +buz.push; +fuz.__proto__; + +string.isWellFormed; +string.toWellFormed; + +String.dedent`42`; + +self; +SuppressedError +DisposableStack; +AsyncDisposableStack; + +Iterator.range(foo, bar); +JSON.parse(foo); +JSON.isRawJSON(foo); +JSON.rawJSON(foo); +Symbol.isWellKnown(foo); +Symbol.isRegistered(foo); +Function.demethodize(); + +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + +URL.canParse(foo); + +Symbol.isWellKnownSymbol(foo); +Symbol.isRegisteredSymbol(foo); +Symbol.metadata; +Object.groupBy(a, b); +Map.groupBy(a, b); +Promise.withResolvers(); +new URLSearchParams().has(a, b); + +Math.f16round(foo); +foo.getFloat16(0); +foo.setFloat16(0, 1); +foo.getUint8Clamped(0); +foo.setUint8Clamped(0, 1); + +RegExp.escape(foo); + +Uint8Array.fromBase64(string); +Uint8Array.fromHex(string); +new Uint8Array(foo).setFromBase64(string); +new Uint8Array(foo).setFromHex(string); +new Uint8Array(foo).toBase64(); +new Uint8Array(foo).toHex(); + +URL.parse(x); +Math.sumPrecise(x); +Symbol.customMatcher; + +Iterator.concat(a, b); +new Map().getOrInsert(a, b); + +SyntaxError.isError(a); + +Array.fromAsync(a); + +Iterator.zip(a, b); +Iterator.zipKeyed(a, b); + +a.chunks(b); +a.sliding(b); +a.windows(b); + +a.clamp(b, c); + +Promise.allKeyed(a); +Promise.allSettledKeyed(a); + +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.50/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.50/options.json new file mode 100644 index 00000000..3a1dbcf9 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.50/options.json @@ -0,0 +1,16 @@ +{ + "externalHelpers": false, + "targets": { + "chrome": 107 + }, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "method": "usage-global", + "version": "3.50", + "proposals": true + } + ] + ] +} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.50/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.50/output.mjs new file mode 100644 index 00000000..81ee79cb --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.50/output.mjs @@ -0,0 +1,229 @@ +import "core-js/modules/es.symbol.async-dispose.js"; +import "core-js/modules/es.error.is-error.js"; +import "core-js/modules/es.suppressed-error.constructor.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.array.with.js"; +import "core-js/modules/es.data-view.get-float16.js"; +import "core-js/modules/es.data-view.set-float16.js"; +import "core-js/modules/es.array-buffer.detached.js"; +import "core-js/modules/es.array-buffer.transfer.js"; +import "core-js/modules/es.array-buffer.transfer-to-fixed-length.js"; +import "core-js/modules/es.disposable-stack.constructor.js"; +import "core-js/modules/es.iterator.constructor.js"; +import "core-js/modules/es.iterator.concat.js"; +import "core-js/modules/es.iterator.dispose.js"; +import "core-js/modules/es.iterator.drop.js"; +import "core-js/modules/es.iterator.filter.js"; +import "core-js/modules/es.iterator.for-each.js"; +import "core-js/modules/es.iterator.from.js"; +import "core-js/modules/es.iterator.map.js"; +import "core-js/modules/es.iterator.take.js"; +import "core-js/modules/es.iterator.to-array.js"; +import "core-js/modules/es.iterator.zip.js"; +import "core-js/modules/es.iterator.zip-keyed.js"; +import "core-js/modules/es.json.is-raw-json.js"; +import "core-js/modules/es.json.parse.js"; +import "core-js/modules/es.json.raw-json.js"; +import "core-js/modules/es.map.group-by.js"; +import "core-js/modules/es.map.get-or-insert.js"; +import "core-js/modules/es.map.get-or-insert-computed.js"; +import "core-js/modules/es.math.f16round.js"; +import "core-js/modules/es.math.sum-precise.js"; +import "core-js/modules/es.object.group-by.js"; +import "core-js/modules/es.promise.with-resolvers.js"; +import "core-js/modules/es.array.from-async.js"; +import "core-js/modules/es.async-disposable-stack.constructor.js"; +import "core-js/modules/es.async-iterator.async-dispose.js"; +import "core-js/modules/es.regexp.escape.js"; +import "core-js/modules/es.set.difference.v2.js"; +import "core-js/modules/es.set.intersection.v2.js"; +import "core-js/modules/es.set.is-disjoint-from.v2.js"; +import "core-js/modules/es.set.is-subset-of.v2.js"; +import "core-js/modules/es.set.is-superset-of.v2.js"; +import "core-js/modules/es.set.symmetric-difference.v2.js"; +import "core-js/modules/es.set.union.v2.js"; +import "core-js/modules/es.string.is-well-formed.js"; +import "core-js/modules/es.string.to-well-formed.js"; +import "core-js/modules/es.typed-array.to-reversed.js"; +import "core-js/modules/es.typed-array.to-sorted.js"; +import "core-js/modules/es.typed-array.with.js"; +import "core-js/modules/es.uint8-array.from-base64.js"; +import "core-js/modules/es.uint8-array.from-hex.js"; +import "core-js/modules/es.uint8-array.set-from-base64.js"; +import "core-js/modules/es.uint8-array.set-from-hex.js"; +import "core-js/modules/es.uint8-array.to-base64.js"; +import "core-js/modules/es.uint8-array.to-hex.js"; +import "core-js/modules/esnext.array.group-by.js"; +import "core-js/modules/esnext.array.group-by-to-map.js"; +import "core-js/modules/esnext.array.is-template-object.js"; +import "core-js/modules/esnext.array.unique-by.js"; +import "core-js/modules/esnext.async-iterator.constructor.js"; +import "core-js/modules/esnext.async-iterator.drop.js"; +import "core-js/modules/esnext.async-iterator.every.js"; +import "core-js/modules/esnext.async-iterator.filter.js"; +import "core-js/modules/esnext.async-iterator.find.js"; +import "core-js/modules/esnext.async-iterator.flat-map.js"; +import "core-js/modules/esnext.async-iterator.for-each.js"; +import "core-js/modules/esnext.async-iterator.from.js"; +import "core-js/modules/esnext.async-iterator.indexed.js"; +import "core-js/modules/esnext.async-iterator.map.js"; +import "core-js/modules/esnext.async-iterator.reduce.js"; +import "core-js/modules/esnext.async-iterator.some.js"; +import "core-js/modules/esnext.async-iterator.take.js"; +import "core-js/modules/esnext.async-iterator.to-array.js"; +import "core-js/modules/esnext.bigint.range.js"; +import "core-js/modules/esnext.data-view.get-uint8-clamped.js"; +import "core-js/modules/esnext.data-view.set-uint8-clamped.js"; +import "core-js/modules/esnext.function.demethodize.js"; +import "core-js/modules/esnext.function.is-constructor.js"; +import "core-js/modules/esnext.function.metadata.js"; +import "core-js/modules/esnext.function.un-this.js"; +import "core-js/modules/esnext.iterator.chunks.js"; +import "core-js/modules/esnext.iterator.includes.js"; +import "core-js/modules/esnext.iterator.indexed.js"; +import "core-js/modules/esnext.iterator.join.js"; +import "core-js/modules/esnext.iterator.range.js"; +import "core-js/modules/esnext.iterator.sliding.js"; +import "core-js/modules/esnext.iterator.windows.js"; +import "core-js/modules/esnext.map.delete-all.js"; +import "core-js/modules/esnext.map.emplace.js"; +import "core-js/modules/esnext.map.every.js"; +import "core-js/modules/esnext.map.filter.js"; +import "core-js/modules/esnext.map.find.js"; +import "core-js/modules/esnext.map.find-key.js"; +import "core-js/modules/esnext.map.includes.js"; +import "core-js/modules/esnext.map.key-of.js"; +import "core-js/modules/esnext.map.map-keys.js"; +import "core-js/modules/esnext.map.map-values.js"; +import "core-js/modules/esnext.map.merge.js"; +import "core-js/modules/esnext.map.reduce.js"; +import "core-js/modules/esnext.map.some.js"; +import "core-js/modules/esnext.map.update.js"; +import "core-js/modules/esnext.number.clamp.js"; +import "core-js/modules/esnext.number.range.js"; +import "core-js/modules/esnext.promise.all-keyed.js"; +import "core-js/modules/esnext.promise.all-settled-keyed.js"; +import "core-js/modules/esnext.set.add-all.js"; +import "core-js/modules/esnext.set.delete-all.js"; +import "core-js/modules/esnext.set.difference.js"; +import "core-js/modules/esnext.set.every.js"; +import "core-js/modules/esnext.set.filter.js"; +import "core-js/modules/esnext.set.find.js"; +import "core-js/modules/esnext.set.intersection.js"; +import "core-js/modules/esnext.set.is-disjoint-from.js"; +import "core-js/modules/esnext.set.is-subset-of.js"; +import "core-js/modules/esnext.set.is-superset-of.js"; +import "core-js/modules/esnext.set.join.js"; +import "core-js/modules/esnext.set.map.js"; +import "core-js/modules/esnext.set.reduce.js"; +import "core-js/modules/esnext.set.some.js"; +import "core-js/modules/esnext.set.symmetric-difference.js"; +import "core-js/modules/esnext.set.union.js"; +import "core-js/modules/esnext.string.dedent.js"; +import "core-js/modules/esnext.symbol.custom-matcher.js"; +import "core-js/modules/esnext.symbol.is-registered-symbol.js"; +import "core-js/modules/esnext.symbol.is-registered.js"; +import "core-js/modules/esnext.symbol.is-well-known-symbol.js"; +import "core-js/modules/esnext.symbol.is-well-known.js"; +import "core-js/modules/esnext.symbol.matcher.js"; +import "core-js/modules/esnext.symbol.metadata.js"; +import "core-js/modules/esnext.typed-array.filter-reject.js"; +import "core-js/modules/esnext.typed-array.group-by.js"; +import "core-js/modules/esnext.typed-array.to-spliced.js"; +import "core-js/modules/esnext.typed-array.unique-by.js"; +import "core-js/modules/web.dom-exception.stack.js"; +import "core-js/modules/web.structured-clone.js"; +import "core-js/modules/web.url.can-parse.js"; +import "core-js/modules/web.url.parse.js"; +import "core-js/modules/web.url-search-params.delete.js"; +import "core-js/modules/web.url-search-params.has.js"; +import "core-js/modules/web.url-search-params.size.js"; +[].findLast(fn); +[].findLastIndex(fn); +[].asIndexedPairs(); +Iterator.from({ + next: () => ({ + done: Math.random() > .9, + value: Math.random() * 10 | 0 + }) +}).forEach(console.log).toArray(); +AsyncIterator.from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2).groupBy(it => id % 4).map(it => it ** 2).toArray().then(console.log); +[1, 2, 3, 4, 5, 6, 7, 7].uniqueBy(x => x).groupBy(x => x % 2); +Number.range(1, 2); +BigInt.range(1n, 2n); +Array.isTemplateObject((x => x)`a${x}z`); +new Map([['x', 1]]).emplace('x', { + update: x => x + 1, + insert: () => 0 +}); +/x/.dotAll; +/x/.sticky; +Symbol.asyncDispose; +Symbol.matcher; +Symbol.matchAll; +Symbol.metadata; +Symbol.replaceAll; +new URL(url); +const foo = [1, 2, 3].groupByToMap(bar); +const push = [].push.unThis(); +Function.isConstructor; +throw new DOMException(); +structuredClone(72); +btoa('hi'); +foo.indexed; +bar.with; +buz.push; +fuz.__proto__; +string.isWellFormed; +string.toWellFormed; +String.dedent`42`; +self; +SuppressedError; +DisposableStack; +AsyncDisposableStack; +Iterator.range(foo, bar); +JSON.parse(foo); +JSON.isRawJSON(foo); +JSON.rawJSON(foo); +Symbol.isWellKnown(foo); +Symbol.isRegistered(foo); +Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); +URL.canParse(foo); +Symbol.isWellKnownSymbol(foo); +Symbol.isRegisteredSymbol(foo); +Symbol.metadata; +Object.groupBy(a, b); +Map.groupBy(a, b); +Promise.withResolvers(); +new URLSearchParams().has(a, b); +Math.f16round(foo); +foo.getFloat16(0); +foo.setFloat16(0, 1); +foo.getUint8Clamped(0); +foo.setUint8Clamped(0, 1); +RegExp.escape(foo); +Uint8Array.fromBase64(string); +Uint8Array.fromHex(string); +new Uint8Array(foo).setFromBase64(string); +new Uint8Array(foo).setFromHex(string); +new Uint8Array(foo).toBase64(); +new Uint8Array(foo).toHex(); +URL.parse(x); +Math.sumPrecise(x); +Symbol.customMatcher; +Iterator.concat(a, b); +new Map().getOrInsert(a, b); +SyntaxError.isError(a); +Array.fromAsync(a); +Iterator.zip(a, b); +Iterator.zipKeyed(a, b); +a.chunks(b); +a.sliding(b); +a.windows(b); +a.clamp(b, c); +Promise.allKeyed(a); +Promise.allSettledKeyed(a); +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-iife/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-iife/output.mjs index 7ea50381..dfad8df4 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-iife/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-iife/output.mjs @@ -1,5 +1,6 @@ import "core-js/modules/es.array.from.js"; import "core-js/modules/es.object.entries.js"; +import "core-js/modules/es.object.to-string.js"; import "core-js/modules/es.string.includes.js"; import "core-js/modules/es.string.iterator.js"; !function (foo, { diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/in/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/in/output.mjs index 9c918242..95345a00 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/in/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/in/output.mjs @@ -2,6 +2,7 @@ import "core-js/modules/es.array.includes.js"; import "core-js/modules/es.array.iterator.js"; import "core-js/modules/es.object.entries.js"; import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.to-string.js"; import "core-js/modules/es.object.values.js"; 'entries' in Object; 'includes' in [1, 2, 3]; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.43/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.43/output.mjs index 951bfdb9..74b8c896 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.43/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.43/output.mjs @@ -96,7 +96,9 @@ import "core-js/modules/es.typed-array.to-sorted.js"; import "core-js/modules/es.typed-array.to-string.js"; import "core-js/modules/es.typed-array.with.js"; import "core-js/modules/es.weak-map.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.concat.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.44/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.44/output.mjs index f1c7a15d..bdb07dbb 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.44/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.44/output.mjs @@ -96,7 +96,9 @@ import "core-js/modules/es.typed-array.to-sorted.js"; import "core-js/modules/es.typed-array.to-string.js"; import "core-js/modules/es.typed-array.with.js"; import "core-js/modules/es.weak-map.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.concat.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.45/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.45/output.mjs index 3f05fb2e..ae88650e 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.45/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.45/output.mjs @@ -103,7 +103,9 @@ import "core-js/modules/es.uint8-array.set-from-hex.js"; import "core-js/modules/es.uint8-array.to-base64.js"; import "core-js/modules/es.uint8-array.to-hex.js"; import "core-js/modules/es.weak-map.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.concat.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.46/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.46/output.mjs index 3f05fb2e..ae88650e 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.46/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.46/output.mjs @@ -103,7 +103,9 @@ import "core-js/modules/es.uint8-array.set-from-hex.js"; import "core-js/modules/es.uint8-array.to-base64.js"; import "core-js/modules/es.uint8-array.to-hex.js"; import "core-js/modules/es.weak-map.js"; +import "core-js/modules/esnext.iterator.chunks.js"; import "core-js/modules/esnext.iterator.concat.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.json.is-raw-json.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.47/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.47/output.mjs index 762532c6..66263750 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.47/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.47/output.mjs @@ -107,6 +107,8 @@ import "core-js/modules/es.uint8-array.set-from-hex.js"; import "core-js/modules/es.uint8-array.to-base64.js"; import "core-js/modules/es.uint8-array.to-hex.js"; import "core-js/modules/es.weak-map.js"; +import "core-js/modules/esnext.iterator.chunks.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.map.get-or-insert.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.48/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.48/input.mjs index d808a5d4..5dc555e5 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.48/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.48/input.mjs @@ -119,3 +119,8 @@ a.windows(b); a.clamp(b, c); +Promise.allKeyed(a); +Promise.allSettledKeyed(a); + +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.48/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.48/output.mjs index e8ccad6e..41752b18 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.48/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.48/output.mjs @@ -9,7 +9,9 @@ import "core-js/modules/es.array.filter.js"; import "core-js/modules/es.array.find-last.js"; import "core-js/modules/es.array.find-last-index.js"; import "core-js/modules/es.array.for-each.js"; +import "core-js/modules/es.array.includes.js"; import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.join.js"; import "core-js/modules/es.array.map.js"; import "core-js/modules/es.array.push.js"; import "core-js/modules/es.array.with.js"; @@ -66,6 +68,7 @@ import "core-js/modules/es.set.is-superset-of.v2.js"; import "core-js/modules/es.set.symmetric-difference.v2.js"; import "core-js/modules/es.set.union.v2.js"; import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.includes.js"; import "core-js/modules/es.string.is-well-formed.js"; import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.string.match-all.js"; @@ -109,6 +112,8 @@ import "core-js/modules/es.uint8-array.set-from-hex.js"; import "core-js/modules/es.uint8-array.to-base64.js"; import "core-js/modules/es.uint8-array.to-hex.js"; import "core-js/modules/es.weak-map.js"; +import "core-js/modules/esnext.iterator.chunks.js"; +import "core-js/modules/esnext.iterator.windows.js"; import "core-js/modules/esnext.iterator.zip.js"; import "core-js/modules/esnext.iterator.zip-keyed.js"; import "core-js/modules/esnext.symbol.metadata.js"; @@ -213,3 +218,7 @@ a.chunks(b); a.sliding(b); a.windows(b); a.clamp(b, c); +Promise.allKeyed(a); +Promise.allSettledKeyed(a); +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.50/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.50/input.mjs new file mode 100644 index 00000000..5dc555e5 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.50/input.mjs @@ -0,0 +1,126 @@ +[].findLast(fn); +[].findLastIndex(fn); + +[].asIndexedPairs(); + +Iterator.from({ + next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 }) + }).forEach(console.log).toArray(); + +AsyncIterator.from([1, 2, 3, 4, 5, 6, 7]) + .drop(1) + .take(5) + .filter(it => it % 2) + .groupBy(it => id % 4) + .map(it => it ** 2) + .toArray() + .then(console.log); + +[1, 2, 3, 4, 5, 6, 7, 7].uniqueBy(x => x).groupBy(x => x % 2); + +Number.range(1, 2); +BigInt.range(1n, 2n); + +Array.isTemplateObject((x => x)`a${ x }z`) + +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0}); + +/x/.dotAll; +/x/.sticky + +Symbol.asyncDispose +Symbol.matcher +Symbol.matchAll +Symbol.metadata +Symbol.replaceAll + +new URL(url); + +const foo = [1, 2, 3].groupByToMap(bar); + +const push = [].push.unThis(); + +Function.isConstructor; + +throw new DOMException(); + +structuredClone(72); + +btoa('hi'); + +foo.indexed; +bar.with; +buz.push; +fuz.__proto__; + +string.isWellFormed; +string.toWellFormed; + +String.dedent`42`; + +self; +SuppressedError +DisposableStack; +AsyncDisposableStack; + +Iterator.range(foo, bar); +JSON.parse(foo); +JSON.isRawJSON(foo); +JSON.rawJSON(foo); +Symbol.isWellKnown(foo); +Symbol.isRegistered(foo); +Function.demethodize(); + +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + +URL.canParse(foo); + +Symbol.isWellKnownSymbol(foo); +Symbol.isRegisteredSymbol(foo); +Symbol.metadata; +Object.groupBy(a, b); +Map.groupBy(a, b); +Promise.withResolvers(); +new URLSearchParams().has(a, b); + +Math.f16round(foo); +foo.getFloat16(0); +foo.setFloat16(0, 1); +foo.getUint8Clamped(0); +foo.setUint8Clamped(0, 1); + +RegExp.escape(foo); + +Uint8Array.fromBase64(string); +Uint8Array.fromHex(string); +new Uint8Array(foo).setFromBase64(string); +new Uint8Array(foo).setFromHex(string); +new Uint8Array(foo).toBase64(); +new Uint8Array(foo).toHex(); + +URL.parse(x); +Math.sumPrecise(x); +Symbol.customMatcher; + +Iterator.concat(a, b); +new Map().getOrInsert(a, b); + +SyntaxError.isError(a); + +Array.fromAsync(a); + +Iterator.zip(a, b); +Iterator.zipKeyed(a, b); + +a.chunks(b); +a.sliding(b); +a.windows(b); + +a.clamp(b, c); + +Promise.allKeyed(a); +Promise.allSettledKeyed(a); + +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.50/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.50/options.json new file mode 100644 index 00000000..b71e0d2d --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.50/options.json @@ -0,0 +1,16 @@ +{ + "externalHelpers": false, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "method": "usage-global", + "version": "3.50", + "shippedProposals": true + } + ] + ], + "targets": { + "ie": "5" + } +} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.50/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.50/output.mjs new file mode 100644 index 00000000..087fc394 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.50/output.mjs @@ -0,0 +1,226 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.async-dispose.js"; +import "core-js/modules/es.symbol.match-all.js"; +import "core-js/modules/es.error.cause.js"; +import "core-js/modules/es.error.is-error.js"; +import "core-js/modules/es.error.to-string.js"; +import "core-js/modules/es.suppressed-error.constructor.js"; +import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.find-last.js"; +import "core-js/modules/es.array.find-last-index.js"; +import "core-js/modules/es.array.for-each.js"; +import "core-js/modules/es.array.includes.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.join.js"; +import "core-js/modules/es.array.map.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.array.with.js"; +import "core-js/modules/es.array-buffer.constructor.js"; +import "core-js/modules/es.array-buffer.slice.js"; +import "core-js/modules/es.data-view.js"; +import "core-js/modules/es.data-view.get-float16.js"; +import "core-js/modules/es.data-view.set-float16.js"; +import "core-js/modules/es.array-buffer.detached.js"; +import "core-js/modules/es.array-buffer.transfer.js"; +import "core-js/modules/es.array-buffer.transfer-to-fixed-length.js"; +import "core-js/modules/es.disposable-stack.constructor.js"; +import "core-js/modules/es.iterator.constructor.js"; +import "core-js/modules/es.iterator.concat.js"; +import "core-js/modules/es.iterator.dispose.js"; +import "core-js/modules/es.iterator.drop.js"; +import "core-js/modules/es.iterator.filter.js"; +import "core-js/modules/es.iterator.for-each.js"; +import "core-js/modules/es.iterator.from.js"; +import "core-js/modules/es.iterator.map.js"; +import "core-js/modules/es.iterator.take.js"; +import "core-js/modules/es.iterator.to-array.js"; +import "core-js/modules/es.iterator.zip.js"; +import "core-js/modules/es.iterator.zip-keyed.js"; +import "core-js/modules/es.json.is-raw-json.js"; +import "core-js/modules/es.json.parse.js"; +import "core-js/modules/es.json.raw-json.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.map.group-by.js"; +import "core-js/modules/es.map.get-or-insert.js"; +import "core-js/modules/es.map.get-or-insert-computed.js"; +import "core-js/modules/es.math.f16round.js"; +import "core-js/modules/es.math.sum-precise.js"; +import "core-js/modules/es.object.create.js"; +import "core-js/modules/es.object.freeze.js"; +import "core-js/modules/es.object.group-by.js"; +import "core-js/modules/es.object.keys.js"; +import "core-js/modules/es.object.proto.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.with-resolvers.js"; +import "core-js/modules/es.array.from-async.js"; +import "core-js/modules/es.async-disposable-stack.constructor.js"; +import "core-js/modules/es.async-iterator.async-dispose.js"; +import "core-js/modules/es.reflect.own-keys.js"; +import "core-js/modules/es.regexp.escape.js"; +import "core-js/modules/es.regexp.dot-all.js"; +import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/es.regexp.sticky.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.set.difference.v2.js"; +import "core-js/modules/es.set.intersection.v2.js"; +import "core-js/modules/es.set.is-disjoint-from.v2.js"; +import "core-js/modules/es.set.is-subset-of.v2.js"; +import "core-js/modules/es.set.is-superset-of.v2.js"; +import "core-js/modules/es.set.symmetric-difference.v2.js"; +import "core-js/modules/es.set.union.v2.js"; +import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.is-well-formed.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.match-all.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.replace-all.js"; +import "core-js/modules/es.string.to-well-formed.js"; +import "core-js/modules/es.typed-array.uint8-array.js"; +import "core-js/modules/es.typed-array.at.js"; +import "core-js/modules/es.typed-array.copy-within.js"; +import "core-js/modules/es.typed-array.every.js"; +import "core-js/modules/es.typed-array.fill.js"; +import "core-js/modules/es.typed-array.filter.js"; +import "core-js/modules/es.typed-array.find.js"; +import "core-js/modules/es.typed-array.find-index.js"; +import "core-js/modules/es.typed-array.find-last.js"; +import "core-js/modules/es.typed-array.find-last-index.js"; +import "core-js/modules/es.typed-array.for-each.js"; +import "core-js/modules/es.typed-array.includes.js"; +import "core-js/modules/es.typed-array.index-of.js"; +import "core-js/modules/es.typed-array.iterator.js"; +import "core-js/modules/es.typed-array.join.js"; +import "core-js/modules/es.typed-array.last-index-of.js"; +import "core-js/modules/es.typed-array.map.js"; +import "core-js/modules/es.typed-array.reduce.js"; +import "core-js/modules/es.typed-array.reduce-right.js"; +import "core-js/modules/es.typed-array.reverse.js"; +import "core-js/modules/es.typed-array.set.js"; +import "core-js/modules/es.typed-array.slice.js"; +import "core-js/modules/es.typed-array.some.js"; +import "core-js/modules/es.typed-array.sort.js"; +import "core-js/modules/es.typed-array.subarray.js"; +import "core-js/modules/es.typed-array.to-locale-string.js"; +import "core-js/modules/es.typed-array.to-reversed.js"; +import "core-js/modules/es.typed-array.to-sorted.js"; +import "core-js/modules/es.typed-array.to-string.js"; +import "core-js/modules/es.typed-array.with.js"; +import "core-js/modules/es.uint8-array.from-base64.js"; +import "core-js/modules/es.uint8-array.from-hex.js"; +import "core-js/modules/es.uint8-array.set-from-base64.js"; +import "core-js/modules/es.uint8-array.set-from-hex.js"; +import "core-js/modules/es.uint8-array.to-base64.js"; +import "core-js/modules/es.uint8-array.to-hex.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/esnext.iterator.chunks.js"; +import "core-js/modules/esnext.iterator.includes.js"; +import "core-js/modules/esnext.iterator.join.js"; +import "core-js/modules/esnext.iterator.windows.js"; +import "core-js/modules/esnext.symbol.metadata.js"; +import "core-js/modules/web.btoa.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.dom-exception.constructor.js"; +import "core-js/modules/web.dom-exception.stack.js"; +import "core-js/modules/web.dom-exception.to-string-tag.js"; +import "core-js/modules/web.self.js"; +import "core-js/modules/web.structured-clone.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.can-parse.js"; +import "core-js/modules/web.url.parse.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/web.url-search-params.delete.js"; +import "core-js/modules/web.url-search-params.has.js"; +import "core-js/modules/web.url-search-params.size.js"; +[].findLast(fn); +[].findLastIndex(fn); +[].asIndexedPairs(); +Iterator.from({ + next: () => ({ + done: Math.random() > .9, + value: Math.random() * 10 | 0 + }) +}).forEach(console.log).toArray(); +AsyncIterator.from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2).groupBy(it => id % 4).map(it => it ** 2).toArray().then(console.log); +[1, 2, 3, 4, 5, 6, 7, 7].uniqueBy(x => x).groupBy(x => x % 2); +Number.range(1, 2); +BigInt.range(1n, 2n); +Array.isTemplateObject((x => x)`a${x}z`); +new Map([['x', 1]]).emplace('x', { + update: x => x + 1, + insert: () => 0 +}); +/x/.dotAll; +/x/.sticky; +Symbol.asyncDispose; +Symbol.matcher; +Symbol.matchAll; +Symbol.metadata; +Symbol.replaceAll; +new URL(url); +const foo = [1, 2, 3].groupByToMap(bar); +const push = [].push.unThis(); +Function.isConstructor; +throw new DOMException(); +structuredClone(72); +btoa('hi'); +foo.indexed; +bar.with; +buz.push; +fuz.__proto__; +string.isWellFormed; +string.toWellFormed; +String.dedent`42`; +self; +SuppressedError; +DisposableStack; +AsyncDisposableStack; +Iterator.range(foo, bar); +JSON.parse(foo); +JSON.isRawJSON(foo); +JSON.rawJSON(foo); +Symbol.isWellKnown(foo); +Symbol.isRegistered(foo); +Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); +URL.canParse(foo); +Symbol.isWellKnownSymbol(foo); +Symbol.isRegisteredSymbol(foo); +Symbol.metadata; +Object.groupBy(a, b); +Map.groupBy(a, b); +Promise.withResolvers(); +new URLSearchParams().has(a, b); +Math.f16round(foo); +foo.getFloat16(0); +foo.setFloat16(0, 1); +foo.getUint8Clamped(0); +foo.setUint8Clamped(0, 1); +RegExp.escape(foo); +Uint8Array.fromBase64(string); +Uint8Array.fromHex(string); +new Uint8Array(foo).setFromBase64(string); +new Uint8Array(foo).setFromHex(string); +new Uint8Array(foo).toBase64(); +new Uint8Array(foo).toHex(); +URL.parse(x); +Math.sumPrecise(x); +Symbol.customMatcher; +Iterator.concat(a, b); +new Map().getOrInsert(a, b); +SyntaxError.isError(a); +Array.fromAsync(a); +Iterator.zip(a, b); +Iterator.zipKeyed(a, b); +a.chunks(b); +a.sliding(b); +a.windows(b); +a.clamp(b, c); +Promise.allKeyed(a); +Promise.allSettledKeyed(a); +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.43/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.43/output.mjs index 87cfda43..abb0e146 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.43/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.43/output.mjs @@ -39,6 +39,8 @@ import _Math$sumPrecise from "core-js-pure/features/math/sum-precise.js"; import _Iterator$concat from "core-js-pure/features/iterator/concat.js"; import _SyntaxError$isError from "core-js-pure/stable/error/is-error.js"; import _Array$fromAsync from "core-js-pure/stable/array/from-async.js"; +import _Iterator$zip from "core-js-pure/features/iterator/zip.js"; +import _Iterator$zipKeyed from "core-js-pure/features/iterator/zip-keyed.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -118,8 +120,8 @@ _Iterator$concat(a, b); new _Map().getOrInsert(a, b); _SyntaxError$isError(a); _Array$fromAsync(a); -_Iterator.zip(a, b); -_Iterator.zipKeyed(a, b); +_Iterator$zip(a, b); +_Iterator$zipKeyed(a, b); a.chunks(b); a.windows(b); a.clamp(b, c); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.44/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.44/output.mjs index 20fc5634..579fe4fe 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.44/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.44/output.mjs @@ -39,6 +39,8 @@ import _Math$sumPrecise from "core-js-pure/features/math/sum-precise.js"; import _Iterator$concat from "core-js-pure/features/iterator/concat.js"; import _SyntaxError$isError from "core-js-pure/stable/error/is-error.js"; import _Array$fromAsync from "core-js-pure/stable/array/from-async.js"; +import _Iterator$zip from "core-js-pure/features/iterator/zip.js"; +import _Iterator$zipKeyed from "core-js-pure/features/iterator/zip-keyed.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -118,8 +120,8 @@ _Iterator$concat(a, b); new _Map().getOrInsert(a, b); _SyntaxError$isError(a); _Array$fromAsync(a); -_Iterator.zip(a, b); -_Iterator.zipKeyed(a, b); +_Iterator$zip(a, b); +_Iterator$zipKeyed(a, b); a.chunks(b); a.sliding(b); a.windows(b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.45/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.45/output.mjs index 909e9c97..e6877183 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.45/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.45/output.mjs @@ -39,6 +39,8 @@ import _Math$sumPrecise from "core-js-pure/stable/math/sum-precise.js"; import _Iterator$concat from "core-js-pure/features/iterator/concat.js"; import _SyntaxError$isError from "core-js-pure/stable/error/is-error.js"; import _Array$fromAsync from "core-js-pure/stable/array/from-async.js"; +import _Iterator$zip from "core-js-pure/features/iterator/zip.js"; +import _Iterator$zipKeyed from "core-js-pure/features/iterator/zip-keyed.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -118,8 +120,8 @@ _Iterator$concat(a, b); new _Map().getOrInsert(a, b); _SyntaxError$isError(a); _Array$fromAsync(a); -_Iterator.zip(a, b); -_Iterator.zipKeyed(a, b); +_Iterator$zip(a, b); +_Iterator$zipKeyed(a, b); a.chunks(b); a.sliding(b); a.windows(b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.46/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.46/output.mjs index 909e9c97..e6877183 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.46/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.46/output.mjs @@ -39,6 +39,8 @@ import _Math$sumPrecise from "core-js-pure/stable/math/sum-precise.js"; import _Iterator$concat from "core-js-pure/features/iterator/concat.js"; import _SyntaxError$isError from "core-js-pure/stable/error/is-error.js"; import _Array$fromAsync from "core-js-pure/stable/array/from-async.js"; +import _Iterator$zip from "core-js-pure/features/iterator/zip.js"; +import _Iterator$zipKeyed from "core-js-pure/features/iterator/zip-keyed.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -118,8 +120,8 @@ _Iterator$concat(a, b); new _Map().getOrInsert(a, b); _SyntaxError$isError(a); _Array$fromAsync(a); -_Iterator.zip(a, b); -_Iterator.zipKeyed(a, b); +_Iterator$zip(a, b); +_Iterator$zipKeyed(a, b); a.chunks(b); a.sliding(b); a.windows(b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.47/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.47/output.mjs index 674b37ea..0d07154f 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.47/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.47/output.mjs @@ -39,6 +39,8 @@ import _Math$sumPrecise from "core-js-pure/stable/math/sum-precise.js"; import _Iterator$concat from "core-js-pure/stable/iterator/concat.js"; import _SyntaxError$isError from "core-js-pure/stable/error/is-error.js"; import _Array$fromAsync from "core-js-pure/stable/array/from-async.js"; +import _Iterator$zip from "core-js-pure/features/iterator/zip.js"; +import _Iterator$zipKeyed from "core-js-pure/features/iterator/zip-keyed.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -118,8 +120,8 @@ _Iterator$concat(a, b); new _Map().getOrInsert(a, b); _SyntaxError$isError(a); _Array$fromAsync(a); -_Iterator.zip(a, b); -_Iterator.zipKeyed(a, b); +_Iterator$zip(a, b); +_Iterator$zipKeyed(a, b); a.chunks(b); a.sliding(b); a.windows(b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.48/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.48/input.mjs index 122b5acc..5dc555e5 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.48/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.48/input.mjs @@ -118,3 +118,9 @@ a.sliding(b); a.windows(b); a.clamp(b, c); + +Promise.allKeyed(a); +Promise.allSettledKeyed(a); + +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.48/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.48/output.mjs index 674b37ea..77975ea8 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.48/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.48/output.mjs @@ -39,6 +39,10 @@ import _Math$sumPrecise from "core-js-pure/stable/math/sum-precise.js"; import _Iterator$concat from "core-js-pure/stable/iterator/concat.js"; import _SyntaxError$isError from "core-js-pure/stable/error/is-error.js"; import _Array$fromAsync from "core-js-pure/stable/array/from-async.js"; +import _Iterator$zip from "core-js-pure/features/iterator/zip.js"; +import _Iterator$zipKeyed from "core-js-pure/features/iterator/zip-keyed.js"; +import _Promise from "core-js-pure/stable/promise/index.js"; +import _includesInstanceProperty from "core-js-pure/stable/instance/includes.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -118,9 +122,13 @@ _Iterator$concat(a, b); new _Map().getOrInsert(a, b); _SyntaxError$isError(a); _Array$fromAsync(a); -_Iterator.zip(a, b); -_Iterator.zipKeyed(a, b); +_Iterator$zip(a, b); +_Iterator$zipKeyed(a, b); a.chunks(b); a.sliding(b); a.windows(b); a.clamp(b, c); +_Promise.allKeyed(a); +_Promise.allSettledKeyed(a); +_includesInstanceProperty(a).call(a); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.50/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.50/input.mjs new file mode 100644 index 00000000..5dc555e5 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.50/input.mjs @@ -0,0 +1,126 @@ +[].findLast(fn); +[].findLastIndex(fn); + +[].asIndexedPairs(); + +Iterator.from({ + next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 }) + }).forEach(console.log).toArray(); + +AsyncIterator.from([1, 2, 3, 4, 5, 6, 7]) + .drop(1) + .take(5) + .filter(it => it % 2) + .groupBy(it => id % 4) + .map(it => it ** 2) + .toArray() + .then(console.log); + +[1, 2, 3, 4, 5, 6, 7, 7].uniqueBy(x => x).groupBy(x => x % 2); + +Number.range(1, 2); +BigInt.range(1n, 2n); + +Array.isTemplateObject((x => x)`a${ x }z`) + +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0}); + +/x/.dotAll; +/x/.sticky + +Symbol.asyncDispose +Symbol.matcher +Symbol.matchAll +Symbol.metadata +Symbol.replaceAll + +new URL(url); + +const foo = [1, 2, 3].groupByToMap(bar); + +const push = [].push.unThis(); + +Function.isConstructor; + +throw new DOMException(); + +structuredClone(72); + +btoa('hi'); + +foo.indexed; +bar.with; +buz.push; +fuz.__proto__; + +string.isWellFormed; +string.toWellFormed; + +String.dedent`42`; + +self; +SuppressedError +DisposableStack; +AsyncDisposableStack; + +Iterator.range(foo, bar); +JSON.parse(foo); +JSON.isRawJSON(foo); +JSON.rawJSON(foo); +Symbol.isWellKnown(foo); +Symbol.isRegistered(foo); +Function.demethodize(); + +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + +URL.canParse(foo); + +Symbol.isWellKnownSymbol(foo); +Symbol.isRegisteredSymbol(foo); +Symbol.metadata; +Object.groupBy(a, b); +Map.groupBy(a, b); +Promise.withResolvers(); +new URLSearchParams().has(a, b); + +Math.f16round(foo); +foo.getFloat16(0); +foo.setFloat16(0, 1); +foo.getUint8Clamped(0); +foo.setUint8Clamped(0, 1); + +RegExp.escape(foo); + +Uint8Array.fromBase64(string); +Uint8Array.fromHex(string); +new Uint8Array(foo).setFromBase64(string); +new Uint8Array(foo).setFromHex(string); +new Uint8Array(foo).toBase64(); +new Uint8Array(foo).toHex(); + +URL.parse(x); +Math.sumPrecise(x); +Symbol.customMatcher; + +Iterator.concat(a, b); +new Map().getOrInsert(a, b); + +SyntaxError.isError(a); + +Array.fromAsync(a); + +Iterator.zip(a, b); +Iterator.zipKeyed(a, b); + +a.chunks(b); +a.sliding(b); +a.windows(b); + +a.clamp(b, c); + +Promise.allKeyed(a); +Promise.allSettledKeyed(a); + +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.50/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.50/options.json new file mode 100644 index 00000000..586022e1 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.50/options.json @@ -0,0 +1,15 @@ +{ + "externalHelpers": false, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "method": "usage-pure", + "version": "3.50" + } + ] + ], + "targets": { + "ie": "5" + } +} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.50/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.50/output.mjs new file mode 100644 index 00000000..d2c75a4c --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.50/output.mjs @@ -0,0 +1,134 @@ +var _context, _context2, _context3, _context4, _context5; +import _findLastInstanceProperty from "core-js-pure/stable/instance/find-last.js"; +import _findLastIndexInstanceProperty from "core-js-pure/stable/instance/find-last-index.js"; +import _forEachInstanceProperty from "core-js-pure/stable/instance/for-each.js"; +import _Iterator$from from "core-js-pure/stable/iterator/from.js"; +import _mapInstanceProperty from "core-js-pure/stable/instance/map.js"; +import _filterInstanceProperty from "core-js-pure/stable/instance/filter.js"; +import _Map from "core-js-pure/stable/map/index.js"; +import _Symbol$asyncDispose from "core-js-pure/stable/symbol/async-dispose.js"; +import _Symbol from "core-js-pure/stable/symbol/index.js"; +import _Symbol$matchAll from "core-js-pure/stable/symbol/match-all.js"; +import _replaceAllInstanceProperty from "core-js-pure/stable/instance/replace-all.js"; +import _URL from "core-js-pure/stable/url/index.js"; +import _pushInstanceProperty from "core-js-pure/stable/instance/push.js"; +import _DOMException from "core-js-pure/stable/dom-exception/index.js"; +import _structuredClone from "core-js-pure/stable/structured-clone.js"; +import _btoa from "core-js-pure/stable/btoa.js"; +import _withInstanceProperty from "core-js-pure/stable/instance/with.js"; +import _isWellFormedInstanceProperty from "core-js-pure/stable/instance/is-well-formed.js"; +import _toWellFormedInstanceProperty from "core-js-pure/stable/instance/to-well-formed.js"; +import _self from "core-js-pure/stable/self.js"; +import _SuppressedError from "core-js-pure/stable/suppressed-error.js"; +import _DisposableStack from "core-js-pure/stable/disposable-stack/index.js"; +import _AsyncDisposableStack from "core-js-pure/stable/async-disposable-stack/index.js"; +import _Iterator from "core-js-pure/stable/iterator/index.js"; +import _JSON$parse from "core-js-pure/stable/json/parse.js"; +import _JSON$isRawJSON from "core-js-pure/stable/json/is-raw-json.js"; +import _JSON$rawJSON from "core-js-pure/stable/json/raw-json.js"; +import _URLSearchParams from "core-js-pure/stable/url-search-params/index.js"; +import _Set from "core-js-pure/stable/set/index.js"; +import _URL$canParse from "core-js-pure/stable/url/can-parse.js"; +import _Object$groupBy from "core-js-pure/stable/object/group-by.js"; +import _Map$groupBy from "core-js-pure/stable/map/group-by.js"; +import _Promise$withResolvers from "core-js-pure/stable/promise/with-resolvers.js"; +import _Math$f16round from "core-js-pure/stable/math/f16round.js"; +import _RegExp$escape from "core-js-pure/stable/regexp/escape.js"; +import _URL$parse from "core-js-pure/stable/url/parse.js"; +import _Math$sumPrecise from "core-js-pure/stable/math/sum-precise.js"; +import _Iterator$concat from "core-js-pure/stable/iterator/concat.js"; +import _SyntaxError$isError from "core-js-pure/stable/error/is-error.js"; +import _Array$fromAsync from "core-js-pure/stable/array/from-async.js"; +import _Iterator$zip from "core-js-pure/stable/iterator/zip.js"; +import _Iterator$zipKeyed from "core-js-pure/stable/iterator/zip-keyed.js"; +import _Promise from "core-js-pure/stable/promise/index.js"; +import _includesInstanceProperty from "core-js-pure/stable/instance/includes.js"; +_findLastInstanceProperty(_context = []).call(_context, fn); +_findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); +[].asIndexedPairs(); +_forEachInstanceProperty(_context3 = _Iterator$from({ + next: () => ({ + done: Math.random() > .9, + value: Math.random() * 10 | 0 + }) +})).call(_context3, console.log).toArray(); +_mapInstanceProperty(_context4 = _filterInstanceProperty(_context5 = AsyncIterator.from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5)).call(_context5, it => it % 2).groupBy(it => id % 4)).call(_context4, it => it ** 2).toArray().then(console.log); +[1, 2, 3, 4, 5, 6, 7, 7].uniqueBy(x => x).groupBy(x => x % 2); +Number.range(1, 2); +BigInt.range(1n, 2n); +Array.isTemplateObject((x => x)`a${x}z`); +new _Map([['x', 1]]).emplace('x', { + update: x => x + 1, + insert: () => 0 +}); +/x/.dotAll; +/x/.sticky; +_Symbol$asyncDispose; +_Symbol.matcher; +_Symbol$matchAll; +_Symbol.metadata; +_replaceAllInstanceProperty(_Symbol); +new _URL(url); +const foo = [1, 2, 3].groupByToMap(bar); +const push = _pushInstanceProperty([]).unThis(); +Function.isConstructor; +throw new _DOMException(); +_structuredClone(72); +_btoa('hi'); +foo.indexed; +_withInstanceProperty(bar); +_pushInstanceProperty(buz); +fuz.__proto__; +_isWellFormedInstanceProperty(string); +_toWellFormedInstanceProperty(string); +String.dedent`42`; +_self; +_SuppressedError; +_DisposableStack; +_AsyncDisposableStack; +_Iterator.range(foo, bar); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); +_Symbol.isWellKnown(foo); +_Symbol.isRegistered(foo); +Function.demethodize(); +new _URLSearchParams(string).size; +new _Set(array).intersection(otherSet); +_URL$canParse(foo); +_Symbol.isWellKnownSymbol(foo); +_Symbol.isRegisteredSymbol(foo); +_Symbol.metadata; +_Object$groupBy(a, b); +_Map$groupBy(a, b); +_Promise$withResolvers(); +new _URLSearchParams().has(a, b); +_Math$f16round(foo); +foo.getFloat16(0); +foo.setFloat16(0, 1); +foo.getUint8Clamped(0); +foo.setUint8Clamped(0, 1); +_RegExp$escape(foo); +Uint8Array.fromBase64(string); +Uint8Array.fromHex(string); +new Uint8Array(foo).setFromBase64(string); +new Uint8Array(foo).setFromHex(string); +new Uint8Array(foo).toBase64(); +new Uint8Array(foo).toHex(); +_URL$parse(x); +_Math$sumPrecise(x); +_Symbol.customMatcher; +_Iterator$concat(a, b); +new _Map().getOrInsert(a, b); +_SyntaxError$isError(a); +_Array$fromAsync(a); +_Iterator$zip(a, b); +_Iterator$zipKeyed(a, b); +a.chunks(b); +a.sliding(b); +a.windows(b); +a.clamp(b, c); +_Promise.allKeyed(a); +_Promise.allSettledKeyed(a); +_includesInstanceProperty(a).call(a); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.48/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.48/input.mjs index 122b5acc..5dc555e5 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.48/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.48/input.mjs @@ -118,3 +118,9 @@ a.sliding(b); a.windows(b); a.clamp(b, c); + +Promise.allKeyed(a); +Promise.allSettledKeyed(a); + +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.48/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.48/output.mjs index cf82b2ba..54d226f7 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.48/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.48/output.mjs @@ -132,3 +132,7 @@ a.chunks(b); a.sliding(b); a.windows(b); _clampInstanceProperty(a).call(a, b, c); +Promise.allKeyed(a); +Promise.allSettledKeyed(a); +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.50/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.50/input.mjs new file mode 100644 index 00000000..5dc555e5 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.50/input.mjs @@ -0,0 +1,126 @@ +[].findLast(fn); +[].findLastIndex(fn); + +[].asIndexedPairs(); + +Iterator.from({ + next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 }) + }).forEach(console.log).toArray(); + +AsyncIterator.from([1, 2, 3, 4, 5, 6, 7]) + .drop(1) + .take(5) + .filter(it => it % 2) + .groupBy(it => id % 4) + .map(it => it ** 2) + .toArray() + .then(console.log); + +[1, 2, 3, 4, 5, 6, 7, 7].uniqueBy(x => x).groupBy(x => x % 2); + +Number.range(1, 2); +BigInt.range(1n, 2n); + +Array.isTemplateObject((x => x)`a${ x }z`) + +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0}); + +/x/.dotAll; +/x/.sticky + +Symbol.asyncDispose +Symbol.matcher +Symbol.matchAll +Symbol.metadata +Symbol.replaceAll + +new URL(url); + +const foo = [1, 2, 3].groupByToMap(bar); + +const push = [].push.unThis(); + +Function.isConstructor; + +throw new DOMException(); + +structuredClone(72); + +btoa('hi'); + +foo.indexed; +bar.with; +buz.push; +fuz.__proto__; + +string.isWellFormed; +string.toWellFormed; + +String.dedent`42`; + +self; +SuppressedError +DisposableStack; +AsyncDisposableStack; + +Iterator.range(foo, bar); +JSON.parse(foo); +JSON.isRawJSON(foo); +JSON.rawJSON(foo); +Symbol.isWellKnown(foo); +Symbol.isRegistered(foo); +Function.demethodize(); + +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + +URL.canParse(foo); + +Symbol.isWellKnownSymbol(foo); +Symbol.isRegisteredSymbol(foo); +Symbol.metadata; +Object.groupBy(a, b); +Map.groupBy(a, b); +Promise.withResolvers(); +new URLSearchParams().has(a, b); + +Math.f16round(foo); +foo.getFloat16(0); +foo.setFloat16(0, 1); +foo.getUint8Clamped(0); +foo.setUint8Clamped(0, 1); + +RegExp.escape(foo); + +Uint8Array.fromBase64(string); +Uint8Array.fromHex(string); +new Uint8Array(foo).setFromBase64(string); +new Uint8Array(foo).setFromHex(string); +new Uint8Array(foo).toBase64(); +new Uint8Array(foo).toHex(); + +URL.parse(x); +Math.sumPrecise(x); +Symbol.customMatcher; + +Iterator.concat(a, b); +new Map().getOrInsert(a, b); + +SyntaxError.isError(a); + +Array.fromAsync(a); + +Iterator.zip(a, b); +Iterator.zipKeyed(a, b); + +a.chunks(b); +a.sliding(b); +a.windows(b); + +a.clamp(b, c); + +Promise.allKeyed(a); +Promise.allSettledKeyed(a); + +a.includes(); +a.join(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.50/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.50/options.json new file mode 100644 index 00000000..afe90c52 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.50/options.json @@ -0,0 +1,16 @@ +{ + "externalHelpers": false, + "targets": { + "chrome": 90 + }, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "method": "usage-pure", + "version": "3.50", + "proposals": true + } + ] + ] +} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.50/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.50/output.mjs new file mode 100644 index 00000000..81bdce5d --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.50/output.mjs @@ -0,0 +1,140 @@ +var _context, _context2, _context3, _context4, _context5, _context6, _context7; +import _findLastInstanceProperty from "core-js-pure/features/instance/find-last.js"; +import _findLastIndexInstanceProperty from "core-js-pure/features/instance/find-last-index.js"; +import _Iterator$from from "core-js-pure/features/iterator/from.js"; +import _groupByInstanceProperty from "core-js-pure/features/instance/group-by.js"; +import _AsyncIterator$from from "core-js-pure/features/async-iterator/from.js"; +import _uniqueByInstanceProperty from "core-js-pure/features/instance/unique-by.js"; +import _Number$range from "core-js-pure/features/number/range.js"; +import _BigInt$range from "core-js-pure/features/bigint/range.js"; +import _Array$isTemplateObject from "core-js-pure/features/array/is-template-object.js"; +import _Symbol$asyncDispose from "core-js-pure/features/symbol/async-dispose.js"; +import _Symbol$matcher from "core-js-pure/features/symbol/matcher.js"; +import _Symbol$metadata from "core-js-pure/features/symbol/metadata.js"; +import _groupByToMapInstanceProperty from "core-js-pure/features/instance/group-by-to-map.js"; +import _unThisInstanceProperty from "core-js-pure/features/instance/un-this.js"; +import _pushInstanceProperty from "core-js-pure/features/instance/push.js"; +import _Function$isConstructor from "core-js-pure/features/function/is-constructor.js"; +import _structuredClone from "core-js-pure/features/structured-clone.js"; +import _withInstanceProperty from "core-js-pure/features/instance/with.js"; +import _isWellFormedInstanceProperty from "core-js-pure/features/instance/is-well-formed.js"; +import _toWellFormedInstanceProperty from "core-js-pure/features/instance/to-well-formed.js"; +import _String$dedent from "core-js-pure/features/string/dedent.js"; +import _SuppressedError from "core-js-pure/features/suppressed-error.js"; +import _DisposableStack from "core-js-pure/features/disposable-stack/index.js"; +import _AsyncDisposableStack from "core-js-pure/features/async-disposable-stack/index.js"; +import _Iterator$range from "core-js-pure/features/iterator/range.js"; +import _JSON$parse from "core-js-pure/features/json/parse.js"; +import _JSON$isRawJSON from "core-js-pure/features/json/is-raw-json.js"; +import _JSON$rawJSON from "core-js-pure/features/json/raw-json.js"; +import _Symbol$isWellKnown from "core-js-pure/features/symbol/is-well-known.js"; +import _Symbol$isRegistered from "core-js-pure/features/symbol/is-registered.js"; +import _demethodizeInstanceProperty from "core-js-pure/features/instance/demethodize.js"; +import _URL$canParse from "core-js-pure/features/url/can-parse.js"; +import _Symbol$isWellKnownSymbol from "core-js-pure/features/symbol/is-well-known-symbol.js"; +import _Symbol$isRegisteredSymbol from "core-js-pure/features/symbol/is-registered-symbol.js"; +import _Object$groupBy from "core-js-pure/features/object/group-by.js"; +import _Map$groupBy from "core-js-pure/features/map/group-by.js"; +import _Promise$withResolvers from "core-js-pure/features/promise/with-resolvers.js"; +import _Math$f16round from "core-js-pure/features/math/f16round.js"; +import _RegExp$escape from "core-js-pure/features/regexp/escape.js"; +import _URL$parse from "core-js-pure/features/url/parse.js"; +import _Math$sumPrecise from "core-js-pure/features/math/sum-precise.js"; +import _Symbol$customMatcher from "core-js-pure/features/symbol/custom-matcher.js"; +import _Iterator$concat from "core-js-pure/features/iterator/concat.js"; +import _SyntaxError$isError from "core-js-pure/features/error/is-error.js"; +import _Array$fromAsync from "core-js-pure/features/array/from-async.js"; +import _Iterator$zip from "core-js-pure/features/iterator/zip.js"; +import _Iterator$zipKeyed from "core-js-pure/features/iterator/zip-keyed.js"; +import _clampInstanceProperty from "core-js-pure/features/instance/clamp.js"; +import _Promise$allKeyed from "core-js-pure/features/promise/all-keyed.js"; +import _Promise$allSettledKeyed from "core-js-pure/features/promise/all-settled-keyed.js"; +_findLastInstanceProperty(_context = []).call(_context, fn); +_findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); +[].asIndexedPairs(); +_Iterator$from({ + next: () => ({ + done: Math.random() > .9, + value: Math.random() * 10 | 0 + }) +}).forEach(console.log).toArray(); +_groupByInstanceProperty(_context3 = _AsyncIterator$from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2)).call(_context3, it => id % 4).map(it => it ** 2).toArray().then(console.log); +_groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context5, x => x)).call(_context4, x => x % 2); +_Number$range(1, 2); +_BigInt$range(1n, 2n); +_Array$isTemplateObject((x => x)`a${x}z`); +new Map([['x', 1]]).emplace('x', { + update: x => x + 1, + insert: () => 0 +}); +/x/.dotAll; +/x/.sticky; +_Symbol$asyncDispose; +_Symbol$matcher; +Symbol.matchAll; +_Symbol$metadata; +Symbol.replaceAll; +new URL(url); +const foo = _groupByToMapInstanceProperty(_context6 = [1, 2, 3]).call(_context6, bar); +const push = _unThisInstanceProperty(_context7 = _pushInstanceProperty([])).call(_context7); +_Function$isConstructor; +throw new DOMException(); +_structuredClone(72); +btoa('hi'); +foo.indexed; +_withInstanceProperty(bar); +_pushInstanceProperty(buz); +fuz.__proto__; +_isWellFormedInstanceProperty(string); +_toWellFormedInstanceProperty(string); +_String$dedent`42`; +self; +_SuppressedError; +_DisposableStack; +_AsyncDisposableStack; +_Iterator$range(foo, bar); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); +_Symbol$isWellKnown(foo); +_Symbol$isRegistered(foo); +_demethodizeInstanceProperty(Function).call(Function); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); +_URL$canParse(foo); +_Symbol$isWellKnownSymbol(foo); +_Symbol$isRegisteredSymbol(foo); +_Symbol$metadata; +_Object$groupBy(a, b); +_Map$groupBy(a, b); +_Promise$withResolvers(); +new URLSearchParams().has(a, b); +_Math$f16round(foo); +foo.getFloat16(0); +foo.setFloat16(0, 1); +foo.getUint8Clamped(0); +foo.setUint8Clamped(0, 1); +_RegExp$escape(foo); +Uint8Array.fromBase64(string); +Uint8Array.fromHex(string); +new Uint8Array(foo).setFromBase64(string); +new Uint8Array(foo).setFromHex(string); +new Uint8Array(foo).toBase64(); +new Uint8Array(foo).toHex(); +_URL$parse(x); +_Math$sumPrecise(x); +_Symbol$customMatcher; +_Iterator$concat(a, b); +new Map().getOrInsert(a, b); +_SyntaxError$isError(a); +_Array$fromAsync(a); +_Iterator$zip(a, b); +_Iterator$zipKeyed(a, b); +a.chunks(b); +a.sliding(b); +a.windows(b); +_clampInstanceProperty(a).call(a, b, c); +_Promise$allKeyed(a); +_Promise$allSettledKeyed(a); +a.includes(); +a.join(); diff --git a/yarn.lock b/yarn.lock index 10f34211..99a2d5dc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5194,9 +5194,9 @@ __metadata: "@babel/plugin-transform-modules-commonjs": "npm:^8.0.0" "@babel/plugin-transform-runtime": "npm:^8.0.0" "@babel/plugin-transform-spread": "npm:^8.0.0" - core-js: "npm:^3.48.0" - core-js-compat: "npm:^3.48.0" - core-js-pure: "npm:^3.48.0" + core-js: "npm:^3.50.0" + core-js-compat: "npm:^3.50.0" + core-js-pure: "npm:^3.50.0" peerDependencies: "@babel/core": ^7.4.0 || ^8.0.0 languageName: unknown @@ -5365,12 +5365,12 @@ __metadata: languageName: node linkType: hard -"baseline-browser-mapping@npm:^2.9.0": - version: 2.10.38 - resolution: "baseline-browser-mapping@npm:2.10.38" +"baseline-browser-mapping@npm:^2.10.44": + version: 2.11.12 + resolution: "baseline-browser-mapping@npm:2.11.12" bin: baseline-browser-mapping: dist/cli.cjs - checksum: 10/cb6c9913df1e8f0f9040cdacd3af0371f2daf2b16563d86d3b208c14a392b4783a6be434b9e7cf5dc413d6e40548b7b719e1a12e59789fb4b3db37146fb9e6b2 + checksum: 10/ad91bf463bcc673c7a3d0aa0232af0e3d7a9c5be936acba665c53fc01107b8ea3dd84471f6e266e05107b34744d7288ffdd087b713905472b36b5adb7e4fd72d languageName: node linkType: hard @@ -5486,18 +5486,18 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.24.0, browserslist@npm:^4.28.1": - version: 4.28.1 - resolution: "browserslist@npm:4.28.1" +"browserslist@npm:^4.24.0, browserslist@npm:^4.28.1, browserslist@npm:^4.28.7": + version: 4.28.7 + resolution: "browserslist@npm:4.28.7" dependencies: - baseline-browser-mapping: "npm:^2.9.0" - caniuse-lite: "npm:^1.0.30001759" - electron-to-chromium: "npm:^1.5.263" - node-releases: "npm:^2.0.27" - update-browserslist-db: "npm:^1.2.0" + baseline-browser-mapping: "npm:^2.10.44" + caniuse-lite: "npm:^1.0.30001806" + electron-to-chromium: "npm:^1.5.393" + node-releases: "npm:^2.0.51" + update-browserslist-db: "npm:^1.2.3" bin: browserslist: cli.js - checksum: 10/64f2a97de4bce8473c0e5ae0af8d76d1ead07a5b05fc6bc87b848678bb9c3a91ae787b27aa98cdd33fc00779607e6c156000bed58fefb9cf8e4c5a183b994cdb + checksum: 10/4de67c9aa630a674572e790f32021237e61aaf69338d84f2875abeb793f87bdaaa2f9760129eeacd8292c50f0ec26fa15ddf02057c27940e1d76f1742bc600cb languageName: node linkType: hard @@ -5719,10 +5719,10 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30001759": - version: 1.0.30001799 - resolution: "caniuse-lite@npm:1.0.30001799" - checksum: 10/eb90443f1e4e4ac7cfe3686d43f0d132c0b552d0d896c0520e7306f2ddf743b4dd5380a7b8adc5ca8d250247966a6cf32cb042930dbc1df452e8623ad92c57e2 +"caniuse-lite@npm:^1.0.30001806": + version: 1.0.30001806 + resolution: "caniuse-lite@npm:1.0.30001806" + checksum: 10/25d4ed6a2f03f51519bf302739cbe53e5522205607e47455cfcf19fdde975f2fdb890b78ead7b18961d5635ee676f03c73dea1ef30e9ef1d3fe11b9f02485f86 languageName: node linkType: hard @@ -6317,26 +6317,26 @@ __metadata: languageName: node linkType: hard -"core-js-compat@npm:^3.48.0": - version: 3.48.0 - resolution: "core-js-compat@npm:3.48.0" +"core-js-compat@npm:^3.48.0, core-js-compat@npm:^3.50.0": + version: 3.50.0 + resolution: "core-js-compat@npm:3.50.0" dependencies: - browserslist: "npm:^4.28.1" - checksum: 10/83c326dcfef5e174fd3f8f33c892c66e06d567ce27f323a1197a6c280c0178fe18d3e9c5fb95b00c18b98d6c53fba5c646def5fedaa77310a4297d16dfbe2029 + browserslist: "npm:^4.28.7" + checksum: 10/491d522653c8e606b9548f030e247fb84c9374f897dd56703691206501d30c51e08f77c69f9a60ec36fc4a9d31495c6bcd5433ac03af5c62c69fe467ebb84b1e languageName: node linkType: hard -"core-js-pure@npm:^3.48.0": - version: 3.48.0 - resolution: "core-js-pure@npm:3.48.0" - checksum: 10/7c624d5551252ad166b9a7df4daca354540b71bb2ce9c8df2a9ef7acb6335a7a56557bcbe2bd78e20e3a4eeeee2922ff37a22a67e978b293a2b4e5b9a7a04d9b +"core-js-pure@npm:^3.50.0": + version: 3.50.0 + resolution: "core-js-pure@npm:3.50.0" + checksum: 10/4009d549c955dbd4274b58a6c36c7afce8a8f468a631bacb06708873bf503b1c91cbf5baa88c8605c2fff2ccc481fb337e9358c16c029c701d0fffa074e1706e languageName: node linkType: hard -"core-js@npm:^3.48.0": - version: 3.48.0 - resolution: "core-js@npm:3.48.0" - checksum: 10/08bb3cc9b3225b905e72370c18257a14bb5563946d9eb7496799e0ee4f13231768b980ffe98434df7dbd0f8209bd2c19519938a2fa94846b2c82c2d5aa804037 +"core-js@npm:^3.50.0": + version: 3.50.0 + resolution: "core-js@npm:3.50.0" + checksum: 10/9690bd111d8500437e65b365ec0dbe8d8899e99e877452d142c72bfbf272bd6edbf38ec9c2da8fa88d9186bba9246309bff68cedd2a6c43a3bf0748625e0e092 languageName: node linkType: hard @@ -6806,10 +6806,10 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.5.263, electron-to-chromium@npm:^1.5.278": - version: 1.5.278 - resolution: "electron-to-chromium@npm:1.5.278" - checksum: 10/e69c4e843f9381d84be6266928a3c846dbaec1a61a9cb561f89ba467396c1c885dbd296d40ef23b505e5a8765f76f696dbe07024aabc2299932e22bbf7ff2ec9 +"electron-to-chromium@npm:^1.5.278, electron-to-chromium@npm:^1.5.393": + version: 1.5.401 + resolution: "electron-to-chromium@npm:1.5.401" + checksum: 10/5fac6fcf06a469dd6fffae4804b950c6f9eec5d3f73f3f6396f770a87f865d241b952aa17d5e453e699335832d63e3475ef49dc88e3681a85d341c29b304d5c7 languageName: node linkType: hard @@ -11514,10 +11514,10 @@ __metadata: languageName: node linkType: hard -"node-releases@npm:^2.0.27": - version: 2.0.27 - resolution: "node-releases@npm:2.0.27" - checksum: 10/f6c78ddb392ae500719644afcbe68a9ea533242c02312eb6a34e8478506eb7482a3fb709c70235b01c32fe65625b68dfa9665113f816d87f163bc3819b62b106 +"node-releases@npm:^2.0.51": + version: 2.0.52 + resolution: "node-releases@npm:2.0.52" + checksum: 10/0aa457c2805a560608c3ceca4df13c8b1b932f23aa367f2678681c84cc864bd4860fbfacc09f7260954fa66e8c05f343dbc5e9088163000fedae12f8da83ed48 languageName: node linkType: hard @@ -15013,7 +15013,7 @@ __metadata: languageName: node linkType: hard -"update-browserslist-db@npm:^1.2.0": +"update-browserslist-db@npm:^1.2.3": version: 1.2.3 resolution: "update-browserslist-db@npm:1.2.3" dependencies: