diff --git a/package.json b/package.json index 7cba1c34..1b596e66 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.38.1" + "@babel/preset-env/core-js-compat": "^3.39.0" }, "engines": { "node": ">= 6.9.0", diff --git a/packages/babel-plugin-polyfill-corejs3/package.json b/packages/babel-plugin-polyfill-corejs3/package.json index 51c606d4..be23f8db 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.2", - "core-js-compat": "^3.38.1" + "core-js-compat": "^3.39.0" }, "devDependencies": { "@babel/core": "^7.22.6", @@ -39,8 +39,8 @@ "@babel/plugin-transform-modules-commonjs": "^7.22.5", "@babel/plugin-transform-runtime": "^7.22.15", "@babel/plugin-transform-spread": "^7.22.5", - "core-js": "^3.38.1", - "core-js-pure": "^3.38.1" + "core-js": "^3.39.0", + "core-js-pure": "^3.39.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 eb0969fe..bcb80f76 100644 --- a/packages/babel-plugin-polyfill-corejs3/src/built-in-definitions.ts +++ b/packages/babel-plugin-polyfill-corejs3/src/built-in-definitions.ts @@ -123,6 +123,8 @@ const MapDependencies = [ "esnext.map.filter", "esnext.map.find", "esnext.map.find-key", + "esnext.map.get-or-insert", + "esnext.map.get-or-insert-computed", "esnext.map.includes", "esnext.map.key-of", "esnext.map.map-keys", @@ -166,6 +168,8 @@ const WeakMapDependencies = [ "es.weak-map", "esnext.weak-map.delete-all", "esnext.weak-map.emplace", + "esnext.weak-map.get-or-insert", + "esnext.weak-map.get-or-insert-computed", ...CommonIteratorsWithTag, ]; @@ -207,10 +211,7 @@ const AsyncIteratorProblemMethods = [ "esnext.async-iterator.some", ]; -const IteratorDependencies = [ - "esnext.iterator.constructor", - "es.object.to-string", -]; +const IteratorDependencies = ["es.iterator.constructor", "es.object.to-string"]; export const DecoratorMetadataDependencies = [ "esnext.symbol.metadata", @@ -383,13 +384,19 @@ export const StaticProperties: ObjectMap2 = { }, Iterator: { + concat: define("iterator/concat", [ + "esnext.iterator.concat", + ...IteratorDependencies, + ...CommonIterators, + ]), from: define("iterator/from", [ - "esnext.iterator.from", + "es.iterator.from", ...IteratorDependencies, ...CommonIterators, ]), range: define("iterator/range", [ "esnext.iterator.range", + ...IteratorDependencies, "es.object.to-string", ]), }, @@ -539,7 +546,7 @@ export const StaticProperties: ObjectMap2 = { ...PromiseDependenciesWithIterators, ]), race: define(null, PromiseDependenciesWithIterators), - try: define("promise/try", ["esnext.promise.try", ...PromiseDependencies]), + try: define("promise/try", ["es.promise.try", ...PromiseDependencies]), withResolvers: define("promise/with-resolvers", [ "es.promise.with-resolvers", ...PromiseDependencies, @@ -782,43 +789,39 @@ export const InstanceProperties = { description: define(null, ["es.symbol", "es.symbol.description"]), dotAll: define(null, ["es.regexp.dot-all"]), drop: define(null, [ + "es.iterator.drop", + ...IteratorDependencies, "esnext.async-iterator.drop", ...AsyncIteratorDependencies, - "esnext.iterator.drop", - ...IteratorDependencies, - ]), - emplace: define("instance/emplace", [ - "esnext.map.emplace", - "esnext.weak-map.emplace", ]), endsWith: define("instance/ends-with", ["es.string.ends-with"]), entries: define("instance/entries", ArrayNatureIteratorsWithTag), every: define("instance/every", [ "es.array.every", - "esnext.async-iterator.every", + "es.iterator.every", + ...IteratorDependencies, // TODO: add async iterator dependencies when we support sub-dependencies // esnext.async-iterator.every depends on es.promise // but we don't want to pull es.promise when esnext.async-iterator is disabled // + // "esnext.async-iterator.every", // ...AsyncIteratorDependencies - "esnext.iterator.every", - ...IteratorDependencies, ]), exec: define(null, ["es.regexp.exec"]), fill: define("instance/fill", ["es.array.fill"]), filter: define("instance/filter", [ "es.array.filter", - "esnext.async-iterator.filter", - "esnext.iterator.filter", + "es.iterator.filter", ...IteratorDependencies, + // "esnext.async-iterator.filter", ]), filterReject: define("instance/filterReject", ["esnext.array.filter-reject"]), finally: define(null, ["es.promise.finally", ...PromiseDependencies]), find: define("instance/find", [ "es.array.find", - "esnext.async-iterator.find", - "esnext.iterator.find", + "es.iterator.find", ...IteratorDependencies, + // "esnext.async-iterator.find", ]), findIndex: define("instance/find-index", ["es.array.find-index"]), findLast: define("instance/find-last", ["es.array.find-last"]), @@ -830,9 +833,9 @@ export const InstanceProperties = { flatMap: define("instance/flat-map", [ "es.array.flat-map", "es.array.unscopables.flat-map", - "esnext.async-iterator.flat-map", - "esnext.iterator.flat-map", + "es.iterator.flat-map", ...IteratorDependencies, + // "esnext.async-iterator.flat-map", ]), flat: define("instance/flat", ["es.array.flat", "es.array.unscopables.flat"]), getFloat16: define(null, [ @@ -860,9 +863,9 @@ export const InstanceProperties = { fontsize: define(null, ["es.string.fontsize"]), forEach: define("instance/for-each", [ "es.array.for-each", - "esnext.async-iterator.for-each", - "esnext.iterator.for-each", + "es.iterator.for-each", ...IteratorDependencies, + // "esnext.async-iterator.for-each", "web.dom-collections.for-each", ]), includes: define("instance/includes", [ @@ -886,8 +889,9 @@ export const InstanceProperties = { link: define(null, ["es.string.link"]), map: define("instance/map", [ "es.array.map", - "esnext.async-iterator.map", - "esnext.iterator.map", + "es.iterator.map", + ...IteratorDependencies, + // "esnext.async-iterator.map", ]), match: define(null, ["es.string.match", "es.regexp.exec"]), matchAll: define("instance/match-all", [ @@ -900,9 +904,9 @@ export const InstanceProperties = { push: define("instance/push", ["es.array.push"]), reduce: define("instance/reduce", [ "es.array.reduce", - "esnext.async-iterator.reduce", - "esnext.iterator.reduce", + "es.iterator.reduce", ...IteratorDependencies, + // "esnext.async-iterator.reduce", ]), reduceRight: define("instance/reduce-right", ["es.array.reduce-right"]), repeat: define("instance/repeat", ["es.string.repeat"]), @@ -927,9 +931,9 @@ export const InstanceProperties = { small: define(null, ["es.string.small"]), some: define("instance/some", [ "es.array.some", - "esnext.async-iterator.some", - "esnext.iterator.some", + "es.iterator.some", ...IteratorDependencies, + // "esnext.async-iterator.some", ]), sort: define("instance/sort", ["es.array.sort"]), splice: define("instance/splice", ["es.array.splice"]), @@ -941,17 +945,17 @@ export const InstanceProperties = { substr: define(null, ["es.string.substr"]), sup: define(null, ["es.string.sup"]), take: define(null, [ + "es.iterator.take", + ...IteratorDependencies, "esnext.async-iterator.take", ...AsyncIteratorDependencies, - "esnext.iterator.take", - ...IteratorDependencies, ]), test: define(null, ["es.regexp.test", "es.regexp.exec"]), toArray: define(null, [ + "es.iterator.to-array", + ...IteratorDependencies, "esnext.async-iterator.to-array", ...AsyncIteratorDependencies, - "esnext.iterator.to-array", - ...IteratorDependencies, ]), toAsync: define(null, [ "esnext.iterator.to-async", diff --git a/packages/babel-plugin-polyfill-corejs3/src/shipped-proposals.ts b/packages/babel-plugin-polyfill-corejs3/src/shipped-proposals.ts index aa9b22c2..d191a660 100644 --- a/packages/babel-plugin-polyfill-corejs3/src/shipped-proposals.ts +++ b/packages/babel-plugin-polyfill-corejs3/src/shipped-proposals.ts @@ -7,24 +7,10 @@ export default new Set([ "esnext.array.group-to-map", "esnext.data-view.get-float16", "esnext.data-view.set-float16", - "esnext.iterator.constructor", - "esnext.iterator.drop", - "esnext.iterator.every", - "esnext.iterator.filter", - "esnext.iterator.find", - "esnext.iterator.flat-map", - "esnext.iterator.for-each", - "esnext.iterator.from", - "esnext.iterator.map", - "esnext.iterator.reduce", - "esnext.iterator.some", - "esnext.iterator.take", - "esnext.iterator.to-array", "esnext.json.is-raw-json", "esnext.json.parse", "esnext.json.raw-json", "esnext.math.f16round", - "esnext.promise.try", "esnext.regexp.escape", "esnext.symbol.async-dispose", "esnext.symbol.dispose", 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 67def893..c7c8c084 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 @@ -66,6 +66,7 @@ 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.promise.try.js"; import "core-js/modules/esnext.regexp.escape.js"; import "core-js/modules/esnext.symbol.async-dispose.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 dbc5f3d7..8b233f70 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 @@ -66,6 +66,7 @@ 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.promise.try.js"; import "core-js/modules/esnext.regexp.escape.js"; import "core-js/modules/esnext.symbol.async-dispose.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.39/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.39/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.39/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.39/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.39/options.json new file mode 100644 index 00000000..85b0f316 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.39/options.json @@ -0,0 +1,14 @@ +{ + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "version": "3.39", + "method": "entry-global", + "targets": { + "chrome": 107 + } + } + ] + ] +} 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 new file mode 100644 index 00000000..b79ea88c --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-chrome-107-corejs-3.39/output.mjs @@ -0,0 +1,89 @@ +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.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.iterator.constructor.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.map.group-by.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.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/esnext.suppressed-error.constructor.js"; +import "core-js/modules/esnext.array.from-async.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-disposable-stack.constructor.js"; +import "core-js/modules/esnext.async-iterator.constructor.js"; +import "core-js/modules/esnext.async-iterator.async-dispose.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.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.function.metadata.js"; +import "core-js/modules/esnext.iterator.dispose.js"; +import "core-js/modules/esnext.iterator.to-async.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"; +import "core-js/modules/esnext.symbol.async-dispose.js"; +import "core-js/modules/esnext.symbol.dispose.js"; +import "core-js/modules/esnext.symbol.metadata.js"; +import "core-js/modules/esnext.typed-array.to-spliced.js"; +import "core-js/modules/esnext.uint8-array.from-base64.js"; +import "core-js/modules/esnext.uint8-array.from-hex.js"; +import "core-js/modules/esnext.uint8-array.set-from-base64.js"; +import "core-js/modules/esnext.uint8-array.set-from-hex.js"; +import "core-js/modules/esnext.uint8-array.to-base64.js"; +import "core-js/modules/esnext.uint8-array.to-hex.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.37/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.37/output.mjs index 06478ba4..f0a30516 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.37/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.37/output.mjs @@ -297,6 +297,7 @@ 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.promise.try.js"; import "core-js/modules/esnext.regexp.escape.js"; import "core-js/modules/esnext.symbol.async-dispose.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.38/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.38/output.mjs index b054b72e..8852b194 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.38/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.38/output.mjs @@ -297,6 +297,7 @@ 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.promise.try.js"; import "core-js/modules/esnext.regexp.escape.js"; import "core-js/modules/esnext.symbol.async-dispose.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.39/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.39/input.mjs new file mode 100644 index 00000000..a3a9078c --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.39/input.mjs @@ -0,0 +1 @@ +import 'core-js/actual'; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.39/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.39/options.json new file mode 100644 index 00000000..e8b1886f --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.39/options.json @@ -0,0 +1,11 @@ +{ + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "version": "3.39", + "method": "entry-global" + } + ] + ] +} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.39/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.39/output.mjs new file mode 100644 index 00000000..39ccfe44 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/actual-corejs-3.39/output.mjs @@ -0,0 +1,332 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.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.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.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.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.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.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.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.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.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.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.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.unescape.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/es.weak-set.js"; +import "core-js/modules/esnext.suppressed-error.constructor.js"; +import "core-js/modules/esnext.array.from-async.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-disposable-stack.constructor.js"; +import "core-js/modules/esnext.async-iterator.constructor.js"; +import "core-js/modules/esnext.async-iterator.async-dispose.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.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.function.metadata.js"; +import "core-js/modules/esnext.iterator.dispose.js"; +import "core-js/modules/esnext.iterator.to-async.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"; +import "core-js/modules/esnext.symbol.async-dispose.js"; +import "core-js/modules/esnext.symbol.dispose.js"; +import "core-js/modules/esnext.symbol.metadata.js"; +import "core-js/modules/esnext.typed-array.to-spliced.js"; +import "core-js/modules/esnext.uint8-array.from-base64.js"; +import "core-js/modules/esnext.uint8-array.from-hex.js"; +import "core-js/modules/esnext.uint8-array.set-from-base64.js"; +import "core-js/modules/esnext.uint8-array.set-from-hex.js"; +import "core-js/modules/esnext.uint8-array.to-base64.js"; +import "core-js/modules/esnext.uint8-array.to-hex.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.39/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.39/input.mjs new file mode 100644 index 00000000..66bfb4d1 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.39/input.mjs @@ -0,0 +1 @@ +import 'core-js'; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.39/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.39/options.json new file mode 100644 index 00000000..e8b1886f --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.39/options.json @@ -0,0 +1,11 @@ +{ + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "version": "3.39", + "method": "entry-global" + } + ] + ] +} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.39/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.39/output.mjs new file mode 100644 index 00000000..c4fe4f2d --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/all-corejs-3.39/output.mjs @@ -0,0 +1,450 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.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.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.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.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.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.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.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.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.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.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.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.unescape.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/es.weak-set.js"; +import "core-js/modules/esnext.suppressed-error.constructor.js"; +import "core-js/modules/esnext.array.from-async.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-disposable-stack.constructor.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.async-dispose.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-float16.js"; +import "core-js/modules/esnext.data-view.get-uint8-clamped.js"; +import "core-js/modules/esnext.data-view.set-float16.js"; +import "core-js/modules/esnext.data-view.set-uint8-clamped.js"; +import "core-js/modules/esnext.disposable-stack.constructor.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.concat.js"; +import "core-js/modules/esnext.iterator.dispose.js"; +import "core-js/modules/esnext.iterator.indexed.js"; +import "core-js/modules/esnext.iterator.range.js"; +import "core-js/modules/esnext.iterator.to-async.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.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.f16round.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.sum-precise.js"; +import "core-js/modules/esnext.math.umulh.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.regexp.escape.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.async-dispose.js"; +import "core-js/modules/esnext.symbol.custom-matcher.js"; +import "core-js/modules/esnext.symbol.dispose.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.uint8-array.from-base64.js"; +import "core-js/modules/esnext.uint8-array.from-hex.js"; +import "core-js/modules/esnext.uint8-array.set-from-base64.js"; +import "core-js/modules/esnext.uint8-array.set-from-hex.js"; +import "core-js/modules/esnext.uint8-array.to-base64.js"; +import "core-js/modules/esnext.uint8-array.to-hex.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.21/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.21/output.mjs index db251beb..b833e0ca 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.21/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.21/output.mjs @@ -16,6 +16,7 @@ import "core-js/modules/es.set.js"; import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.string.match.js"; import "core-js/modules/esnext.array.with.js"; +import "core-js/modules/esnext.iterator.constructor.js"; import "core-js/modules/web.btoa.js"; import "core-js/modules/web.dom-collections.iterator.js"; import "core-js/modules/web.dom-exception.constructor.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.25/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.25/input.mjs index 53ffff6e..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.25/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.25/input.mjs @@ -62,3 +62,46 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.25/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.25/output.mjs index 3c4646fb..871f854e 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.25/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.25/output.mjs @@ -1,3 +1,4 @@ +import "core-js/modules/es.symbol.js"; import "core-js/modules/es.symbol.match-all.js"; import "core-js/modules/es.error.cause.js"; import "core-js/modules/es.error.to-string.js"; @@ -8,7 +9,12 @@ 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-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.map.js"; +import "core-js/modules/es.object.create.js"; +import "core-js/modules/es.object.freeze.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"; @@ -22,8 +28,47 @@ 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.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-string.js"; import "core-js/modules/es.weak-map.js"; import "core-js/modules/esnext.array.with.js"; +import "core-js/modules/esnext.iterator.constructor.js"; +import "core-js/modules/esnext.iterator.drop.js"; +import "core-js/modules/esnext.iterator.filter.js"; +import "core-js/modules/esnext.iterator.for-each.js"; +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.map.group-by.js"; +import "core-js/modules/esnext.typed-array.to-reversed.js"; +import "core-js/modules/esnext.typed-array.to-sorted.js"; +import "core-js/modules/esnext.typed-array.with.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"; @@ -77,3 +122,37 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.27/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.27/input.mjs index 8d0c11ae..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.27/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.27/input.mjs @@ -70,3 +70,38 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.27/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.27/output.mjs index b3de176d..9b336751 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.27/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.27/output.mjs @@ -9,6 +9,9 @@ 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-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.map.js"; import "core-js/modules/es.object.create.js"; import "core-js/modules/es.object.freeze.js"; @@ -25,10 +28,56 @@ 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.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-string.js"; import "core-js/modules/es.weak-map.js"; import "core-js/modules/esnext.array.with.js"; +import "core-js/modules/esnext.iterator.constructor.js"; +import "core-js/modules/esnext.iterator.drop.js"; +import "core-js/modules/esnext.iterator.filter.js"; +import "core-js/modules/esnext.iterator.for-each.js"; +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.map.group-by.js"; +import "core-js/modules/esnext.set.difference.v2.js"; +import "core-js/modules/esnext.set.intersection.v2.js"; +import "core-js/modules/esnext.set.is-disjoint-from.v2.js"; +import "core-js/modules/esnext.set.is-subset-of.v2.js"; +import "core-js/modules/esnext.set.is-superset-of.v2.js"; +import "core-js/modules/esnext.set.symmetric-difference.v2.js"; +import "core-js/modules/esnext.set.union.v2.js"; import "core-js/modules/esnext.string.is-well-formed.js"; import "core-js/modules/esnext.string.to-well-formed.js"; +import "core-js/modules/esnext.typed-array.to-reversed.js"; +import "core-js/modules/esnext.typed-array.to-sorted.js"; +import "core-js/modules/esnext.typed-array.with.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"; @@ -90,3 +139,30 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.28/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.28/input.mjs index 2887abcc..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.28/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.28/input.mjs @@ -73,3 +73,35 @@ 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); 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 a42605c2..bf4c5ace 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 @@ -10,6 +10,9 @@ 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.map.js"; import "core-js/modules/es.object.create.js"; import "core-js/modules/es.object.freeze.js"; @@ -26,7 +29,49 @@ 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.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.weak-map.js"; +import "core-js/modules/esnext.array-buffer.detached.js"; +import "core-js/modules/esnext.array-buffer.transfer.js"; +import "core-js/modules/esnext.array-buffer.transfer-to-fixed-length.js"; +import "core-js/modules/esnext.iterator.constructor.js"; +import "core-js/modules/esnext.iterator.drop.js"; +import "core-js/modules/esnext.iterator.filter.js"; +import "core-js/modules/esnext.iterator.for-each.js"; +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.map.group-by.js"; import "core-js/modules/esnext.set.difference.v2.js"; import "core-js/modules/esnext.set.intersection.v2.js"; import "core-js/modules/esnext.set.is-disjoint-from.v2.js"; @@ -99,3 +144,28 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.29/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.29/input.mjs index a038340a..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.29/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.29/input.mjs @@ -75,3 +75,33 @@ 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); 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 5ad34ce7..bac1f3fc 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 @@ -10,6 +10,9 @@ 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.map.js"; import "core-js/modules/es.object.create.js"; import "core-js/modules/es.object.freeze.js"; @@ -26,7 +29,49 @@ 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.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.weak-map.js"; +import "core-js/modules/esnext.array-buffer.detached.js"; +import "core-js/modules/esnext.array-buffer.transfer.js"; +import "core-js/modules/esnext.array-buffer.transfer-to-fixed-length.js"; +import "core-js/modules/esnext.iterator.constructor.js"; +import "core-js/modules/esnext.iterator.drop.js"; +import "core-js/modules/esnext.iterator.filter.js"; +import "core-js/modules/esnext.iterator.for-each.js"; +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.map.group-by.js"; import "core-js/modules/esnext.set.difference.v2.js"; import "core-js/modules/esnext.set.intersection.v2.js"; import "core-js/modules/esnext.set.is-disjoint-from.v2.js"; @@ -101,3 +146,27 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.30/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.30/input.mjs index b1df2e6c..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.30/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.30/input.mjs @@ -83,3 +83,25 @@ 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); 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 d99ddae3..48f08dbc 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 @@ -10,6 +10,9 @@ 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.map.js"; import "core-js/modules/es.object.create.js"; import "core-js/modules/es.object.freeze.js"; @@ -26,7 +29,48 @@ 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.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.weak-map.js"; +import "core-js/modules/esnext.array-buffer.detached.js"; +import "core-js/modules/esnext.array-buffer.transfer.js"; +import "core-js/modules/esnext.array-buffer.transfer-to-fixed-length.js"; +import "core-js/modules/esnext.iterator.constructor.js"; +import "core-js/modules/esnext.iterator.drop.js"; +import "core-js/modules/esnext.iterator.filter.js"; +import "core-js/modules/esnext.iterator.for-each.js"; +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.map.group-by.js"; import "core-js/modules/esnext.set.difference.v2.js"; import "core-js/modules/esnext.set.intersection.v2.js"; @@ -110,3 +154,20 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.31/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.31/input.mjs index 7907f1d0..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.31/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.31/input.mjs @@ -89,3 +89,19 @@ 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); 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 dc62640c..1153e17f 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 @@ -31,10 +31,48 @@ 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.weak-map.js"; import "core-js/modules/esnext.array-buffer.detached.js"; import "core-js/modules/esnext.array-buffer.transfer.js"; import "core-js/modules/esnext.array-buffer.transfer-to-fixed-length.js"; +import "core-js/modules/esnext.iterator.constructor.js"; +import "core-js/modules/esnext.iterator.drop.js"; +import "core-js/modules/esnext.iterator.filter.js"; +import "core-js/modules/esnext.iterator.for-each.js"; +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.map.group-by.js"; import "core-js/modules/esnext.object.group-by.js"; import "core-js/modules/esnext.promise.with-resolvers.js"; @@ -125,3 +163,15 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.32/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.32/input.mjs index 3e6cdc0d..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.32/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.32/input.mjs @@ -91,3 +91,17 @@ 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); 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 b8d14ab0..1153e17f 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 @@ -31,10 +31,48 @@ 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.weak-map.js"; import "core-js/modules/esnext.array-buffer.detached.js"; import "core-js/modules/esnext.array-buffer.transfer.js"; import "core-js/modules/esnext.array-buffer.transfer-to-fixed-length.js"; +import "core-js/modules/esnext.iterator.constructor.js"; +import "core-js/modules/esnext.iterator.drop.js"; +import "core-js/modules/esnext.iterator.filter.js"; +import "core-js/modules/esnext.iterator.for-each.js"; +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.map.group-by.js"; import "core-js/modules/esnext.object.group-by.js"; import "core-js/modules/esnext.promise.with-resolvers.js"; @@ -126,3 +164,14 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.33/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.33/input.mjs index 6e850d76..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.33/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.33/input.mjs @@ -94,5 +94,14 @@ 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); 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 fbb71ed3..1153e17f 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 @@ -65,6 +65,14 @@ import "core-js/modules/es.weak-map.js"; import "core-js/modules/esnext.array-buffer.detached.js"; import "core-js/modules/esnext.array-buffer.transfer.js"; import "core-js/modules/esnext.array-buffer.transfer-to-fixed-length.js"; +import "core-js/modules/esnext.iterator.constructor.js"; +import "core-js/modules/esnext.iterator.drop.js"; +import "core-js/modules/esnext.iterator.filter.js"; +import "core-js/modules/esnext.iterator.for-each.js"; +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.map.group-by.js"; import "core-js/modules/esnext.object.group-by.js"; import "core-js/modules/esnext.promise.with-resolvers.js"; @@ -158,5 +166,12 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.34/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.34/input.mjs index 6e850d76..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.34/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.34/input.mjs @@ -94,5 +94,14 @@ 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); 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 1bfd49b7..c61da9ed 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 @@ -68,6 +68,14 @@ import "core-js/modules/es.weak-map.js"; import "core-js/modules/esnext.array-buffer.detached.js"; import "core-js/modules/esnext.array-buffer.transfer.js"; import "core-js/modules/esnext.array-buffer.transfer-to-fixed-length.js"; +import "core-js/modules/esnext.iterator.constructor.js"; +import "core-js/modules/esnext.iterator.drop.js"; +import "core-js/modules/esnext.iterator.filter.js"; +import "core-js/modules/esnext.iterator.for-each.js"; +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.set.difference.v2.js"; import "core-js/modules/esnext.set.intersection.v2.js"; import "core-js/modules/esnext.set.is-disjoint-from.v2.js"; @@ -158,5 +166,12 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.36/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.36/input.mjs index 552fa8de..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.36/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.36/input.mjs @@ -94,9 +94,14 @@ 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); 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 4a841161..12387712 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 @@ -68,6 +68,14 @@ 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.constructor.js"; +import "core-js/modules/esnext.iterator.drop.js"; +import "core-js/modules/esnext.iterator.filter.js"; +import "core-js/modules/esnext.iterator.for-each.js"; +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.set.difference.v2.js"; import "core-js/modules/esnext.set.intersection.v2.js"; import "core-js/modules/esnext.set.is-disjoint-from.v2.js"; @@ -158,8 +166,12 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.37/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.37/input.mjs index 6e9eec45..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.37/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.37/input.mjs @@ -102,3 +102,6 @@ new Uint8Array(foo).toHex(); URL.parse(x); Math.sumPrecise(x); Symbol.customMatcher; + +Iterator.concat(a, b); +new Map().getOrInsert(a, b); 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 3d55e09e..f2e33feb 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 @@ -75,6 +75,14 @@ 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.constructor.js"; +import "core-js/modules/esnext.iterator.drop.js"; +import "core-js/modules/esnext.iterator.filter.js"; +import "core-js/modules/esnext.iterator.for-each.js"; +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/web.btoa.js"; import "core-js/modules/web.dom-collections.for-each.js"; import "core-js/modules/web.dom-collections.iterator.js"; @@ -166,3 +174,5 @@ new Uint8Array(foo).toHex(); URL.parse(x); Math.sumPrecise(x); Symbol.customMatcher; +Iterator.concat(a, b); +new Map().getOrInsert(a, b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.38/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.38/input.mjs index 6e9eec45..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.38/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.38/input.mjs @@ -102,3 +102,6 @@ new Uint8Array(foo).toHex(); URL.parse(x); Math.sumPrecise(x); Symbol.customMatcher; + +Iterator.concat(a, b); +new Map().getOrInsert(a, b); 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 3d55e09e..f2e33feb 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 @@ -75,6 +75,14 @@ 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.constructor.js"; +import "core-js/modules/esnext.iterator.drop.js"; +import "core-js/modules/esnext.iterator.filter.js"; +import "core-js/modules/esnext.iterator.for-each.js"; +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/web.btoa.js"; import "core-js/modules/web.dom-collections.for-each.js"; import "core-js/modules/web.dom-collections.iterator.js"; @@ -166,3 +174,5 @@ new Uint8Array(foo).toHex(); URL.parse(x); Math.sumPrecise(x); Symbol.customMatcher; +Iterator.concat(a, b); +new Map().getOrInsert(a, b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.39/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.39/input.mjs new file mode 100644 index 00000000..2be97b06 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.39/input.mjs @@ -0,0 +1,107 @@ +[].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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.39/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.39/options.json new file mode 100644 index 00000000..b007e9cf --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.39/options.json @@ -0,0 +1,11 @@ +{ + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "version": "3.39", + "method": "usage-global" + } + ] + ] +} 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 new file mode 100644 index 00000000..64b3f9b2 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-corejs-3.39/output.mjs @@ -0,0 +1,178 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.match-all.js"; +import "core-js/modules/es.error.cause.js"; +import "core-js/modules/es.error.to-string.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.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.iterator.constructor.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.map.js"; +import "core-js/modules/es.map.group-by.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.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.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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.27/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.27/input.mjs index 8d0c11ae..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.27/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.27/input.mjs @@ -70,3 +70,38 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.27/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.27/output.mjs index 224ca377..308430f7 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.27/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.27/output.mjs @@ -41,6 +41,7 @@ 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.group-by.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"; @@ -50,13 +51,42 @@ 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.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.v2.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.v2.js"; +import "core-js/modules/esnext.set.intersection.js"; +import "core-js/modules/esnext.set.is-disjoint-from.v2.js"; +import "core-js/modules/esnext.set.is-disjoint-from.js"; +import "core-js/modules/esnext.set.is-subset-of.v2.js"; +import "core-js/modules/esnext.set.is-subset-of.js"; +import "core-js/modules/esnext.set.is-superset-of.v2.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.v2.js"; +import "core-js/modules/esnext.set.symmetric-difference.js"; +import "core-js/modules/esnext.set.union.v2.js"; +import "core-js/modules/esnext.set.union.js"; import "core-js/modules/esnext.string.dedent.js"; import "core-js/modules/esnext.string.is-well-formed.js"; import "core-js/modules/esnext.string.to-well-formed.js"; import "core-js/modules/esnext.symbol.async-dispose.js"; import "core-js/modules/esnext.symbol.matcher.js"; import "core-js/modules/esnext.symbol.metadata.js"; -import "core-js/modules/esnext.weak-map.emplace.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-reversed.js"; +import "core-js/modules/esnext.typed-array.to-sorted.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.typed-array.with.js"; import "core-js/modules/web.dom-exception.stack.js"; import "core-js/modules/web.structured-clone.js"; [].findLast(fn); @@ -109,3 +139,30 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.28/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.28/input.mjs index 2887abcc..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.28/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.28/input.mjs @@ -73,3 +73,35 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.28/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.28/output.mjs index ecb768f4..3d8fdf8f 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.28/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.28/output.mjs @@ -1,10 +1,16 @@ import "core-js/modules/es.array.push.js"; import "core-js/modules/es.array.with.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/esnext.suppressed-error.constructor.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.array-buffer.detached.js"; +import "core-js/modules/esnext.array-buffer.transfer.js"; +import "core-js/modules/esnext.array-buffer.transfer-to-fixed-length.js"; import "core-js/modules/esnext.async-disposable-stack.constructor.js"; import "core-js/modules/esnext.async-iterator.constructor.js"; import "core-js/modules/esnext.async-iterator.async-dispose.js"; @@ -46,6 +52,7 @@ 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.group-by.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"; @@ -86,7 +93,10 @@ import "core-js/modules/esnext.symbol.is-registered.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.weak-map.emplace.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"; [].findLast(fn); @@ -141,3 +151,28 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.29/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.29/input.mjs index a038340a..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.29/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.29/input.mjs @@ -75,3 +75,33 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.29/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.29/output.mjs index 1118c312..a4e18a4b 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.29/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.29/output.mjs @@ -1,10 +1,16 @@ import "core-js/modules/es.array.push.js"; import "core-js/modules/es.array.with.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/esnext.suppressed-error.constructor.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.array-buffer.detached.js"; +import "core-js/modules/esnext.array-buffer.transfer.js"; +import "core-js/modules/esnext.array-buffer.transfer-to-fixed-length.js"; import "core-js/modules/esnext.async-disposable-stack.constructor.js"; import "core-js/modules/esnext.async-iterator.constructor.js"; import "core-js/modules/esnext.async-iterator.async-dispose.js"; @@ -46,6 +52,7 @@ 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.group-by.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"; @@ -86,7 +93,10 @@ import "core-js/modules/esnext.symbol.is-registered.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.weak-map.emplace.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-search-params.size.js"; @@ -143,3 +153,27 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.30/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.30/input.mjs index b1df2e6c..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.30/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.30/input.mjs @@ -83,3 +83,25 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.30/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.30/output.mjs index 04b3f8ec..a8dedf44 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.30/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.30/output.mjs @@ -1,10 +1,16 @@ import "core-js/modules/es.array.push.js"; import "core-js/modules/es.array.with.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/esnext.suppressed-error.constructor.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.array-buffer.detached.js"; +import "core-js/modules/esnext.array-buffer.transfer.js"; +import "core-js/modules/esnext.array-buffer.transfer-to-fixed-length.js"; import "core-js/modules/esnext.async-disposable-stack.constructor.js"; import "core-js/modules/esnext.async-iterator.constructor.js"; import "core-js/modules/esnext.async-iterator.async-dispose.js"; @@ -87,7 +93,10 @@ import "core-js/modules/esnext.symbol.is-registered.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.weak-map.emplace.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"; @@ -152,3 +161,20 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.31/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.31/input.mjs index 7907f1d0..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.31/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.31/input.mjs @@ -89,3 +89,19 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.31/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.31/output.mjs index 2012e5aa..f05d7722 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.31/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.31/output.mjs @@ -2,6 +2,9 @@ import "core-js/modules/es.array.push.js"; import "core-js/modules/es.array.with.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/esnext.suppressed-error.constructor.js"; import "core-js/modules/esnext.array.group-by.js"; import "core-js/modules/esnext.array.group-by-to-map.js"; @@ -95,7 +98,10 @@ 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.weak-map.emplace.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"; @@ -167,3 +173,15 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.32/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.32/input.mjs index 3e6cdc0d..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.32/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.32/input.mjs @@ -91,3 +91,17 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.32/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.32/output.mjs index bd3b12ac..7828054f 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.32/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.32/output.mjs @@ -2,6 +2,9 @@ import "core-js/modules/es.array.push.js"; import "core-js/modules/es.array.with.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/esnext.suppressed-error.constructor.js"; import "core-js/modules/esnext.array.group-by.js"; import "core-js/modules/esnext.array.group-by-to-map.js"; @@ -100,7 +103,10 @@ 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.weak-map.emplace.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"; @@ -173,3 +179,14 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.33/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.33/input.mjs index 6e850d76..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.33/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.33/input.mjs @@ -94,5 +94,14 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.33/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.33/output.mjs index f89c75da..e45dc130 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.33/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.33/output.mjs @@ -108,7 +108,6 @@ 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.emplace.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"; @@ -183,5 +182,12 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.34/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.34/input.mjs index 6e850d76..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.34/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.34/input.mjs @@ -94,5 +94,14 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.34/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.34/output.mjs index b6bbf7c5..ea342021 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.34/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.34/output.mjs @@ -112,7 +112,6 @@ import "core-js/modules/esnext.uint8-array.from-base64.js"; import "core-js/modules/esnext.uint8-array.from-hex.js"; import "core-js/modules/esnext.uint8-array.to-base64.js"; import "core-js/modules/esnext.uint8-array.to-hex.js"; -import "core-js/modules/esnext.weak-map.emplace.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"; @@ -187,5 +186,12 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.36/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.36/input.mjs index 552fa8de..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.36/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.36/input.mjs @@ -94,9 +94,14 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.36/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.36/output.mjs index 81adafca..d6eb6e04 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.36/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.36/output.mjs @@ -112,7 +112,6 @@ import "core-js/modules/esnext.uint8-array.from-base64.js"; import "core-js/modules/esnext.uint8-array.from-hex.js"; import "core-js/modules/esnext.uint8-array.to-base64.js"; import "core-js/modules/esnext.uint8-array.to-hex.js"; -import "core-js/modules/esnext.weak-map.emplace.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"; @@ -187,8 +186,12 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.37/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.37/input.mjs index 6e9eec45..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.37/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.37/input.mjs @@ -102,3 +102,6 @@ new Uint8Array(foo).toHex(); URL.parse(x); Math.sumPrecise(x); Symbol.customMatcher; + +Iterator.concat(a, b); +new Map().getOrInsert(a, b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.37/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.37/output.mjs index 5efab7b9..d8256a28 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.37/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.37/output.mjs @@ -114,7 +114,6 @@ import "core-js/modules/esnext.uint8-array.from-base64.js"; import "core-js/modules/esnext.uint8-array.from-hex.js"; import "core-js/modules/esnext.uint8-array.to-base64.js"; import "core-js/modules/esnext.uint8-array.to-hex.js"; -import "core-js/modules/esnext.weak-map.emplace.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"; @@ -197,3 +196,5 @@ new Uint8Array(foo).toHex(); URL.parse(x); Math.sumPrecise(x); Symbol.customMatcher; +Iterator.concat(a, b); +new Map().getOrInsert(a, b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.38/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.38/input.mjs index 6e9eec45..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.38/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.38/input.mjs @@ -102,3 +102,6 @@ new Uint8Array(foo).toHex(); URL.parse(x); Math.sumPrecise(x); Symbol.customMatcher; + +Iterator.concat(a, b); +new Map().getOrInsert(a, b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.38/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.38/output.mjs index 0b561885..6dd5bb63 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.38/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.38/output.mjs @@ -116,7 +116,6 @@ import "core-js/modules/esnext.uint8-array.set-from-base64.js"; import "core-js/modules/esnext.uint8-array.set-from-hex.js"; import "core-js/modules/esnext.uint8-array.to-base64.js"; import "core-js/modules/esnext.uint8-array.to-hex.js"; -import "core-js/modules/esnext.weak-map.emplace.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"; @@ -199,3 +198,5 @@ new Uint8Array(foo).toHex(); URL.parse(x); Math.sumPrecise(x); Symbol.customMatcher; +Iterator.concat(a, b); +new Map().getOrInsert(a, b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.39/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.39/input.mjs new file mode 100644 index 00000000..2be97b06 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.39/input.mjs @@ -0,0 +1,107 @@ +[].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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.39/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.39/options.json new file mode 100644 index 00000000..c75f06d6 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.39/options.json @@ -0,0 +1,15 @@ +{ + "targets": { + "chrome": 107 + }, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "method": "usage-global", + "version": "3.39", + "proposals": true + } + ] + ] +} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.39/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.39/output.mjs new file mode 100644 index 00000000..6eaceeec --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-107-corejs-3.39/output.mjs @@ -0,0 +1,205 @@ +import "core-js/modules/es.array.push.js"; +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.iterator.constructor.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.map.group-by.js"; +import "core-js/modules/es.object.group-by.js"; +import "core-js/modules/es.promise.with-resolvers.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/esnext.suppressed-error.constructor.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-disposable-stack.constructor.js"; +import "core-js/modules/esnext.async-iterator.constructor.js"; +import "core-js/modules/esnext.async-iterator.async-dispose.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-float16.js"; +import "core-js/modules/esnext.data-view.get-uint8-clamped.js"; +import "core-js/modules/esnext.data-view.set-float16.js"; +import "core-js/modules/esnext.data-view.set-uint8-clamped.js"; +import "core-js/modules/esnext.disposable-stack.constructor.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.concat.js"; +import "core-js/modules/esnext.iterator.dispose.js"; +import "core-js/modules/esnext.iterator.indexed.js"; +import "core-js/modules/esnext.iterator.range.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.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.math.f16round.js"; +import "core-js/modules/esnext.math.sum-precise.js"; +import "core-js/modules/esnext.number.range.js"; +import "core-js/modules/esnext.regexp.escape.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.async-dispose.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/esnext.uint8-array.from-base64.js"; +import "core-js/modules/esnext.uint8-array.from-hex.js"; +import "core-js/modules/esnext.uint8-array.set-from-base64.js"; +import "core-js/modules/esnext.uint8-array.set-from-hex.js"; +import "core-js/modules/esnext.uint8-array.to-base64.js"; +import "core-js/modules/esnext.uint8-array.to-hex.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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-90-corejs-3.16/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-90-corejs-3.16/output.mjs index a75b2aa4..5448728c 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-90-corejs-3.16/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-90-corejs-3.16/output.mjs @@ -43,7 +43,6 @@ import "core-js/modules/esnext.number.range.js"; import "core-js/modules/esnext.symbol.async-dispose.js"; import "core-js/modules/esnext.symbol.matcher.js"; import "core-js/modules/esnext.symbol.metadata.js"; -import "core-js/modules/esnext.weak-map.emplace.js"; [].findLast(fn); [].findLastIndex(fn); [].asIndexedPairs(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-90-corejs-3.24/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-90-corejs-3.24/output.mjs index 867b4345..4fcdaae7 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-90-corejs-3.24/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-chrome-90-corejs-3.24/output.mjs @@ -51,7 +51,6 @@ import "core-js/modules/esnext.number.range.js"; import "core-js/modules/esnext.symbol.async-dispose.js"; import "core-js/modules/esnext.symbol.matcher.js"; import "core-js/modules/esnext.symbol.metadata.js"; -import "core-js/modules/esnext.weak-map.emplace.js"; import "core-js/modules/web.dom-exception.stack.js"; import "core-js/modules/web.structured-clone.js"; [].findLast(fn); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.39/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.39/input.mjs new file mode 100644 index 00000000..2be97b06 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.39/input.mjs @@ -0,0 +1,107 @@ +[].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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.39/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.39/options.json new file mode 100644 index 00000000..25e0113e --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.39/options.json @@ -0,0 +1,12 @@ +{ + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "method": "usage-global", + "version": "3.39", + "shippedProposals": true + } + ] + ] +} 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 new file mode 100644 index 00000000..10950c23 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.39/output.mjs @@ -0,0 +1,194 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.match-all.js"; +import "core-js/modules/es.error.cause.js"; +import "core-js/modules/es.error.to-string.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.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.iterator.constructor.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.map.js"; +import "core-js/modules/es.map.group-by.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.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.weak-map.js"; +import "core-js/modules/esnext.suppressed-error.constructor.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.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.symbol.async-dispose.js"; +import "core-js/modules/esnext.symbol.metadata.js"; +import "core-js/modules/esnext.uint8-array.from-base64.js"; +import "core-js/modules/esnext.uint8-array.from-hex.js"; +import "core-js/modules/esnext.uint8-array.set-from-base64.js"; +import "core-js/modules/esnext.uint8-array.set-from-hex.js"; +import "core-js/modules/esnext.uint8-array.to-base64.js"; +import "core-js/modules/esnext.uint8-array.to-hex.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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.21/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.21/input.mjs index bf2b6aec..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.21/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.21/input.mjs @@ -51,3 +51,57 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.21/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.21/output.mjs index 53ed064e..4d317804 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.21/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.21/output.mjs @@ -2,6 +2,7 @@ var _context, _context2, _context3, _context4, _context5; import _findLastInstanceProperty from "core-js-pure/features/instance/find-last.js"; import _findLastIndexInstanceProperty from "core-js-pure/features/instance/find-last-index.js"; import _forEachInstanceProperty from "core-js-pure/stable/instance/for-each.js"; +import _Iterator$from from "core-js-pure/features/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"; @@ -13,10 +14,15 @@ 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/features/instance/with.js"; +import _Iterator from "core-js-pure/features/iterator/index.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"; +import _Promise from "core-js-pure/stable/promise/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); -_forEachInstanceProperty(_context3 = Iterator.from({ +_forEachInstanceProperty(_context3 = _Iterator$from({ next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 @@ -48,3 +54,45 @@ _btoa('hi'); foo.indexed; _withInstanceProperty(bar); 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.24/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.24/input.mjs index 53ffff6e..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.24/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.24/input.mjs @@ -62,3 +62,46 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.24/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.24/output.mjs index 7e17346c..6006b78b 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.24/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.24/output.mjs @@ -2,6 +2,7 @@ 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/features/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"; @@ -14,10 +15,15 @@ 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/features/instance/with.js"; +import _Iterator from "core-js-pure/features/iterator/index.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"; +import _Promise from "core-js-pure/stable/promise/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); -_forEachInstanceProperty(_context3 = Iterator.from({ +_forEachInstanceProperty(_context3 = _Iterator$from({ next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 @@ -57,3 +63,37 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.27/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.27/input.mjs index 8d0c11ae..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.27/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.27/input.mjs @@ -70,3 +70,38 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.27/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.27/output.mjs index 800ee2a6..01e21a03 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.27/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.27/output.mjs @@ -2,6 +2,7 @@ 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/features/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"; @@ -17,10 +18,15 @@ 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 _self from "core-js-pure/stable/self.js"; +import _Iterator from "core-js-pure/features/iterator/index.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"; +import _Promise from "core-js-pure/stable/promise/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); -_forEachInstanceProperty(_context3 = Iterator.from({ +_forEachInstanceProperty(_context3 = _Iterator$from({ next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 @@ -60,10 +66,37 @@ _self; SuppressedError; DisposableStack; AsyncDisposableStack; -Iterator.range(foo, bar); +_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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.28/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.28/input.mjs index cbc0b3b7..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.28/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.28/input.mjs @@ -71,4 +71,37 @@ 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); 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 18071889..7cb20f4e 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 @@ -2,6 +2,7 @@ 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/features/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"; @@ -17,10 +18,15 @@ import _withInstanceProperty from "core-js-pure/stable/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 _self from "core-js-pure/stable/self.js"; +import _Iterator from "core-js-pure/features/iterator/index.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"; +import _Promise from "core-js-pure/stable/promise/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); -_forEachInstanceProperty(_context3 = Iterator.from({ +_forEachInstanceProperty(_context3 = _Iterator$from({ next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 @@ -60,11 +66,37 @@ _self; SuppressedError; DisposableStack; AsyncDisposableStack; -Iterator.range(foo, bar); +_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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.30/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.30/input.mjs index c737f1b2..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.30/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.30/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -80,3 +83,25 @@ 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); 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 4188d775..55c2e90b 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 @@ -2,6 +2,7 @@ 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/features/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"; @@ -17,14 +18,16 @@ import _withInstanceProperty from "core-js-pure/stable/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 _self from "core-js-pure/stable/self.js"; +import _Iterator from "core-js-pure/features/iterator/index.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 _Map$groupBy from "core-js-pure/features/map/group-by.js"; import _Promise from "core-js-pure/stable/promise/index.js"; -import _URLSearchParams from "core-js-pure/stable/url-search-params/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); -_forEachInstanceProperty(_context3 = Iterator.from({ +_forEachInstanceProperty(_context3 = _Iterator$from({ next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 @@ -64,13 +67,15 @@ _self; SuppressedError; DisposableStack; AsyncDisposableStack; -Iterator.range(foo, bar); +_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); @@ -79,3 +84,20 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.31/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.31/input.mjs index 327e2392..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.31/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.31/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -86,3 +89,19 @@ 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); 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 010a6dfe..43d96c01 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 @@ -2,6 +2,7 @@ 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/features/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"; @@ -17,15 +18,17 @@ 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 _Iterator from "core-js-pure/features/iterator/index.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/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 _URLSearchParams from "core-js-pure/stable/url-search-params/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); -_forEachInstanceProperty(_context3 = Iterator.from({ +_forEachInstanceProperty(_context3 = _Iterator$from({ next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 @@ -65,13 +68,15 @@ _self; SuppressedError; DisposableStack; AsyncDisposableStack; -Iterator.range(foo, bar); +_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); @@ -85,3 +90,15 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.32/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.32/input.mjs index 6775c7e4..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.32/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.32/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -88,3 +91,17 @@ 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); 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 38fe6375..43d96c01 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 @@ -2,6 +2,7 @@ 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/features/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"; @@ -17,15 +18,17 @@ 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 _Iterator from "core-js-pure/features/iterator/index.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/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 _URLSearchParams from "core-js-pure/stable/url-search-params/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); -_forEachInstanceProperty(_context3 = Iterator.from({ +_forEachInstanceProperty(_context3 = _Iterator$from({ next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 @@ -65,13 +68,15 @@ _self; SuppressedError; DisposableStack; AsyncDisposableStack; -Iterator.range(foo, bar); +_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); @@ -86,3 +91,14 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.33/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.33/input.mjs index c20b0d25..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.33/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.33/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -91,5 +94,14 @@ 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); 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 82173d2c..43d96c01 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 @@ -2,6 +2,7 @@ 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/features/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"; @@ -17,15 +18,17 @@ 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 _Iterator from "core-js-pure/features/iterator/index.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/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 _URLSearchParams from "core-js-pure/stable/url-search-params/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); -_forEachInstanceProperty(_context3 = Iterator.from({ +_forEachInstanceProperty(_context3 = _Iterator$from({ next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 @@ -65,13 +68,15 @@ _self; SuppressedError; DisposableStack; AsyncDisposableStack; -Iterator.range(foo, bar); +_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); @@ -88,5 +93,12 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.34/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.34/input.mjs index c20b0d25..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.34/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.34/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -91,5 +94,14 @@ 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); 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 7b121426..bcc26e8d 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 @@ -2,6 +2,7 @@ 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/features/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"; @@ -17,15 +18,17 @@ 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 _Iterator from "core-js-pure/features/iterator/index.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 _URLSearchParams from "core-js-pure/stable/url-search-params/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); -_forEachInstanceProperty(_context3 = Iterator.from({ +_forEachInstanceProperty(_context3 = _Iterator$from({ next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 @@ -65,13 +68,15 @@ _self; SuppressedError; DisposableStack; AsyncDisposableStack; -Iterator.range(foo, bar); +_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); @@ -88,5 +93,12 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.36/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.36/input.mjs index cd769f1c..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.36/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.36/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -91,9 +94,14 @@ 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); 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 49416b31..bcc26e8d 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 @@ -2,6 +2,7 @@ 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/features/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"; @@ -17,15 +18,17 @@ 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 _Iterator from "core-js-pure/features/iterator/index.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 _URLSearchParams from "core-js-pure/stable/url-search-params/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); -_forEachInstanceProperty(_context3 = Iterator.from({ +_forEachInstanceProperty(_context3 = _Iterator$from({ next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 @@ -65,13 +68,15 @@ _self; SuppressedError; DisposableStack; AsyncDisposableStack; -Iterator.range(foo, bar); +_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); @@ -88,8 +93,12 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.37/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.37/input.mjs index 064396f6..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.37/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.37/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -99,3 +102,6 @@ new Uint8Array(foo).toHex(); URL.parse(x); Math.sumPrecise(x); Symbol.customMatcher; + +Iterator.concat(a, b); +new Map().getOrInsert(a, b); 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 5f8a3a01..e4c5d5df 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 @@ -2,6 +2,7 @@ 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/features/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"; @@ -17,16 +18,18 @@ 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 _Iterator from "core-js-pure/features/iterator/index.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 _URLSearchParams from "core-js-pure/stable/url-search-params/index.js"; import _URL$parse from "core-js-pure/stable/url/parse.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); -_forEachInstanceProperty(_context3 = Iterator.from({ +_forEachInstanceProperty(_context3 = _Iterator$from({ next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 @@ -66,13 +69,15 @@ _self; SuppressedError; DisposableStack; AsyncDisposableStack; -Iterator.range(foo, bar); +_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); @@ -96,3 +101,5 @@ new Uint8Array(foo).toHex(); _URL$parse(x); Math.sumPrecise(x); _Symbol.customMatcher; +_Iterator.concat(a, b); +new _Map().getOrInsert(a, b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.38/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.38/input.mjs index 064396f6..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.38/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.38/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -99,3 +102,6 @@ new Uint8Array(foo).toHex(); URL.parse(x); Math.sumPrecise(x); Symbol.customMatcher; + +Iterator.concat(a, b); +new Map().getOrInsert(a, b); 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 5f8a3a01..e4c5d5df 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 @@ -2,6 +2,7 @@ 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/features/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"; @@ -17,16 +18,18 @@ 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 _Iterator from "core-js-pure/features/iterator/index.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 _URLSearchParams from "core-js-pure/stable/url-search-params/index.js"; import _URL$parse from "core-js-pure/stable/url/parse.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); -_forEachInstanceProperty(_context3 = Iterator.from({ +_forEachInstanceProperty(_context3 = _Iterator$from({ next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 @@ -66,13 +69,15 @@ _self; SuppressedError; DisposableStack; AsyncDisposableStack; -Iterator.range(foo, bar); +_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); @@ -96,3 +101,5 @@ new Uint8Array(foo).toHex(); _URL$parse(x); Math.sumPrecise(x); _Symbol.customMatcher; +_Iterator.concat(a, b); +new _Map().getOrInsert(a, b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.39/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.39/input.mjs new file mode 100644 index 00000000..2be97b06 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.39/input.mjs @@ -0,0 +1,107 @@ +[].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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.39/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.39/options.json new file mode 100644 index 00000000..4ae7b4f1 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.39/options.json @@ -0,0 +1,11 @@ +{ + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "method": "usage-pure", + "version": "3.39" + } + ] + ] +} 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 new file mode 100644 index 00000000..121edd60 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-corejs-3.39/output.mjs @@ -0,0 +1,105 @@ +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 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 _Iterator from "core-js-pure/stable/iterator/index.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 _URL$parse from "core-js-pure/stable/url/parse.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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.16/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.16/input.mjs index 153aa8fd..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.16/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.16/input.mjs @@ -34,6 +34,74 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.16/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.16/output.mjs index 3a2fce1e..4f52c5a9 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.16/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.16/output.mjs @@ -1,4 +1,4 @@ -var _context, _context2, _context3, _context4, _context5, _context6; +var _context, _context2, _context3, _context4, _context5; 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"; @@ -8,10 +8,11 @@ import _uniqueByInstanceProperty from "core-js-pure/features/instance/unique-by. 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 _emplaceInstanceProperty from "core-js-pure/features/instance/emplace.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 _Iterator from "core-js-pure/features/iterator/index.js"; +import _Map$groupBy from "core-js-pure/features/map/group-by.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -26,7 +27,7 @@ _groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2 _Number$range(1, 2); _BigInt$range(1n, 2n); _Array$isTemplateObject((x => x)`a${x}z`); -_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', { +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0 }); @@ -37,6 +38,55 @@ _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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.20/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.20/input.mjs index 265b6032..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.20/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.20/input.mjs @@ -46,6 +46,62 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.20/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.20/output.mjs index 81e20a04..0a47dccc 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.20/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.20/output.mjs @@ -1,4 +1,4 @@ -var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8; +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"; @@ -8,7 +8,6 @@ import _uniqueByInstanceProperty from "core-js-pure/features/instance/unique-by. 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 _emplaceInstanceProperty from "core-js-pure/features/instance/emplace.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"; @@ -17,6 +16,8 @@ import _unThisInstanceProperty from "core-js-pure/features/instance/un-this.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 _Iterator from "core-js-pure/features/iterator/index.js"; +import _Map$groupBy from "core-js-pure/features/map/group-by.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -31,7 +32,7 @@ _groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2 _Number$range(1, 2); _BigInt$range(1n, 2n); _Array$isTemplateObject((x => x)`a${x}z`); -_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', { +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0 }); @@ -43,11 +44,54 @@ Symbol.matchAll; _Symbol$metadata; Symbol.replaceAll; new URL(url); -const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar); -const push = _unThisInstanceProperty(_context8 = [].push).call(_context8); +const foo = _groupByToMapInstanceProperty(_context6 = [1, 2, 3]).call(_context6, bar); +const push = _unThisInstanceProperty(_context7 = [].push).call(_context7); _Function$isConstructor; throw new DOMException(); _structuredClone(72); +btoa('hi'); foo.indexed; _withInstanceProperty(bar); 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.24/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.24/input.mjs index 53ffff6e..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.24/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.24/input.mjs @@ -62,3 +62,46 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.24/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.24/output.mjs index 21b1b323..fa0e64f9 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.24/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.24/output.mjs @@ -1,4 +1,4 @@ -var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8; +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"; @@ -8,7 +8,6 @@ import _uniqueByInstanceProperty from "core-js-pure/features/instance/unique-by. 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 _emplaceInstanceProperty from "core-js-pure/features/instance/emplace.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"; @@ -18,6 +17,8 @@ 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 _Iterator from "core-js-pure/features/iterator/index.js"; +import _Map$groupBy from "core-js-pure/features/map/group-by.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -32,7 +33,7 @@ _groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2 _Number$range(1, 2); _BigInt$range(1n, 2n); _Array$isTemplateObject((x => x)`a${x}z`); -_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', { +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0 }); @@ -44,8 +45,8 @@ Symbol.matchAll; _Symbol$metadata; Symbol.replaceAll; new URL(url); -const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar); -const push = _unThisInstanceProperty(_context8 = _pushInstanceProperty([])).call(_context8); +const foo = _groupByToMapInstanceProperty(_context6 = [1, 2, 3]).call(_context6, bar); +const push = _unThisInstanceProperty(_context7 = _pushInstanceProperty([])).call(_context7); _Function$isConstructor; throw new DOMException(); _structuredClone(72); @@ -61,3 +62,37 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.27/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.27/input.mjs index 8d0c11ae..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.27/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.27/input.mjs @@ -70,3 +70,38 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.27/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.27/output.mjs index a1413b2f..01415598 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.27/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.27/output.mjs @@ -1,4 +1,4 @@ -var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8; +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"; @@ -8,7 +8,6 @@ import _uniqueByInstanceProperty from "core-js-pure/features/instance/unique-by. 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 _emplaceInstanceProperty from "core-js-pure/features/instance/emplace.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"; @@ -25,6 +24,7 @@ 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 _Map$groupBy from "core-js-pure/features/map/group-by.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -39,7 +39,7 @@ _groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2 _Number$range(1, 2); _BigInt$range(1n, 2n); _Array$isTemplateObject((x => x)`a${x}z`); -_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', { +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0 }); @@ -51,8 +51,8 @@ Symbol.matchAll; _Symbol$metadata; Symbol.replaceAll; new URL(url); -const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar); -const push = _unThisInstanceProperty(_context8 = _pushInstanceProperty([])).call(_context8); +const foo = _groupByToMapInstanceProperty(_context6 = [1, 2, 3]).call(_context6, bar); +const push = _unThisInstanceProperty(_context7 = _pushInstanceProperty([])).call(_context7); _Function$isConstructor; throw new DOMException(); _structuredClone(72); @@ -75,3 +75,30 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.28/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.28/input.mjs index cbc0b3b7..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.28/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.28/input.mjs @@ -71,4 +71,37 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.28/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.28/output.mjs index 37fd821b..29a2f3ae 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.28/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.28/output.mjs @@ -1,4 +1,4 @@ -var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8; +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"; @@ -8,7 +8,6 @@ import _uniqueByInstanceProperty from "core-js-pure/features/instance/unique-by. 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 _emplaceInstanceProperty from "core-js-pure/features/instance/emplace.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"; @@ -31,6 +30,8 @@ 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 _Map$groupBy from "core-js-pure/features/map/group-by.js"; +import _Iterator from "core-js-pure/features/iterator/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -45,7 +46,7 @@ _groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2 _Number$range(1, 2); _BigInt$range(1n, 2n); _Array$isTemplateObject((x => x)`a${x}z`); -_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', { +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0 }); @@ -57,8 +58,8 @@ Symbol.matchAll; _Symbol$metadata; Symbol.replaceAll; new URL(url); -const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar); -const push = _unThisInstanceProperty(_context8 = _pushInstanceProperty([])).call(_context8); +const foo = _groupByToMapInstanceProperty(_context6 = [1, 2, 3]).call(_context6, bar); +const push = _unThisInstanceProperty(_context7 = _pushInstanceProperty([])).call(_context7); _Function$isConstructor; throw new DOMException(); _structuredClone(72); @@ -81,4 +82,30 @@ _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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.30/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.30/input.mjs index c737f1b2..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.30/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.30/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -80,3 +83,25 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.30/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.30/output.mjs index ca9da6be..5ccaeb1e 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.30/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.30/output.mjs @@ -1,4 +1,4 @@ -var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8; +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"; @@ -8,7 +8,6 @@ import _uniqueByInstanceProperty from "core-js-pure/features/instance/unique-by. 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 _emplaceInstanceProperty from "core-js-pure/features/instance/emplace.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"; @@ -33,6 +32,7 @@ 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 _Map$groupBy from "core-js-pure/features/map/group-by.js"; +import _Iterator from "core-js-pure/features/iterator/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -47,7 +47,7 @@ _groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2 _Number$range(1, 2); _BigInt$range(1n, 2n); _Array$isTemplateObject((x => x)`a${x}z`); -_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', { +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0 }); @@ -59,8 +59,8 @@ Symbol.matchAll; _Symbol$metadata; Symbol.replaceAll; new URL(url); -const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar); -const push = _unThisInstanceProperty(_context8 = _pushInstanceProperty([])).call(_context8); +const foo = _groupByToMapInstanceProperty(_context6 = [1, 2, 3]).call(_context6, bar); +const push = _unThisInstanceProperty(_context7 = _pushInstanceProperty([])).call(_context7); _Function$isConstructor; throw new DOMException(); _structuredClone(72); @@ -83,6 +83,8 @@ _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); @@ -91,3 +93,20 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.31/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.31/input.mjs index 327e2392..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.31/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.31/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -86,3 +89,19 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.31/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.31/output.mjs index aa805e0e..df2cd352 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.31/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.31/output.mjs @@ -1,4 +1,4 @@ -var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8; +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"; @@ -8,7 +8,6 @@ import _uniqueByInstanceProperty from "core-js-pure/features/instance/unique-by. 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 _emplaceInstanceProperty from "core-js-pure/features/instance/emplace.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"; @@ -37,6 +36,7 @@ import _Symbol$isRegisteredSymbol from "core-js-pure/features/symbol/is-register 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 _Iterator from "core-js-pure/features/iterator/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -51,7 +51,7 @@ _groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2 _Number$range(1, 2); _BigInt$range(1n, 2n); _Array$isTemplateObject((x => x)`a${x}z`); -_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', { +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0 }); @@ -63,8 +63,8 @@ Symbol.matchAll; _Symbol$metadata; Symbol.replaceAll; new URL(url); -const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar); -const push = _unThisInstanceProperty(_context8 = _pushInstanceProperty([])).call(_context8); +const foo = _groupByToMapInstanceProperty(_context6 = [1, 2, 3]).call(_context6, bar); +const push = _unThisInstanceProperty(_context7 = _pushInstanceProperty([])).call(_context7); _Function$isConstructor; throw new DOMException(); _structuredClone(72); @@ -87,6 +87,8 @@ _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); @@ -100,3 +102,15 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.32/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.32/input.mjs index 6775c7e4..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.32/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.32/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -88,3 +91,17 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.32/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.32/output.mjs index c12ba42e..f1bbdbcb 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.32/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.32/output.mjs @@ -1,4 +1,4 @@ -var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8; +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"; @@ -8,7 +8,6 @@ import _uniqueByInstanceProperty from "core-js-pure/features/instance/unique-by. 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 _emplaceInstanceProperty from "core-js-pure/features/instance/emplace.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"; @@ -38,6 +37,7 @@ 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 _Iterator from "core-js-pure/features/iterator/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -52,7 +52,7 @@ _groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2 _Number$range(1, 2); _BigInt$range(1n, 2n); _Array$isTemplateObject((x => x)`a${x}z`); -_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', { +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0 }); @@ -64,8 +64,8 @@ Symbol.matchAll; _Symbol$metadata; Symbol.replaceAll; new URL(url); -const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar); -const push = _unThisInstanceProperty(_context8 = _pushInstanceProperty([])).call(_context8); +const foo = _groupByToMapInstanceProperty(_context6 = [1, 2, 3]).call(_context6, bar); +const push = _unThisInstanceProperty(_context7 = _pushInstanceProperty([])).call(_context7); _Function$isConstructor; throw new DOMException(); _structuredClone(72); @@ -88,6 +88,8 @@ _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); @@ -102,3 +104,14 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.33/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.33/input.mjs index c20b0d25..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.33/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.33/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -91,5 +94,14 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.33/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.33/output.mjs index fb4baf88..ccc49b82 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.33/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.33/output.mjs @@ -1,4 +1,4 @@ -var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8; +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"; @@ -8,7 +8,6 @@ import _uniqueByInstanceProperty from "core-js-pure/features/instance/unique-by. 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 _emplaceInstanceProperty from "core-js-pure/features/instance/emplace.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"; @@ -39,6 +38,7 @@ 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 _Iterator from "core-js-pure/features/iterator/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -53,7 +53,7 @@ _groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2 _Number$range(1, 2); _BigInt$range(1n, 2n); _Array$isTemplateObject((x => x)`a${x}z`); -_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', { +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0 }); @@ -65,8 +65,8 @@ Symbol.matchAll; _Symbol$metadata; Symbol.replaceAll; new URL(url); -const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar); -const push = _unThisInstanceProperty(_context8 = _pushInstanceProperty([])).call(_context8); +const foo = _groupByToMapInstanceProperty(_context6 = [1, 2, 3]).call(_context6, bar); +const push = _unThisInstanceProperty(_context7 = _pushInstanceProperty([])).call(_context7); _Function$isConstructor; throw new DOMException(); _structuredClone(72); @@ -89,6 +89,8 @@ _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); @@ -105,5 +107,12 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.34/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.34/input.mjs index c20b0d25..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.34/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.34/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -91,5 +94,14 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.34/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.34/output.mjs index fb4baf88..ccc49b82 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.34/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.34/output.mjs @@ -1,4 +1,4 @@ -var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8; +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"; @@ -8,7 +8,6 @@ import _uniqueByInstanceProperty from "core-js-pure/features/instance/unique-by. 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 _emplaceInstanceProperty from "core-js-pure/features/instance/emplace.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"; @@ -39,6 +38,7 @@ 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 _Iterator from "core-js-pure/features/iterator/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -53,7 +53,7 @@ _groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2 _Number$range(1, 2); _BigInt$range(1n, 2n); _Array$isTemplateObject((x => x)`a${x}z`); -_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', { +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0 }); @@ -65,8 +65,8 @@ Symbol.matchAll; _Symbol$metadata; Symbol.replaceAll; new URL(url); -const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar); -const push = _unThisInstanceProperty(_context8 = _pushInstanceProperty([])).call(_context8); +const foo = _groupByToMapInstanceProperty(_context6 = [1, 2, 3]).call(_context6, bar); +const push = _unThisInstanceProperty(_context7 = _pushInstanceProperty([])).call(_context7); _Function$isConstructor; throw new DOMException(); _structuredClone(72); @@ -89,6 +89,8 @@ _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); @@ -105,5 +107,12 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.36/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.36/input.mjs index cd769f1c..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.36/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.36/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -91,9 +94,14 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.36/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.36/output.mjs index 4e4b3da9..ccc49b82 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.36/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.36/output.mjs @@ -1,4 +1,4 @@ -var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8; +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"; @@ -8,7 +8,6 @@ import _uniqueByInstanceProperty from "core-js-pure/features/instance/unique-by. 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 _emplaceInstanceProperty from "core-js-pure/features/instance/emplace.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"; @@ -39,6 +38,7 @@ 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 _Iterator from "core-js-pure/features/iterator/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -53,7 +53,7 @@ _groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2 _Number$range(1, 2); _BigInt$range(1n, 2n); _Array$isTemplateObject((x => x)`a${x}z`); -_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', { +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0 }); @@ -65,8 +65,8 @@ Symbol.matchAll; _Symbol$metadata; Symbol.replaceAll; new URL(url); -const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar); -const push = _unThisInstanceProperty(_context8 = _pushInstanceProperty([])).call(_context8); +const foo = _groupByToMapInstanceProperty(_context6 = [1, 2, 3]).call(_context6, bar); +const push = _unThisInstanceProperty(_context7 = _pushInstanceProperty([])).call(_context7); _Function$isConstructor; throw new DOMException(); _structuredClone(72); @@ -89,6 +89,8 @@ _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); @@ -105,8 +107,12 @@ 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.37/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.37/input.mjs index 064396f6..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.37/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.37/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -99,3 +102,6 @@ new Uint8Array(foo).toHex(); URL.parse(x); Math.sumPrecise(x); Symbol.customMatcher; + +Iterator.concat(a, b); +new Map().getOrInsert(a, b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.37/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.37/output.mjs index 64c16cca..af2fb64a 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.37/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.37/output.mjs @@ -1,4 +1,4 @@ -var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8; +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"; @@ -8,7 +8,6 @@ import _uniqueByInstanceProperty from "core-js-pure/features/instance/unique-by. 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 _emplaceInstanceProperty from "core-js-pure/features/instance/emplace.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"; @@ -42,6 +41,7 @@ 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 from "core-js-pure/features/iterator/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -56,7 +56,7 @@ _groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2 _Number$range(1, 2); _BigInt$range(1n, 2n); _Array$isTemplateObject((x => x)`a${x}z`); -_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', { +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0 }); @@ -68,8 +68,8 @@ Symbol.matchAll; _Symbol$metadata; Symbol.replaceAll; new URL(url); -const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar); -const push = _unThisInstanceProperty(_context8 = _pushInstanceProperty([])).call(_context8); +const foo = _groupByToMapInstanceProperty(_context6 = [1, 2, 3]).call(_context6, bar); +const push = _unThisInstanceProperty(_context7 = _pushInstanceProperty([])).call(_context7); _Function$isConstructor; throw new DOMException(); _structuredClone(72); @@ -92,6 +92,8 @@ _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); @@ -115,3 +117,5 @@ new Uint8Array(foo).toHex(); _URL$parse(x); _Math$sumPrecise(x); _Symbol$customMatcher; +_Iterator.concat(a, b); +new Map().getOrInsert(a, b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.38/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.38/input.mjs index 064396f6..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.38/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.38/input.mjs @@ -71,6 +71,9 @@ Symbol.isWellKnown(foo); Symbol.isRegistered(foo); Function.demethodize(); +new URLSearchParams(string).size; +new Set(array).intersection(otherSet); + URL.canParse(foo); Symbol.isWellKnownSymbol(foo); @@ -99,3 +102,6 @@ new Uint8Array(foo).toHex(); URL.parse(x); Math.sumPrecise(x); Symbol.customMatcher; + +Iterator.concat(a, b); +new Map().getOrInsert(a, b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.38/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.38/output.mjs index 64c16cca..af2fb64a 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.38/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.38/output.mjs @@ -1,4 +1,4 @@ -var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8; +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"; @@ -8,7 +8,6 @@ import _uniqueByInstanceProperty from "core-js-pure/features/instance/unique-by. 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 _emplaceInstanceProperty from "core-js-pure/features/instance/emplace.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"; @@ -42,6 +41,7 @@ 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 from "core-js-pure/features/iterator/index.js"; _findLastInstanceProperty(_context = []).call(_context, fn); _findLastIndexInstanceProperty(_context2 = []).call(_context2, fn); [].asIndexedPairs(); @@ -56,7 +56,7 @@ _groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2 _Number$range(1, 2); _BigInt$range(1n, 2n); _Array$isTemplateObject((x => x)`a${x}z`); -_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', { +new Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0 }); @@ -68,8 +68,8 @@ Symbol.matchAll; _Symbol$metadata; Symbol.replaceAll; new URL(url); -const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar); -const push = _unThisInstanceProperty(_context8 = _pushInstanceProperty([])).call(_context8); +const foo = _groupByToMapInstanceProperty(_context6 = [1, 2, 3]).call(_context6, bar); +const push = _unThisInstanceProperty(_context7 = _pushInstanceProperty([])).call(_context7); _Function$isConstructor; throw new DOMException(); _structuredClone(72); @@ -92,6 +92,8 @@ _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); @@ -115,3 +117,5 @@ new Uint8Array(foo).toHex(); _URL$parse(x); _Math$sumPrecise(x); _Symbol$customMatcher; +_Iterator.concat(a, b); +new Map().getOrInsert(a, b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.39/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.39/input.mjs new file mode 100644 index 00000000..2be97b06 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.39/input.mjs @@ -0,0 +1,107 @@ +[].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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.39/options.json b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.39/options.json new file mode 100644 index 00000000..c7179e12 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.39/options.json @@ -0,0 +1,15 @@ +{ + "targets": { + "chrome": 90 + }, + "plugins": [ + [ + "@@/polyfill-corejs3", + { + "method": "usage-pure", + "version": "3.39", + "proposals": true + } + ] + ] +} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.39/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.39/output.mjs new file mode 100644 index 00000000..81e24c24 --- /dev/null +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.39/output.mjs @@ -0,0 +1,121 @@ +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"; +_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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.9/input.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.9/input.mjs index 8f4aaddd..2be97b06 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.9/input.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.9/input.mjs @@ -1,6 +1,107 @@ [].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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.9/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.9/output.mjs index 09fa4a74..7d42cf7a 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.9/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.9/output.mjs @@ -1,8 +1,89 @@ -var _context, _context2; +var _context, _context2, _context3; 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 _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 _Iterator from "core-js-pure/features/iterator/index.js"; +import _Map$groupBy from "core-js-pure/features/map/group-by.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(); +_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); +_uniqueByInstanceProperty(_context3 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context3, 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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-corejs-3.20/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-corejs-3.20/output.mjs index a171c16e..221b4c44 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-corejs-3.20/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-corejs-3.20/output.mjs @@ -1,4 +1,4 @@ -var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11; +var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10; import _findLastInstanceProperty from "core-js-pure/features/instance/find-last.js"; import _findLastIndexInstanceProperty from "core-js-pure/features/instance/find-last-index.js"; import _forEachInstanceProperty from "core-js-pure/features/instance/for-each.js"; @@ -11,7 +11,6 @@ import _uniqueByInstanceProperty from "core-js-pure/features/instance/unique-by. 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 _emplaceInstanceProperty from "core-js-pure/features/instance/emplace.js"; import _Map from "core-js-pure/features/map/index.js"; import _Symbol$asyncDispose from "core-js-pure/features/symbol/async-dispose.js"; import _Symbol$matcher from "core-js-pure/features/symbol/matcher.js"; @@ -40,7 +39,7 @@ _groupByInstanceProperty(_context7 = _uniqueByInstanceProperty(_context8 = [1, 2 _Number$range(1, 2); _BigInt$range(1n, 2n); _Array$isTemplateObject((x => x)`a${x}z`); -_emplaceInstanceProperty(_context9 = new _Map([['x', 1]])).call(_context9, 'x', { +new _Map([['x', 1]]).emplace('x', { update: x => x + 1, insert: () => 0 }); @@ -52,8 +51,8 @@ _Symbol$matchAll; _Symbol$metadata; _replaceAllInstanceProperty(_Symbol); new _URL(url); -const foo = _groupByToMapInstanceProperty(_context10 = [1, 2, 3]).call(_context10, bar); -const push = _unThisInstanceProperty(_context11 = [].push).call(_context11); +const foo = _groupByToMapInstanceProperty(_context9 = [1, 2, 3]).call(_context9, bar); +const push = _unThisInstanceProperty(_context10 = [].push).call(_context10); _Function$isConstructor; throw new _DOMException(); _structuredClone(72); 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 77c1cff5..454ca1b1 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 @@ -85,6 +85,7 @@ var _Map$groupBy = require("core-js-pure/stable/map/group-by.js"); var _Promise = require("core-js-pure/stable/promise/index.js"); var _Promise$allSettled = require("core-js-pure/stable/promise/all-settled.js"); var _Promise$any = require("core-js-pure/stable/promise/any.js"); +var _Promise$try = require("core-js-pure/features/promise/try.js"); var _Promise$withResolvers = require("core-js-pure/stable/promise/with-resolvers.js"); var _WeakMap = require("core-js-pure/stable/weak-map/index.js"); _Array$from; @@ -208,7 +209,7 @@ _Promise.all; _Promise$allSettled; _Promise$any; _Promise.race; -_Promise.try; +_Promise$try; _Promise$withResolvers; _WeakMap.from; ArrayBuffer.isView; diff --git a/yarn.lock b/yarn.lock index 746100a4..fd804cf0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4518,9 +4518,9 @@ __metadata: "@babel/plugin-transform-modules-commonjs": ^7.22.5 "@babel/plugin-transform-runtime": ^7.22.15 "@babel/plugin-transform-spread": ^7.22.5 - core-js: ^3.38.1 - core-js-compat: ^3.38.1 - core-js-pure: ^3.38.1 + core-js: ^3.39.0 + core-js-compat: ^3.39.0 + core-js-pure: ^3.39.0 peerDependencies: "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 languageName: unknown @@ -4911,17 +4911,17 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.21.9, browserslist@npm:^4.23.3": - version: 4.23.3 - resolution: "browserslist@npm:4.23.3" +"browserslist@npm:^4.21.9, browserslist@npm:^4.24.2": + version: 4.24.2 + resolution: "browserslist@npm:4.24.2" dependencies: - caniuse-lite: ^1.0.30001646 - electron-to-chromium: ^1.5.4 + caniuse-lite: ^1.0.30001669 + electron-to-chromium: ^1.5.41 node-releases: ^2.0.18 - update-browserslist-db: ^1.1.0 + update-browserslist-db: ^1.1.1 bin: browserslist: cli.js - checksum: 7906064f9970aeb941310b2fcb8b4ace4a1b50aa657c986677c6f1553a8cabcc94ee9c5922f715baffbedaa0e6cf0831b6fed7b059dde6873a4bfadcbe069c7e + checksum: cf64085f12132d38638f38937a255edb82c7551b164a98577b055dd79719187a816112f7b97b9739e400c4954cd66479c0d7a843cb816e346f4795dc24fd5d97 languageName: node linkType: hard @@ -5153,10 +5153,10 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30001646": - version: 1.0.30001647 - resolution: "caniuse-lite@npm:1.0.30001647" - checksum: 4c2a32cf51a6328e263b4b4f59118be88b168215727258d41cc1db309c8987cd86fecacb3237b6886ee00f0d6b98e5321a5a4009a93cad2420e87f251e79e679 +"caniuse-lite@npm:^1.0.30001669": + version: 1.0.30001676 + resolution: "caniuse-lite@npm:1.0.30001676" + checksum: c972232e4b3240865760ea8d29805cea7af69bd91e258a3e864e34a2b369ce6e6b69469cb39f008de593166965350e5370e6cde91fb58c02209259d8a2204fdf languageName: node linkType: hard @@ -5777,26 +5777,26 @@ __metadata: languageName: node linkType: hard -"core-js-compat@npm:^3.31.0, core-js-compat@npm:^3.38.1": - version: 3.38.1 - resolution: "core-js-compat@npm:3.38.1" +"core-js-compat@npm:^3.31.0, core-js-compat@npm:^3.39.0": + version: 3.39.0 + resolution: "core-js-compat@npm:3.39.0" dependencies: - browserslist: ^4.23.3 - checksum: a0a5673bcd59f588f0cd0b59cdacd4712b82909738a87406d334dd412eb3d273ae72b275bdd8e8fef63fca9ef12b42ed651be139c7c44c8a1acb423c8906992e + browserslist: ^4.24.2 + checksum: 2d7d087c3271d711d03a55203d4756f6288317a1ce35cdc8bafaf1833ef21fd67a92a50cff8dcf7df1325ac63720906ab3cf514c85b238c95f65fca1040f6ad6 languageName: node linkType: hard -"core-js-pure@npm:^3.38.1": - version: 3.38.1 - resolution: "core-js-pure@npm:3.38.1" - checksum: 95ca2e75df371571b0d41cba81e1f6335a2ba1f080e80f8edfa124ad3041880fe72e10f2144527a700a3d993dbf9f7cada3e04a927a66604bc49d0c4951567fb +"core-js-pure@npm:^3.39.0": + version: 3.39.0 + resolution: "core-js-pure@npm:3.39.0" + checksum: cdcb1eec4eb9308fcf5cfe18a95322c388b05c11e66b5b0ac296a08f8f2106b458ecfe8aca0155d62ed2c5e150485b68073937e7b0a563fbc287563c4475a7c1 languageName: node linkType: hard -"core-js@npm:^3.38.1": - version: 3.38.1 - resolution: "core-js@npm:3.38.1" - checksum: 55703c2f6fcd537e47a5cc83e9dc9884efef61861bbefb4a96a8c95e87956db980ce314628465dd49f14e626c5e633b9e3433f3e4a1f628404a14da420eb2556 +"core-js@npm:^3.39.0": + version: 3.39.0 + resolution: "core-js@npm:3.39.0" + checksum: 7a3670e9a2a89e0a049daa288d742d09f6e16d27a8945c5e2ef6fc45dc57e5c4bc5db589da05947486f54ae978d14cf27bd3fb1db0b9907000a611e8af37355b languageName: node linkType: hard @@ -6349,10 +6349,10 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.4.528, electron-to-chromium@npm:^1.5.4": - version: 1.5.4 - resolution: "electron-to-chromium@npm:1.5.4" - checksum: 352f13c043cb185b464efe20f9b0a1adea2b1a7dad56e41dac995d0ad060f9981e479d632ebc73a1dce3bd5c36bbceeffe0667161ce296c2488fbb95f89bc793 +"electron-to-chromium@npm:^1.4.528, electron-to-chromium@npm:^1.5.41": + version: 1.5.50 + resolution: "electron-to-chromium@npm:1.5.50" + checksum: 971f49d0c3f8484225a2ee86f86074c2ef1a3c46c2bad9b2151202c03f5de2f6f0fc41029d0bc634e6d01d067673cbf4916a7f9753f5ec1d5b177cbaca9b2e5a languageName: node linkType: hard @@ -6585,10 +6585,10 @@ __metadata: languageName: node linkType: hard -"escalade@npm:^3.1.1, escalade@npm:^3.1.2": - version: 3.1.2 - resolution: "escalade@npm:3.1.2" - checksum: 1ec0977aa2772075493002bdbd549d595ff6e9393b1cb0d7d6fcaf78c750da0c158f180938365486f75cb69fba20294351caddfce1b46552a7b6c3cde52eaa02 +"escalade@npm:^3.1.1, escalade@npm:^3.2.0": + version: 3.2.0 + resolution: "escalade@npm:3.2.0" + checksum: 47b029c83de01b0d17ad99ed766347b974b0d628e848de404018f3abee728e987da0d2d370ad4574aa3d5b5bfc368754fd085d69a30f8e75903486ec4b5b709e languageName: node linkType: hard @@ -11963,10 +11963,10 @@ fsevents@^1.2.7: languageName: node linkType: hard -"picocolors@npm:^1.0.1": - version: 1.0.1 - resolution: "picocolors@npm:1.0.1" - checksum: fa68166d1f56009fc02a34cdfd112b0dd3cf1ef57667ac57281f714065558c01828cdf4f18600ad6851cbe0093952ed0660b1e0156bddf2184b6aaf5817553a5 +"picocolors@npm:^1.1.0": + version: 1.1.1 + resolution: "picocolors@npm:1.1.1" + checksum: e1cf46bf84886c79055fdfa9dcb3e4711ad259949e3565154b004b260cd356c5d54b31a1437ce9782624bf766272fe6b0154f5f0c744fb7af5d454d2b60db045 languageName: node linkType: hard @@ -14559,17 +14559,17 @@ fsevents@^1.2.7: languageName: node linkType: hard -"update-browserslist-db@npm:^1.1.0": - version: 1.1.0 - resolution: "update-browserslist-db@npm:1.1.0" +"update-browserslist-db@npm:^1.1.1": + version: 1.1.1 + resolution: "update-browserslist-db@npm:1.1.1" dependencies: - escalade: ^3.1.2 - picocolors: ^1.0.1 + escalade: ^3.2.0 + picocolors: ^1.1.0 peerDependencies: browserslist: ">= 4.21.0" bin: update-browserslist-db: cli.js - checksum: 7b74694d96f0c360f01b702e72353dc5a49df4fe6663d3ee4e5c628f061576cddf56af35a3a886238c01dd3d8f231b7a86a8ceaa31e7a9220ae31c1c1238e562 + checksum: 2ea11bd2562122162c3e438d83a1f9125238c0844b6d16d366e3276d0c0acac6036822dc7df65fc5a89c699cdf9f174acf439c39bedf3f9a2f3983976e4b4c3e languageName: node linkType: hard