diff --git a/README.md b/README.md index 4e8eae35..8f7836f9 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 ee9d37fd..e883f31f 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,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.46.0" + "@babel/preset-env/core-js-compat": "^3.47.0" }, "engines": { "node": ">= 6.9.0", diff --git a/packages/babel-plugin-polyfill-corejs3/README.md b/packages/babel-plugin-polyfill-corejs3/README.md index f644a36f..f5440651 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.46" }]] + "plugins": [["polyfill-corejs3", { "method": "usage-global", "version": "3.47" }]] } ``` @@ -55,7 +55,7 @@ If you are a library author, specify a reasonably modern `core-js` version in yo ```json { "dependencies": { - "core-js": "^3.46.0" + "core-js": "^3.47.0" } } ``` diff --git a/packages/babel-plugin-polyfill-corejs3/package.json b/packages/babel-plugin-polyfill-corejs3/package.json index dbef48a9..d46a61a6 100644 --- a/packages/babel-plugin-polyfill-corejs3/package.json +++ b/packages/babel-plugin-polyfill-corejs3/package.json @@ -27,7 +27,7 @@ ], "dependencies": { "@babel/helper-define-polyfill-provider": "workspace:^0.6.5", - "core-js-compat": "^3.46.0" + "core-js-compat": "^3.47.0" }, "devDependencies": { "@babel/core": "^7.27.7", @@ -39,8 +39,8 @@ "@babel/plugin-transform-modules-commonjs": "^7.27.1", "@babel/plugin-transform-runtime": "^7.27.4", "@babel/plugin-transform-spread": "^7.27.1", - "core-js": "^3.46.0", - "core-js-pure": "^3.46.0" + "core-js": "^3.47.0", + "core-js-pure": "^3.47.0" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-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 42273753..eb853225 100644 --- a/packages/babel-plugin-polyfill-corejs3/src/built-in-definitions.ts +++ b/packages/babel-plugin-polyfill-corejs3/src/built-in-definitions.ts @@ -392,7 +392,7 @@ export const StaticProperties: ObjectMap2 = { Iterator: { concat: define("iterator/concat", [ - "esnext.iterator.concat", + "es.iterator.concat", ...IteratorDependencies, ...CommonIterators, ]), @@ -420,18 +420,17 @@ export const StaticProperties: ObjectMap2 = { }, JSON: { - isRawJSON: define("json/is-raw-json", ["esnext.json.is-raw-json"]), - parse: define("json/parse", ["esnext.json.parse", "es.object.keys"]), + isRawJSON: define("json/is-raw-json", ["es.json.is-raw-json"]), + parse: define("json/parse", ["es.json.parse", "es.object.keys"]), rawJSON: define("json/raw-json", [ - "esnext.json.raw-json", + "es.json.raw-json", "es.object.create", "es.object.freeze", ]), - stringify: define( - "json/stringify", - ["es.json.stringify", "es.date.to-json"], - "es.symbol", - ), + stringify: define("json/stringify", [ + "es.json.stringify", + "es.date.to-json", + ]), }, Math: { diff --git a/packages/babel-plugin-polyfill-corejs3/src/shipped-proposals.ts b/packages/babel-plugin-polyfill-corejs3/src/shipped-proposals.ts index 174ec54c..6076ef03 100644 --- a/packages/babel-plugin-polyfill-corejs3/src/shipped-proposals.ts +++ b/packages/babel-plugin-polyfill-corejs3/src/shipped-proposals.ts @@ -3,9 +3,6 @@ export default new Set([ "esnext.array.group", "esnext.array.group-to-map", - "esnext.json.is-raw-json", - "esnext.json.parse", - "esnext.json.raw-json", "esnext.map.get-or-insert", "esnext.map.get-or-insert-computed", "esnext.symbol.metadata", diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.27/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.27/output.mjs index 8ff57490..37fb3cae 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.27/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.27/output.mjs @@ -1,4 +1,5 @@ import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.json.stringify.js"; import "core-js/modules/es.regexp.flags.js"; import "core-js/modules/esnext.suppressed-error.constructor.js"; import "core-js/modules/esnext.array.from-async.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.28/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.28/output.mjs index 3228b6ee..9e93aa3e 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.28/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.28/output.mjs @@ -3,6 +3,7 @@ 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.json.stringify.js"; import "core-js/modules/es.regexp.flags.js"; import "core-js/modules/es.typed-array.to-reversed.js"; import "core-js/modules/es.typed-array.to-sorted.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.29/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.29/output.mjs index cb08fd2b..d688ed00 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.29/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.29/output.mjs @@ -3,6 +3,7 @@ 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.json.stringify.js"; import "core-js/modules/es.regexp.flags.js"; import "core-js/modules/es.typed-array.to-reversed.js"; import "core-js/modules/es.typed-array.to-sorted.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.30/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.30/output.mjs index e7d7b2ac..64d573ba 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.30/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.30/output.mjs @@ -3,6 +3,7 @@ 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.json.stringify.js"; import "core-js/modules/es.regexp.flags.js"; import "core-js/modules/es.typed-array.to-reversed.js"; import "core-js/modules/es.typed-array.to-sorted.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.31/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.31/output.mjs index 5a2f1957..5608d760 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.31/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.31/output.mjs @@ -3,6 +3,7 @@ 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.json.stringify.js"; import "core-js/modules/es.regexp.flags.js"; import "core-js/modules/es.string.is-well-formed.js"; import "core-js/modules/es.string.to-well-formed.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.32/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.32/output.mjs index 0ec72797..400a31e2 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.32/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.32/output.mjs @@ -3,6 +3,7 @@ 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.json.stringify.js"; import "core-js/modules/es.regexp.flags.js"; import "core-js/modules/es.string.is-well-formed.js"; import "core-js/modules/es.string.to-well-formed.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.33/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.33/output.mjs index 67e2ecda..95da34da 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.33/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.33/output.mjs @@ -3,6 +3,7 @@ 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.json.stringify.js"; import "core-js/modules/es.regexp.flags.js"; import "core-js/modules/es.string.is-well-formed.js"; import "core-js/modules/es.string.to-well-formed.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.34/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.34/output.mjs index 0120dc10..8fb03cb7 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.34/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.34/output.mjs @@ -3,6 +3,7 @@ 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.json.stringify.js"; import "core-js/modules/es.map.group-by.js"; import "core-js/modules/es.object.group-by.js"; import "core-js/modules/es.promise.with-resolvers.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.36/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.36/output.mjs index 8f81e854..1bf90c02 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.36/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.36/output.mjs @@ -6,6 +6,7 @@ import "core-js/modules/es.array.with.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.json.stringify.js"; import "core-js/modules/es.map.group-by.js"; import "core-js/modules/es.object.group-by.js"; import "core-js/modules/es.promise.with-resolvers.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.37/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.37/output.mjs index c7c8c084..af6e7e24 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.37/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.37/output.mjs @@ -6,6 +6,7 @@ import "core-js/modules/es.array.with.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.json.stringify.js"; import "core-js/modules/es.map.group-by.js"; import "core-js/modules/es.object.group-by.js"; import "core-js/modules/es.promise.with-resolvers.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.38/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.38/output.mjs index 8b233f70..19cc1ccd 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.38/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.38/output.mjs @@ -6,6 +6,7 @@ import "core-js/modules/es.array.with.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.json.stringify.js"; import "core-js/modules/es.map.group-by.js"; import "core-js/modules/es.object.group-by.js"; import "core-js/modules/es.promise.with-resolvers.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.39/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.39/output.mjs index 1d7f318d..b4e6e4b8 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.39/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.39/output.mjs @@ -19,6 +19,7 @@ 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.json.stringify.js"; import "core-js/modules/es.map.group-by.js"; import "core-js/modules/es.object.group-by.js"; import "core-js/modules/es.promise.try.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.40/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.40/output.mjs index dffaf7ed..be62e020 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.40/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.40/output.mjs @@ -19,6 +19,7 @@ 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.json.stringify.js"; import "core-js/modules/es.map.group-by.js"; import "core-js/modules/es.object.group-by.js"; import "core-js/modules/es.promise.try.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.41/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.41/output.mjs index 72ef77fe..48e0df52 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.41/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.41/output.mjs @@ -21,6 +21,7 @@ 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.json.stringify.js"; import "core-js/modules/es.map.group-by.js"; import "core-js/modules/es.math.f16round.js"; import "core-js/modules/es.object.group-by.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.42/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.42/output.mjs index 72ef77fe..48e0df52 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.42/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.42/output.mjs @@ -21,6 +21,7 @@ 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.json.stringify.js"; import "core-js/modules/es.map.group-by.js"; import "core-js/modules/es.math.f16round.js"; import "core-js/modules/es.object.group-by.js"; 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 b938ab00..00bf1089 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 @@ -27,6 +27,7 @@ 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.json.stringify.js"; import "core-js/modules/es.map.group-by.js"; import "core-js/modules/es.math.f16round.js"; import "core-js/modules/es.object.group-by.js"; @@ -69,6 +70,8 @@ import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.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/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 b938ab00..00bf1089 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 @@ -27,6 +27,7 @@ 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.json.stringify.js"; import "core-js/modules/es.map.group-by.js"; import "core-js/modules/es.math.f16round.js"; import "core-js/modules/es.object.group-by.js"; @@ -69,6 +70,8 @@ import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.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/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 56cae752..334fda9c 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 @@ -27,6 +27,7 @@ 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.json.stringify.js"; import "core-js/modules/es.map.group-by.js"; import "core-js/modules/es.math.f16round.js"; import "core-js/modules/es.math.sum-precise.js"; @@ -76,6 +77,8 @@ import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.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/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 56cae752..334fda9c 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 @@ -27,6 +27,7 @@ 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.json.stringify.js"; import "core-js/modules/es.map.group-by.js"; import "core-js/modules/es.math.f16round.js"; import "core-js/modules/es.math.sum-precise.js"; @@ -76,6 +77,8 @@ import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.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/entry-global/actual-chrome-107-corejs-3.47/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.47/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.47/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.47/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.47/options.json new file mode 100644 index 00000000..0f973e69 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.47/options.json @@ -0,0 +1,15 @@ +{ + "externalHelpers": false, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "version": "3.47", + "method": "entry-global", + "targets": { + "chrome": 107 + } + } + ] + ] +} 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 new file mode 100644 index 00000000..a6ba60fc --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.47/output.mjs @@ -0,0 +1,98 @@ +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.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.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/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.to-async.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/esnext.symbol.metadata.js"; +import "core-js/modules/esnext.typed-array.to-spliced.js"; +import "core-js/modules/esnext.weak-map.get-or-insert.js"; +import "core-js/modules/esnext.weak-map.get-or-insert-computed.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 be94b8b6..58827cdc 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 @@ -300,6 +300,8 @@ import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.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/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 be94b8b6..58827cdc 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 @@ -300,6 +300,8 @@ import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.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/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 f526d5f1..3de86ecf 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 @@ -307,6 +307,8 @@ import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.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/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 f526d5f1..3de86ecf 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 @@ -307,6 +307,8 @@ import "core-js/modules/esnext.async-iterator.to-array.js"; import "core-js/modules/esnext.function.metadata.js"; import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.to-async.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/entry-global/actual-corejs-3.47/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.47/input.mjs new file mode 100644 index 00000000..a3a9078c --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.47/input.mjs @@ -0,0 +1 @@ +import 'core-js/actual'; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.47/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.47/options.json new file mode 100644 index 00000000..97c38caa --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.47/options.json @@ -0,0 +1,12 @@ +{ + "externalHelpers": false, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "version": "3.47", + "method": "entry-global" + } + ] + ] +} 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 new file mode 100644 index 00000000..d3d21d5e --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.47/output.mjs @@ -0,0 +1,340 @@ +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.set-year.js"; +import "core-js/modules/es.date.to-gmt-string.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.escape.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.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.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.unescape.js"; +import "core-js/modules/es.weak-map.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.to-async.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/esnext.symbol.metadata.js"; +import "core-js/modules/esnext.typed-array.to-spliced.js"; +import "core-js/modules/esnext.weak-map.get-or-insert.js"; +import "core-js/modules/esnext.weak-map.get-or-insert-computed.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.47/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.47/input.mjs new file mode 100644 index 00000000..66bfb4d1 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.47/input.mjs @@ -0,0 +1 @@ +import 'core-js'; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.47/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.47/options.json new file mode 100644 index 00000000..97c38caa --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.47/options.json @@ -0,0 +1,12 @@ +{ + "externalHelpers": false, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "version": "3.47", + "method": "entry-global" + } + ] + ] +} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.47/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.47/output.mjs new file mode 100644 index 00000000..25983660 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.47/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.set-year.js"; +import "core-js/modules/es.date.to-gmt-string.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.escape.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.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.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.unescape.js"; +import "core-js/modules/es.weak-map.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.indexed.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.iterator.zip.js"; +import "core-js/modules/esnext.iterator.zip-keyed.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.get-or-insert.js"; +import "core-js/modules/esnext.map.get-or-insert-computed.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.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.get-or-insert.js"; +import "core-js/modules/esnext.weak-map.get-or-insert-computed.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.28/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.28/output.mjs index db473706..6d4b8f88 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.28/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.28/output.mjs @@ -78,6 +78,9 @@ import "core-js/modules/esnext.iterator.from.js"; import "core-js/modules/esnext.iterator.map.js"; import "core-js/modules/esnext.iterator.take.js"; import "core-js/modules/esnext.iterator.to-array.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"; import "core-js/modules/esnext.map.group-by.js"; import "core-js/modules/esnext.set.difference.v2.js"; import "core-js/modules/esnext.set.intersection.v2.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.29/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.29/output.mjs index 5f610805..13654bc5 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.29/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.29/output.mjs @@ -78,6 +78,9 @@ import "core-js/modules/esnext.iterator.from.js"; import "core-js/modules/esnext.iterator.map.js"; import "core-js/modules/esnext.iterator.take.js"; import "core-js/modules/esnext.iterator.to-array.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"; import "core-js/modules/esnext.map.group-by.js"; import "core-js/modules/esnext.set.difference.v2.js"; import "core-js/modules/esnext.set.intersection.v2.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.30/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.30/output.mjs index 8e0aff34..9b5a8982 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.30/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.30/output.mjs @@ -78,6 +78,9 @@ import "core-js/modules/esnext.iterator.from.js"; import "core-js/modules/esnext.iterator.map.js"; import "core-js/modules/esnext.iterator.take.js"; import "core-js/modules/esnext.iterator.to-array.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"; import "core-js/modules/esnext.map.group-by.js"; import "core-js/modules/esnext.set.difference.v2.js"; import "core-js/modules/esnext.set.intersection.v2.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.31/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.31/output.mjs index 9ea5a082..e8dc544a 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.31/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.31/output.mjs @@ -80,6 +80,9 @@ import "core-js/modules/esnext.iterator.from.js"; import "core-js/modules/esnext.iterator.map.js"; import "core-js/modules/esnext.iterator.take.js"; import "core-js/modules/esnext.iterator.to-array.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"; import "core-js/modules/esnext.map.group-by.js"; import "core-js/modules/esnext.object.group-by.js"; import "core-js/modules/esnext.promise.with-resolvers.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.32/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.32/output.mjs index bd9af2a3..263e4f9f 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.32/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.32/output.mjs @@ -82,6 +82,9 @@ import "core-js/modules/esnext.iterator.from.js"; import "core-js/modules/esnext.iterator.map.js"; import "core-js/modules/esnext.iterator.take.js"; import "core-js/modules/esnext.iterator.to-array.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"; import "core-js/modules/esnext.map.group-by.js"; import "core-js/modules/esnext.math.f16round.js"; import "core-js/modules/esnext.object.group-by.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.33/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.33/output.mjs index 2ac587cc..445f0442 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.33/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.33/output.mjs @@ -82,6 +82,9 @@ import "core-js/modules/esnext.iterator.from.js"; import "core-js/modules/esnext.iterator.map.js"; import "core-js/modules/esnext.iterator.take.js"; import "core-js/modules/esnext.iterator.to-array.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"; import "core-js/modules/esnext.map.group-by.js"; import "core-js/modules/esnext.math.f16round.js"; import "core-js/modules/esnext.object.group-by.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.34/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.34/output.mjs index b00bd268..244f7d33 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.34/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.34/output.mjs @@ -85,6 +85,9 @@ import "core-js/modules/esnext.iterator.from.js"; import "core-js/modules/esnext.iterator.map.js"; import "core-js/modules/esnext.iterator.take.js"; import "core-js/modules/esnext.iterator.to-array.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"; import "core-js/modules/esnext.math.f16round.js"; import "core-js/modules/esnext.regexp.escape.js"; import "core-js/modules/esnext.set.difference.v2.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.36/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.36/output.mjs index 88a19cdd..fe2dc4b6 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.36/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.36/output.mjs @@ -85,6 +85,9 @@ import "core-js/modules/esnext.iterator.from.js"; import "core-js/modules/esnext.iterator.map.js"; import "core-js/modules/esnext.iterator.take.js"; import "core-js/modules/esnext.iterator.to-array.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"; import "core-js/modules/esnext.math.f16round.js"; import "core-js/modules/esnext.regexp.escape.js"; import "core-js/modules/esnext.set.difference.v2.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.37/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.37/output.mjs index af818b45..91b1a46d 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.37/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.37/output.mjs @@ -92,6 +92,9 @@ import "core-js/modules/esnext.iterator.from.js"; import "core-js/modules/esnext.iterator.map.js"; import "core-js/modules/esnext.iterator.take.js"; import "core-js/modules/esnext.iterator.to-array.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"; import "core-js/modules/esnext.math.f16round.js"; import "core-js/modules/esnext.math.sum-precise.js"; import "core-js/modules/esnext.regexp.escape.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.38/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.38/output.mjs index a4444799..df279e6d 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.38/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.38/output.mjs @@ -92,6 +92,9 @@ import "core-js/modules/esnext.iterator.from.js"; import "core-js/modules/esnext.iterator.map.js"; import "core-js/modules/esnext.iterator.take.js"; import "core-js/modules/esnext.iterator.to-array.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"; import "core-js/modules/esnext.math.f16round.js"; import "core-js/modules/esnext.math.sum-precise.js"; import "core-js/modules/esnext.regexp.escape.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.39/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.39/output.mjs index c72f34cd..a1fbbd9b 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.39/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.39/output.mjs @@ -91,7 +91,11 @@ import "core-js/modules/esnext.async-iterator.async-dispose.js"; import "core-js/modules/esnext.data-view.get-float16.js"; import "core-js/modules/esnext.data-view.set-float16.js"; import "core-js/modules/esnext.disposable-stack.constructor.js"; +import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.dispose.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"; import "core-js/modules/esnext.math.f16round.js"; import "core-js/modules/esnext.math.sum-precise.js"; import "core-js/modules/esnext.regexp.escape.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.40/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.40/output.mjs index 186e3fd4..11c7e636 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.40/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.40/output.mjs @@ -92,7 +92,11 @@ import "core-js/modules/esnext.data-view.get-float16.js"; import "core-js/modules/esnext.data-view.set-float16.js"; import "core-js/modules/esnext.disposable-stack.constructor.js"; import "core-js/modules/esnext.error.is-error.js"; +import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.dispose.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"; import "core-js/modules/esnext.math.f16round.js"; import "core-js/modules/esnext.math.sum-precise.js"; import "core-js/modules/esnext.regexp.escape.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.41/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.41/output.mjs index d5de7530..e7a91b49 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.41/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.41/output.mjs @@ -94,7 +94,11 @@ import "core-js/modules/esnext.async-disposable-stack.constructor.js"; import "core-js/modules/esnext.async-iterator.async-dispose.js"; import "core-js/modules/esnext.disposable-stack.constructor.js"; import "core-js/modules/esnext.error.is-error.js"; +import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.dispose.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"; import "core-js/modules/esnext.math.sum-precise.js"; import "core-js/modules/esnext.symbol.async-dispose.js"; import "core-js/modules/esnext.uint8-array.from-base64.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.42/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.42/output.mjs index d5de7530..e7a91b49 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.42/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.42/output.mjs @@ -94,7 +94,11 @@ import "core-js/modules/esnext.async-disposable-stack.constructor.js"; import "core-js/modules/esnext.async-iterator.async-dispose.js"; import "core-js/modules/esnext.disposable-stack.constructor.js"; import "core-js/modules/esnext.error.is-error.js"; +import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.dispose.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"; import "core-js/modules/esnext.math.sum-precise.js"; import "core-js/modules/esnext.symbol.async-dispose.js"; import "core-js/modules/esnext.uint8-array.from-base64.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 80072efc..01ea40c7 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 @@ -96,6 +96,10 @@ 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.concat.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"; import "core-js/modules/esnext.math.sum-precise.js"; import "core-js/modules/esnext.uint8-array.from-base64.js"; import "core-js/modules/esnext.uint8-array.from-hex.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 16284c75..e8c1d07d 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 @@ -96,6 +96,10 @@ 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.concat.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"; import "core-js/modules/esnext.math.sum-precise.js"; import "core-js/modules/esnext.uint8-array.from-base64.js"; import "core-js/modules/esnext.uint8-array.from-hex.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 54440b59..17c0d290 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 @@ -103,6 +103,10 @@ 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.concat.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"; 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"; 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 54440b59..17c0d290 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 @@ -103,6 +103,10 @@ 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.concat.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"; 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"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.47/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.47/input.mjs new file mode 100644 index 00000000..122b5acc --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.47/input.mjs @@ -0,0 +1,120 @@ +[].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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.47/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.47/options.json new file mode 100644 index 00000000..15762935 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.47/options.json @@ -0,0 +1,12 @@ +{ + "externalHelpers": false, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "version": "3.47", + "method": "usage-global" + } + ] + ] +} 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 new file mode 100644 index 00000000..30d09770 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.47/output.mjs @@ -0,0 +1,210 @@ +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.iterator.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.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.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.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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.47/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.47/input.mjs new file mode 100644 index 00000000..122b5acc --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.47/input.mjs @@ -0,0 +1,120 @@ +[].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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.47/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.47/options.json new file mode 100644 index 00000000..3ceac11e --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.47/options.json @@ -0,0 +1,16 @@ +{ + "externalHelpers": false, + "targets": { + "chrome": 107 + }, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "method": "usage-global", + "version": "3.47", + "proposals": true + } + ] + ] +} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.47/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.47/output.mjs new file mode 100644 index 00000000..b8ecc402 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.47/output.mjs @@ -0,0 +1,221 @@ +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.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.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.indexed.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.iterator.zip.js"; +import "core-js/modules/esnext.iterator.zip-keyed.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.get-or-insert.js"; +import "core-js/modules/esnext.map.get-or-insert-computed.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.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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.39/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.39/output.mjs index 4e646cbf..d470d838 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.39/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.39/output.mjs @@ -91,6 +91,7 @@ import "core-js/modules/esnext.async-iterator.async-dispose.js"; import "core-js/modules/esnext.data-view.get-float16.js"; import "core-js/modules/esnext.data-view.set-float16.js"; import "core-js/modules/esnext.disposable-stack.constructor.js"; +import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.dispose.js"; import "core-js/modules/esnext.json.is-raw-json.js"; import "core-js/modules/esnext.json.parse.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.40/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.40/output.mjs index 1cf65e48..925dd330 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.40/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.40/output.mjs @@ -92,6 +92,7 @@ import "core-js/modules/esnext.data-view.get-float16.js"; import "core-js/modules/esnext.data-view.set-float16.js"; import "core-js/modules/esnext.disposable-stack.constructor.js"; import "core-js/modules/esnext.error.is-error.js"; +import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.dispose.js"; import "core-js/modules/esnext.json.is-raw-json.js"; import "core-js/modules/esnext.json.parse.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.41/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.41/output.mjs index cb9c902b..02b7e5e5 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.41/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.41/output.mjs @@ -94,6 +94,7 @@ import "core-js/modules/esnext.async-disposable-stack.constructor.js"; import "core-js/modules/esnext.async-iterator.async-dispose.js"; import "core-js/modules/esnext.disposable-stack.constructor.js"; import "core-js/modules/esnext.error.is-error.js"; +import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.dispose.js"; import "core-js/modules/esnext.json.is-raw-json.js"; import "core-js/modules/esnext.json.parse.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.42/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.42/output.mjs index cb9c902b..02b7e5e5 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.42/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.42/output.mjs @@ -94,6 +94,7 @@ import "core-js/modules/esnext.async-disposable-stack.constructor.js"; import "core-js/modules/esnext.async-iterator.async-dispose.js"; import "core-js/modules/esnext.disposable-stack.constructor.js"; import "core-js/modules/esnext.error.is-error.js"; +import "core-js/modules/esnext.iterator.concat.js"; import "core-js/modules/esnext.iterator.dispose.js"; import "core-js/modules/esnext.json.is-raw-json.js"; import "core-js/modules/esnext.json.parse.js"; 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 025aceb4..1d0ca488 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,6 +96,7 @@ 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.concat.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/shippedProposals-corejs-3.44/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.44/output.mjs index 4043179c..7d388ace 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,6 +96,7 @@ 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.concat.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/shippedProposals-corejs-3.45/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.45/output.mjs index a6558213..306bef41 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,6 +103,7 @@ 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.concat.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/shippedProposals-corejs-3.46/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.46/output.mjs index a6558213..306bef41 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,6 +103,7 @@ 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.concat.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/shippedProposals-corejs-3.47/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.47/input.mjs new file mode 100644 index 00000000..d808a5d4 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.47/input.mjs @@ -0,0 +1,121 @@ +[].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); + diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.47/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.47/options.json new file mode 100644 index 00000000..f117c72b --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.47/options.json @@ -0,0 +1,13 @@ +{ + "externalHelpers": false, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "method": "usage-global", + "version": "3.47", + "shippedProposals": true + } + ] + ] +} 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 new file mode 100644 index 00000000..870d6a17 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.47/output.mjs @@ -0,0 +1,213 @@ +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.iterator.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.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.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.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.map.get-or-insert.js"; +import "core-js/modules/esnext.map.get-or-insert-computed.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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.28/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.28/output.mjs index 47b05c89..61a7947b 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.28/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.28/output.mjs @@ -23,6 +23,9 @@ 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 from "core-js-pure/features/iterator/index.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 _URLSearchParams from "core-js-pure/stable/url-search-params/index.js"; import _Set from "core-js-pure/stable/set/index.js"; import _Map$groupBy from "core-js-pure/features/map/group-by.js"; @@ -72,9 +75,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.30/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.30/output.mjs index 4b4c22ee..a93a8b1c 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.30/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.30/output.mjs @@ -23,6 +23,9 @@ 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 from "core-js-pure/features/iterator/index.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 _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"; @@ -73,9 +76,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.31/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.31/output.mjs index 4f3b255e..096ec488 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.31/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.31/output.mjs @@ -23,6 +23,9 @@ 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 from "core-js-pure/features/iterator/index.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 _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"; @@ -74,9 +77,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.32/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.32/output.mjs index 091f1659..17050914 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.32/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.32/output.mjs @@ -23,6 +23,9 @@ 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 from "core-js-pure/features/iterator/index.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 _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"; @@ -75,9 +78,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.33/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.33/output.mjs index 0f53de59..95b64e61 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.33/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.33/output.mjs @@ -23,6 +23,9 @@ 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 from "core-js-pure/features/iterator/index.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 _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"; @@ -76,9 +79,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.34/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.34/output.mjs index 0eea4220..5cc8af91 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.34/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.34/output.mjs @@ -23,6 +23,9 @@ 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 from "core-js-pure/features/iterator/index.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 _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"; @@ -76,9 +79,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.36/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.36/output.mjs index 0eea4220..5cc8af91 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.36/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.36/output.mjs @@ -23,6 +23,9 @@ 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 from "core-js-pure/features/iterator/index.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 _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"; @@ -76,9 +79,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.37/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.37/output.mjs index 4029f81a..a0367baa 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.37/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.37/output.mjs @@ -23,6 +23,9 @@ 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 from "core-js-pure/features/iterator/index.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 _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"; @@ -78,9 +81,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.38/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.38/output.mjs index 4029f81a..a0367baa 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.38/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.38/output.mjs @@ -23,6 +23,9 @@ 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 from "core-js-pure/features/iterator/index.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 _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"; @@ -78,9 +81,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.39/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.39/output.mjs index 7da8366f..671e5b18 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.39/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.39/output.mjs @@ -23,6 +23,9 @@ 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 from "core-js-pure/stable/iterator/index.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 _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"; @@ -33,6 +36,7 @@ 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/stable/url/parse.js"; import _Math$sumPrecise from "core-js-pure/features/math/sum-precise.js"; +import _Iterator$concat from "core-js-pure/features/iterator/concat.js"; import _Array$fromAsync from "core-js-pure/features/array/from-async.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); @@ -78,9 +82,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); @@ -109,7 +113,7 @@ new Uint8Array(foo).toHex(); _URL$parse(x); _Math$sumPrecise(x); _Symbol.customMatcher; -_Iterator.concat(a, b); +_Iterator$concat(a, b); new _Map().getOrInsert(a, b); SyntaxError.isError(a); _Array$fromAsync(a); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.40/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.40/output.mjs index 7cf38c05..b5757d06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.40/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.40/output.mjs @@ -23,6 +23,9 @@ 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 from "core-js-pure/stable/iterator/index.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 _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"; @@ -33,6 +36,7 @@ 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/stable/url/parse.js"; 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/features/error/is-error.js"; import _Array$fromAsync from "core-js-pure/features/array/from-async.js"; _findLastInstanceProperty(_context = []).call(_context, fn); @@ -79,9 +83,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); @@ -110,7 +114,7 @@ new Uint8Array(foo).toHex(); _URL$parse(x); _Math$sumPrecise(x); _Symbol.customMatcher; -_Iterator.concat(a, b); +_Iterator$concat(a, b); new _Map().getOrInsert(a, b); _SyntaxError$isError(a); _Array$fromAsync(a); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.41/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.41/output.mjs index 60a9a2da..6b206e15 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.41/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.41/output.mjs @@ -23,6 +23,9 @@ 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 from "core-js-pure/stable/iterator/index.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 _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"; @@ -33,6 +36,7 @@ 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/features/math/sum-precise.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"; _findLastInstanceProperty(_context = []).call(_context, fn); @@ -79,9 +83,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); @@ -110,7 +114,7 @@ new Uint8Array(foo).toHex(); _URL$parse(x); _Math$sumPrecise(x); _Symbol.customMatcher; -_Iterator.concat(a, b); +_Iterator$concat(a, b); new _Map().getOrInsert(a, b); _SyntaxError$isError(a); _Array$fromAsync(a); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.42/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.42/output.mjs index 60a9a2da..6b206e15 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.42/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.42/output.mjs @@ -23,6 +23,9 @@ 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 from "core-js-pure/stable/iterator/index.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 _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"; @@ -33,6 +36,7 @@ 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/features/math/sum-precise.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"; _findLastInstanceProperty(_context = []).call(_context, fn); @@ -79,9 +83,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); @@ -110,7 +114,7 @@ new Uint8Array(foo).toHex(); _URL$parse(x); _Math$sumPrecise(x); _Symbol.customMatcher; -_Iterator.concat(a, b); +_Iterator$concat(a, b); new _Map().getOrInsert(a, b); _SyntaxError$isError(a); _Array$fromAsync(a); 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 fd46bb49..87cfda43 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 @@ -23,6 +23,9 @@ 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/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 _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"; @@ -33,6 +36,7 @@ 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/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"; _findLastInstanceProperty(_context = []).call(_context, fn); @@ -79,9 +83,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); @@ -110,7 +114,7 @@ new Uint8Array(foo).toHex(); _URL$parse(x); _Math$sumPrecise(x); _Symbol.customMatcher; -_Iterator.concat(a, b); +_Iterator$concat(a, b); new _Map().getOrInsert(a, b); _SyntaxError$isError(a); _Array$fromAsync(a); 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 ac5ce686..20fc5634 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 @@ -23,6 +23,9 @@ 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/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 _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"; @@ -33,6 +36,7 @@ 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/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"; _findLastInstanceProperty(_context = []).call(_context, fn); @@ -79,9 +83,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); @@ -110,7 +114,7 @@ new Uint8Array(foo).toHex(); _URL$parse(x); _Math$sumPrecise(x); _Symbol.customMatcher; -_Iterator.concat(a, b); +_Iterator$concat(a, b); new _Map().getOrInsert(a, b); _SyntaxError$isError(a); _Array$fromAsync(a); 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 9de2af3a..909e9c97 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 @@ -23,6 +23,9 @@ 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/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 _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"; @@ -33,6 +36,7 @@ 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/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"; _findLastInstanceProperty(_context = []).call(_context, fn); @@ -79,9 +83,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); @@ -110,7 +114,7 @@ new Uint8Array(foo).toHex(); _URL$parse(x); _Math$sumPrecise(x); _Symbol.customMatcher; -_Iterator.concat(a, b); +_Iterator$concat(a, b); new _Map().getOrInsert(a, b); _SyntaxError$isError(a); _Array$fromAsync(a); 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 9de2af3a..909e9c97 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 @@ -23,6 +23,9 @@ 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/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 _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"; @@ -33,6 +36,7 @@ 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/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"; _findLastInstanceProperty(_context = []).call(_context, fn); @@ -79,9 +83,9 @@ _SuppressedError; _DisposableStack; _AsyncDisposableStack; _Iterator.range(foo, bar); -JSON.parse(foo); -JSON.isRawJSON(foo); -JSON.rawJSON(foo); +_JSON$parse(foo); +_JSON$isRawJSON(foo); +_JSON$rawJSON(foo); _Symbol.isWellKnown(foo); _Symbol.isRegistered(foo); Function.demethodize(); @@ -110,7 +114,7 @@ new Uint8Array(foo).toHex(); _URL$parse(x); _Math$sumPrecise(x); _Symbol.customMatcher; -_Iterator.concat(a, b); +_Iterator$concat(a, b); new _Map().getOrInsert(a, b); _SyntaxError$isError(a); _Array$fromAsync(a); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.47/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.47/input.mjs new file mode 100644 index 00000000..122b5acc --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.47/input.mjs @@ -0,0 +1,120 @@ +[].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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.47/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.47/options.json new file mode 100644 index 00000000..5d840239 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.47/options.json @@ -0,0 +1,12 @@ +{ + "externalHelpers": false, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "method": "usage-pure", + "version": "3.47" + } + ] + ] +} 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 new file mode 100644 index 00000000..674b37ea --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.47/output.mjs @@ -0,0 +1,126 @@ +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"; +_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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.47/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.47/input.mjs new file mode 100644 index 00000000..122b5acc --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.47/input.mjs @@ -0,0 +1,120 @@ +[].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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.47/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.47/options.json new file mode 100644 index 00000000..8621d891 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.47/options.json @@ -0,0 +1,16 @@ +{ + "externalHelpers": false, + "targets": { + "chrome": 90 + }, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "method": "usage-pure", + "version": "3.47", + "proposals": true + } + ] + ] +} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.47/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.47/output.mjs new file mode 100644 index 00000000..cf82b2ba --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.47/output.mjs @@ -0,0 +1,134 @@ +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"; +_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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/built-in-static-methods-proposals/output.js b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/built-in-static-methods-proposals/output.js index 5ca9f715..d11ca14f 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/built-in-static-methods-proposals/output.js +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/built-in-static-methods-proposals/output.js @@ -2,7 +2,6 @@ var _Array$from = require("core-js-pure/features/array/from.js"); var _Array$isArray = require("core-js-pure/features/array/is-array.js"); var _Array$of = require("core-js-pure/features/array/of.js"); var _Date$now = require("core-js-pure/features/date/now.js"); -var _JSON$stringify = require("core-js-pure/features/json/stringify.js"); var _Math$DEG_PER_RAD = require("core-js-pure/features/math/deg-per-rad.js"); var _Math$RAD_PER_DEG = require("core-js-pure/features/math/rad-per-deg.js"); var _Math$acosh = require("core-js-pure/features/math/acosh.js"); @@ -110,7 +109,7 @@ _Array$from; _Array$isArray; _Array$of; _Date$now; -_JSON$stringify; +JSON.stringify; _Math$DEG_PER_RAD; _Math$RAD_PER_DEG; _Math$acosh; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/built-in-static-methods/output.js b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/built-in-static-methods/output.js index 513d173b..eb0738c7 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/built-in-static-methods/output.js +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/built-in-static-methods/output.js @@ -81,6 +81,7 @@ var _Symbol$split = require("core-js-pure/stable/symbol/split.js"); var _Symbol$toPrimitive = require("core-js-pure/stable/symbol/to-primitive.js"); var _Symbol$toStringTag = require("core-js-pure/stable/symbol/to-string-tag.js"); var _Symbol$unscopables = require("core-js-pure/stable/symbol/unscopables.js"); +var _JSON$parse = require("core-js-pure/features/json/parse.js"); var _Map = require("core-js-pure/stable/map/index.js"); var _Map$groupBy = require("core-js-pure/stable/map/group-by.js"); var _Promise = require("core-js-pure/stable/promise/index.js"); @@ -199,7 +200,7 @@ _Symbol$unscopables; Foo.bar; Array.something; Date.something; -JSON.parse; +_JSON$parse; Math.pow; _Symbol.something; _Map.from; diff --git a/yarn.lock b/yarn.lock index d4a36fa8..511efe99 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4542,9 +4542,9 @@ __metadata: "@babel/plugin-transform-modules-commonjs": "npm:^7.27.1" "@babel/plugin-transform-runtime": "npm:^7.27.4" "@babel/plugin-transform-spread": "npm:^7.27.1" - core-js: "npm:^3.46.0" - core-js-compat: "npm:^3.46.0" - core-js-pure: "npm:^3.46.0" + core-js: "npm:^3.47.0" + core-js-compat: "npm:^3.47.0" + core-js-pure: "npm:^3.47.0" peerDependencies: "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 languageName: unknown @@ -4725,12 +4725,12 @@ __metadata: languageName: node linkType: hard -"baseline-browser-mapping@npm:^2.8.9": - version: 2.8.15 - resolution: "baseline-browser-mapping@npm:2.8.15" +"baseline-browser-mapping@npm:^2.8.25": + version: 2.8.30 + resolution: "baseline-browser-mapping@npm:2.8.30" bin: baseline-browser-mapping: dist/cli.js - checksum: 10/06f28e7ace3e42e88f6c07cc24771ea1983af206147ac080ec24c658d0244ab1b84da6adab63182e582ab93710b52b10c475ff7170774e7190cd6279be3f6b9e + checksum: 10/c62a7c9dc3bdf559e6fac3f8065c1cde0b9d8520f742070c4d35862d836c77df894c50cd63e7d55f73e0ce15d27d55f0ec31ddd9bb53ffcdb8751151d8943785 languageName: node linkType: hard @@ -4945,18 +4945,18 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.24.0, browserslist@npm:^4.26.3": - version: 4.26.3 - resolution: "browserslist@npm:4.26.3" +"browserslist@npm:^4.24.0, browserslist@npm:^4.28.0": + version: 4.28.0 + resolution: "browserslist@npm:4.28.0" dependencies: - baseline-browser-mapping: "npm:^2.8.9" - caniuse-lite: "npm:^1.0.30001746" - electron-to-chromium: "npm:^1.5.227" - node-releases: "npm:^2.0.21" - update-browserslist-db: "npm:^1.1.3" + baseline-browser-mapping: "npm:^2.8.25" + caniuse-lite: "npm:^1.0.30001754" + electron-to-chromium: "npm:^1.5.249" + node-releases: "npm:^2.0.27" + update-browserslist-db: "npm:^1.1.4" bin: browserslist: cli.js - checksum: 10/49add06fd753a2514d84c75a7de8d9fb3d70be675e53b72981d87f0c0ff40d8a8cd0bd92f77400381704be0bf1c9c5c65aef95d03843d69475ff55188aa12124 + checksum: 10/59dc88f8d950e44a064361cb874f486e532a8ba932e0cf549aee8b36dd2b791da2bc11f36c1cf820ebb9c1f3250b100f8c56364dd6e86dbc90495af424100e19 languageName: node linkType: hard @@ -5210,10 +5210,10 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30001746": - version: 1.0.30001749 - resolution: "caniuse-lite@npm:1.0.30001749" - checksum: 10/017a9e02f33a870ad2da47245e06ba6eb3e2b339218ebf45b5caa7d7202db562f06a5f5ba62fef5b8864ad89b2370087be49ced336980a8847f45c097d8d734f +"caniuse-lite@npm:^1.0.30001754": + version: 1.0.30001756 + resolution: "caniuse-lite@npm:1.0.30001756" + checksum: 10/1aa412f539bf2f3b9120caa6a3552579914cc9de7bc075212d1196e625dc6243317005a45c6aa7675610e5e23d47418564b7b3e7700244005bd665b01625b0ae languageName: node linkType: hard @@ -5841,26 +5841,26 @@ __metadata: languageName: node linkType: hard -"core-js-compat@npm:^3.40.0, core-js-compat@npm:^3.46.0": - version: 3.46.0 - resolution: "core-js-compat@npm:3.46.0" +"core-js-compat@npm:^3.40.0, core-js-compat@npm:^3.47.0": + version: 3.47.0 + resolution: "core-js-compat@npm:3.47.0" dependencies: - browserslist: "npm:^4.26.3" - checksum: 10/bee0523541d0e646c98dbff5b55bafa2e1674db82f769d851670a364bf4456b2a0364e393a70b09c4263f5dcb1fba3be32ddb4cffab11a79b53efbe32f4b76fb + browserslist: "npm:^4.28.0" + checksum: 10/8555ac0aede2e61e3b37c50d31a9d63bb59e96ef76194bea0521d2778b24d8b20b45bed7bf2fce9df9856872a1c31e03fec1da101507b4dbaba669693dc95f94 languageName: node linkType: hard -"core-js-pure@npm:^3.46.0": - version: 3.46.0 - resolution: "core-js-pure@npm:3.46.0" - checksum: 10/b72b0438c8c7a60ae4b7f9d1bcab7828776a5b4228151d057917d904435ba512794b572b2d2c6371adff2a48c1d2458936712cbdb4eae857375df1a6b17a1d75 +"core-js-pure@npm:^3.47.0": + version: 3.47.0 + resolution: "core-js-pure@npm:3.47.0" + checksum: 10/363b1aedc4949bb765157ae1d59e7ad967391a5288c5b0bfd718c26f788ca358489e49edcde74a8a91095f283463a4fdc85eeaa63ba126444e12b32447144bfb languageName: node linkType: hard -"core-js@npm:^3.46.0": - version: 3.46.0 - resolution: "core-js@npm:3.46.0" - checksum: 10/82993ca487c6cbbf8bbf00e45eeb9705eb63dc2f9c90d7f35696733efbc3f4b52426e1f8dbef0f0b68ea16caa21e4f44cc5490e08120e1cad4a72b031ed8adaa +"core-js@npm:^3.47.0": + version: 3.47.0 + resolution: "core-js@npm:3.47.0" + checksum: 10/c02dc6a091c7e6799e3527dc06a428c44bbcff7f8f6ee700ff818b90aa2ebaf1f17b0234146e692811da97cda5a39a6095ecadec9fd1a74b1135103eb0e96cb1 languageName: node linkType: hard @@ -6461,10 +6461,10 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.5.177, electron-to-chromium@npm:^1.5.227": - version: 1.5.233 - resolution: "electron-to-chromium@npm:1.5.233" - checksum: 10/df166e27705f99a02fc0c6a94c53c3d771939a9de909acd65cbc974ed30ed8301bb08d848cffb9dc8832a194a3e0c99e02d0cb72371f7c7723b9e77c2d0d3867 +"electron-to-chromium@npm:^1.5.177, electron-to-chromium@npm:^1.5.249": + version: 1.5.259 + resolution: "electron-to-chromium@npm:1.5.259" + checksum: 10/259aa8b9c2a82e54c60b2c9af283aa9f618f42aad3c54613fcea61d8e12e4c8f0641d625ba2e6687fe69eda1fc2f3c747e8dafad1c789ac59ac47d4afceeaa23 languageName: node linkType: hard @@ -11509,10 +11509,10 @@ __metadata: languageName: node linkType: hard -"node-releases@npm:^2.0.21": - version: 2.0.23 - resolution: "node-releases@npm:2.0.23" - checksum: 10/f937b23e279b791bc7842d71536e8520ea12efa2c307e5803227ecbba1c807a932bbe3c26d6a8c0e12e21cb3f9c6a6d4ed14beee489ff9e9be49f6d4cf0c7aa4 +"node-releases@npm:^2.0.27": + version: 2.0.27 + resolution: "node-releases@npm:2.0.27" + checksum: 10/f6c78ddb392ae500719644afcbe68a9ea533242c02312eb6a34e8478506eb7482a3fb709c70235b01c32fe65625b68dfa9665113f816d87f163bc3819b62b106 languageName: node linkType: hard @@ -15190,9 +15190,9 @@ __metadata: languageName: node linkType: hard -"update-browserslist-db@npm:^1.1.3": - version: 1.1.3 - resolution: "update-browserslist-db@npm:1.1.3" +"update-browserslist-db@npm:^1.1.4": + version: 1.1.4 + resolution: "update-browserslist-db@npm:1.1.4" dependencies: escalade: "npm:^3.2.0" picocolors: "npm:^1.1.1" @@ -15200,7 +15200,7 @@ __metadata: browserslist: ">= 4.21.0" bin: update-browserslist-db: cli.js - checksum: 10/87af2776054ffb9194cf95e0201547d041f72ee44ce54b144da110e65ea7ca01379367407ba21de5c9edd52c74d95395366790de67f3eb4cc4afa0fe4424e76f + checksum: 10/79b2c0a31e9b837b49dc55d5cb7b77f44a69502847c7be352a44b1d35ac2032bf0e1bb7543f992809ed427bf9d32aa3f7ad41cef96198fa959c1666870174c06 languageName: node linkType: hard