From 7bac97b015a89f8dbaa14e6abc8e95589b46a4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 18 Jan 2024 10:37:10 +0100 Subject: [PATCH] Support injecting polyfill imports in a specific order (#194) --- docs/polyfill-provider.md | 10 +- .../{imports-cache.ts => imports-injector.ts} | 96 +++++++------ .../src/index.ts | 27 ++-- .../src/normalize-options.ts | 4 +- .../src/types.ts | 15 +- .../src/utils.ts | 60 ++++---- .../src/index.ts | 2 +- .../entries-features-chrome-71/output.mjs | 2 +- .../entry-global/entries-features/output.mjs | 10 +- .../entry-global/entries-stable/output.mjs | 4 +- .../entry-global/normalization/output.mjs | 10 +- .../usage-global/all-corejs-3.21/output.mjs | 28 ++-- .../usage-global/all-corejs-3.25/output.mjs | 44 +++--- .../usage-global/all-corejs-3.27/output.mjs | 54 +++---- .../usage-global/all-corejs-3.28/output.mjs | 54 +++---- .../usage-global/all-corejs-3.29/output.mjs | 56 ++++---- .../usage-global/all-corejs-3.30/output.mjs | 58 ++++---- .../usage-global/all-corejs-3.31/output.mjs | 70 ++++----- .../usage-global/all-corejs-3.32/output.mjs | 74 +++++----- .../usage-global/all-corejs-3.33/output.mjs | 84 +++++------ .../usage-global/all-corejs-3.34/output.mjs | 84 +++++------ .../output.mjs | 68 ++++----- .../output.mjs | 92 ++++++------ .../output.mjs | 94 ++++++------ .../output.mjs | 96 ++++++------- .../output.mjs | 110 +++++++------- .../output.mjs | 120 ++++++++-------- .../output.mjs | 134 ++++++++--------- .../output.mjs | 136 +++++++++--------- .../output.mjs | 38 ++--- .../output.mjs | 54 +++---- .../all-proposals-corejs-3.20/output.mjs | 38 ++--- .../usage-global/all-proposals/output.mjs | 22 +-- .../test/fixtures/usage-global/all/output.mjs | 16 +-- .../usage-global/array-flat/output.mjs | 2 +- .../async-iterator-problem-case/output.mjs | 8 +- .../usage-global/decorators/output.js | 4 +- .../destructuring-assignment/output.mjs | 2 +- .../destructuring-catch/output.mjs | 2 +- .../destructuring-for-x/output.mjs | 2 +- .../destructuring-iife/output.mjs | 4 +- .../destructuring-params/output.mjs | 2 +- .../output.mjs | 2 +- .../determanated-instance-methods/output.mjs | 8 +- .../evaluated-class-methods/output.mjs | 2 +- .../evaluated-instance-methods/output.mjs | 2 +- .../for-of-destructure-with/output.mjs | 2 +- .../fixtures/usage-global/for-of/output.mjs | 2 +- .../test/fixtures/usage-global/in/output.mjs | 4 +- .../output.mjs | 2 +- .../usage-global/instance-methods/output.mjs | 28 ++-- .../usage-global/number-ie-11/output.mjs | 2 +- .../object-destructuring/output.mjs | 18 +-- .../usage-global/promise-all/output.mjs | 2 +- .../usage-global/promise-race/output.mjs | 2 +- .../output.mjs | 2 +- .../proposal-to-stable-corejs-3.0/output.mjs | 2 +- .../shippedProposals-corejs-3.29/output.mjs | 18 +-- .../usage-global/shippedProposals/output.mjs | 18 +-- .../source-type-script-query/output.js | 2 +- .../usage-global/source-type-script/output.js | 2 +- .../fixtures/usage-global/spread/output.mjs | 2 +- .../usage-global/static-methods/output.mjs | 2 +- .../symbol-iterator-in/output.mjs | 4 +- .../usage-global/symbol-iterator/output.mjs | 4 +- .../fixtures/usage-global/timers/output.mjs | 2 +- .../output.mjs | 6 +- .../typed-array-static/output.mjs | 2 +- 68 files changed, 1038 insertions(+), 994 deletions(-) rename packages/babel-helper-define-polyfill-provider/src/{imports-cache.ts => imports-injector.ts} (58%) diff --git a/docs/polyfill-provider.md b/docs/polyfill-provider.md index cdf0d390..a81396f2 100644 --- a/docs/polyfill-provider.md +++ b/docs/polyfill-provider.md @@ -198,14 +198,16 @@ A `meta` object describes the statement or expression which triggered the call t When calling a provider function (e.g. `usageGlobal`), `@babel/helper-define-polyfill-provider` will provide it a few utilities to easily inject the necessary `import` statements or `require` calls, depending on the source type. Polyfill providers shouldn't worry about which AST represents an import, or about the source type of the file being transpiled. -- `utils.injectGlobalImport(url: string)` can be used to inject side-effectful global imports. It is usually called when injecting global polyfills. +- `utils.injectGlobalImport(url: string, polyfillName?: string)` can be used to inject side-effectful global imports. It is usually called when injecting global polyfills. For example, `utils.injectGlobalImport("my-polyfill")` would generate this code: ```js import "my-polyfill"; ``` -- `utils.injectNamedImport(url: string, name: string, hint?: string)` and `utils.injectDefaultImport(url: string, hint?: string)` are used to inject named or defaults import. They both return an identifier referencing the imported value. + If `polyfillName` is specified, imports are injected respecting the order defined in [`provider.polyfills`](#providerpolyfills-string---name-string-support-). + +- `utils.injectNamedImport(url: string, name: string, hint?: string, polyfillName?: string)` and `utils.injectDefaultImport(url: string, hint?: string, polyfillName?: string)` are used to inject named or defaults import. They both return an identifier referencing the imported value. The optional `hint` parameter can be used to generate a nice-looking alias for the import. For example, `utils.injectNamedImport("array-polyfills", "from, "Array.from")` would generate this code: @@ -222,6 +224,8 @@ When calling a provider function (e.g. `usageGlobal`), `@babel/helper-define-pol } ``` + If `polyfillName` is specified, imports are injected respecting the order defined in [`provider.polyfills`](#providerpolyfills-string---name-string-support-). + ## The `ProviderApi` parameter While some utilities are provided in the `utils` object, some of them are provided in the `api` object. The main different is that `utils` methods act on a specific input source file, while `api` methods provide info about how the plugin was configured and are not directly related to the transformed source code. @@ -265,7 +269,7 @@ Sometimes you might need to inject an import outside of the `entryGlobal`/`usage You can use this method to create a new `utils` object with all its utilities, attached to the file the current `NodePath` belongs to. ```js -export default function({ getUtils }) { +export default function ({ getUtils }) { return { // ... visitor: { diff --git a/packages/babel-helper-define-polyfill-provider/src/imports-cache.ts b/packages/babel-helper-define-polyfill-provider/src/imports-injector.ts similarity index 58% rename from packages/babel-helper-define-polyfill-provider/src/imports-cache.ts rename to packages/babel-helper-define-polyfill-provider/src/imports-injector.ts index b44c655f..58b98b34 100644 --- a/packages/babel-helper-define-polyfill-provider/src/imports-cache.ts +++ b/packages/babel-helper-define-polyfill-provider/src/imports-injector.ts @@ -3,23 +3,31 @@ import { types as t } from "@babel/core"; type StrMap = Map; -export default class ImportsCache { +export default class ImportsCachedInjector { _imports: WeakMap, StrMap>; _anonymousImports: WeakMap, Set>; - _lastImports: WeakMap, NodePath>; + _lastImports: WeakMap< + NodePath, + Array<{ path: NodePath; index: number }> + >; _resolver: (url: string) => string; + _getPreferredIndex: (url: string) => number; - constructor(resolver: (url: string) => string) { + constructor( + resolver: (url: string) => string, + getPreferredIndex: (url: string) => number, + ) { this._imports = new WeakMap(); this._anonymousImports = new WeakMap(); this._lastImports = new WeakMap(); this._resolver = resolver; + this._getPreferredIndex = getPreferredIndex; } storeAnonymous( programPath: NodePath, url: string, - // eslint-disable-next-line no-undef + moduleName: string, getVal: (isScript: boolean, source: t.StringLiteral) => t.Node, ) { const key = this._normalizeKey(programPath, url); @@ -36,13 +44,14 @@ export default class ImportsCache { t.stringLiteral(this._resolver(url)), ); imports.add(key); - this._injectImport(programPath, node); + this._injectImport(programPath, node, moduleName); } storeNamed( programPath: NodePath, url: string, name: string, + moduleName: string, getVal: ( isScript: boolean, // eslint-disable-next-line no-undef @@ -65,51 +74,56 @@ export default class ImportsCache { t.identifier(name), ); imports.set(key, id); - this._injectImport(programPath, node); + this._injectImport(programPath, node, moduleName); } return t.identifier(imports.get(key)); } - _injectImport(programPath: NodePath, node: t.Node) { - const lastImport = this._lastImports.get(programPath); - let newNodes: [NodePath]; - if ( - lastImport && - lastImport.node && + _injectImport( + programPath: NodePath, + node: t.Node, + moduleName: string, + ) { + const newIndex = this._getPreferredIndex(moduleName); + const lastImports = this._lastImports.get(programPath) ?? []; + + const isPathStillValid = (path: NodePath) => + path.node && // Sometimes the AST is modified and the "last import" // we have has been replaced - lastImport.parent === programPath.node && - lastImport.container === programPath.node.body - ) { - newNodes = lastImport.insertAfter(node); - } else { - newNodes = programPath.unshiftContainer("body", node); - } - const newNode = newNodes[newNodes.length - 1]; - this._lastImports.set(programPath, newNode); - - /* - let lastImport; - - programPath.get("body").forEach(path => { - if (path.isImportDeclaration()) lastImport = path; - if ( - path.isExpressionStatement() && - isRequireCall(path.get("expression")) - ) { - lastImport = path; + path.parent === programPath.node && + path.container === programPath.node.body; + + let last: NodePath; + + if (newIndex === Infinity) { + // Fast path: we can always just insert at the end if newIndex is `Infinity` + if (lastImports.length > 0) { + last = lastImports[lastImports.length - 1].path; + if (!isPathStillValid(last)) last = undefined; } - if ( - path.isVariableDeclaration() && - path.get("declarations").length === 1 && - (isRequireCall(path.get("declarations.0.init")) || - (path.get("declarations.0.init").isMemberExpression() && - isRequireCall(path.get("declarations.0.init.object")))) - ) { - lastImport = path; + } else { + for (const [i, data] of lastImports.entries()) { + const { path, index } = data; + if (isPathStillValid(path)) { + if (newIndex < index) { + const [newPath] = path.insertBefore(node); + lastImports.splice(i, 0, { path: newPath, index: newIndex }); + return; + } + last = path; + } } - });*/ + } + + if (last) { + const [newPath] = last.insertAfter(node); + lastImports.push({ path: newPath, index: newIndex }); + } else { + const [newPath] = programPath.unshiftContainer("body", node); + this._lastImports.set(programPath, [{ path: newPath, index: newIndex }]); + } } _ensure | Set>( diff --git a/packages/babel-helper-define-polyfill-provider/src/index.ts b/packages/babel-helper-define-polyfill-provider/src/index.ts index 143e215c..bec694bc 100644 --- a/packages/babel-helper-define-polyfill-provider/src/index.ts +++ b/packages/babel-helper-define-polyfill-provider/src/index.ts @@ -8,7 +8,7 @@ import _getTargets, { const getTargets = _getTargets.default || _getTargets; import { createUtilsGetter } from "./utils"; -import ImportsCache from "./imports-cache"; +import ImportsCachedInjector from "./imports-injector"; import { stringifyTargetsMultiline, presetEnvSilentDebugHeader, @@ -163,18 +163,19 @@ function instantiateProvider( absoluteImports, } = resolveOptions(options, babelApi); - const getUtils = createUtilsGetter( - new ImportsCache(moduleName => - deps.resolve(dirname, moduleName, absoluteImports), - ), - ); - // eslint-disable-next-line prefer-const let include, exclude; let polyfillsSupport; - let polyfillsNames; + let polyfillsNames: Map | undefined; let filterPolyfills; + const getUtils = createUtilsGetter( + new ImportsCachedInjector( + moduleName => deps.resolve(dirname, moduleName, absoluteImports), + (name: string) => polyfillsNames?.get(name) ?? Infinity, + ), + ); + const depsCache = new Map(); const api: ProviderApi = { @@ -256,14 +257,18 @@ function instantiateProvider( } if (Array.isArray(provider.polyfills)) { - polyfillsNames = new Set(provider.polyfills); + polyfillsNames = new Map( + provider.polyfills.map((name, index) => [name, index]), + ); filterPolyfills = provider.filterPolyfills; } else if (provider.polyfills) { - polyfillsNames = new Set(Object.keys(provider.polyfills)); + polyfillsNames = new Map( + Object.keys(provider.polyfills).map((name, index) => [name, index]), + ); polyfillsSupport = provider.polyfills; filterPolyfills = provider.filterPolyfills; } else { - polyfillsNames = new Set(); + polyfillsNames = new Map(); } ({ include, exclude } = validateIncludeExclude( diff --git a/packages/babel-helper-define-polyfill-provider/src/normalize-options.ts b/packages/babel-helper-define-polyfill-provider/src/normalize-options.ts index 84940a96..5fad84f1 100644 --- a/packages/babel-helper-define-polyfill-provider/src/normalize-options.ts +++ b/packages/babel-helper-define-polyfill-provider/src/normalize-options.ts @@ -33,7 +33,7 @@ function buldDuplicatesError(duplicates) { export function validateIncludeExclude( provider: string, - polyfills: Set, + polyfills: Map, includePatterns: Pattern[], excludePatterns: Pattern[], ) { @@ -43,7 +43,7 @@ export function validateIncludeExclude( if (!regexp) return false; let matched = false; - for (const polyfill of polyfills) { + for (const polyfill of polyfills.keys()) { if (regexp.test(polyfill)) { matched = true; current.add(polyfill); diff --git a/packages/babel-helper-define-polyfill-provider/src/types.ts b/packages/babel-helper-define-polyfill-provider/src/types.ts index 0ba39b51..85e04de4 100644 --- a/packages/babel-helper-define-polyfill-provider/src/types.ts +++ b/packages/babel-helper-define-polyfill-provider/src/types.ts @@ -64,9 +64,18 @@ export type ProviderApi = { }; export type Utils = { - injectGlobalImport(url: string): void; - injectNamedImport(url: string, name: string, hint?: string): t.Identifier; - injectDefaultImport(url: string, hint?: string): t.Identifier; + injectGlobalImport(url: string, moduleName?: string): void; + injectNamedImport( + url: string, + name: string, + hint?: string, + moduleName?: string, + ): t.Identifier; + injectDefaultImport( + url: string, + hint?: string, + moduleName?: string, + ): t.Identifier; }; export type ProviderResult = { diff --git a/packages/babel-helper-define-polyfill-provider/src/utils.ts b/packages/babel-helper-define-polyfill-provider/src/utils.ts index dddd0d7e..8a5168a5 100644 --- a/packages/babel-helper-define-polyfill-provider/src/utils.ts +++ b/packages/babel-helper-define-polyfill-provider/src/utils.ts @@ -1,7 +1,7 @@ import { types as t, template } from "@babel/core"; import type { NodePath } from "@babel/traverse"; import type { Utils } from "./types"; -import type ImportsCache from "./imports-cache"; +import type ImportsCachedInjector from "./imports-injector"; export function intersection(a: Set, b: Set): Set { const result = new Set(); @@ -126,41 +126,53 @@ function hoist(node: t.Node) { return node; } -export function createUtilsGetter(cache: ImportsCache) { +export function createUtilsGetter(cache: ImportsCachedInjector) { return (path: NodePath): Utils => { const prog = path.findParent(p => p.isProgram()) as NodePath; return { - injectGlobalImport(url) { - cache.storeAnonymous(prog, url, (isScript, source) => { + injectGlobalImport(url, moduleName) { + cache.storeAnonymous(prog, url, moduleName, (isScript, source) => { return isScript ? template.statement.ast`require(${source})` : t.importDeclaration([], source); }); }, - injectNamedImport(url, name, hint = name) { - return cache.storeNamed(prog, url, name, (isScript, source, name) => { - const id = prog.scope.generateUidIdentifier(hint); - return { - node: isScript - ? hoist(template.statement.ast` + injectNamedImport(url, name, hint = name, moduleName) { + return cache.storeNamed( + prog, + url, + name, + moduleName, + (isScript, source, name) => { + const id = prog.scope.generateUidIdentifier(hint); + return { + node: isScript + ? hoist(template.statement.ast` var ${id} = require(${source}).${name} `) - : t.importDeclaration([t.importSpecifier(id, name)], source), - name: id.name, - }; - }); + : t.importDeclaration([t.importSpecifier(id, name)], source), + name: id.name, + }; + }, + ); }, - injectDefaultImport(url, hint = url) { - return cache.storeNamed(prog, url, "default", (isScript, source) => { - const id = prog.scope.generateUidIdentifier(hint); - return { - node: isScript - ? hoist(template.statement.ast`var ${id} = require(${source})`) - : t.importDeclaration([t.importDefaultSpecifier(id)], source), - name: id.name, - }; - }); + injectDefaultImport(url, hint = url, moduleName) { + return cache.storeNamed( + prog, + url, + "default", + moduleName, + (isScript, source) => { + const id = prog.scope.generateUidIdentifier(hint); + return { + node: isScript + ? hoist(template.statement.ast`var ${id} = require(${source})`) + : t.importDeclaration([t.importDefaultSpecifier(id)], source), + name: id.name, + }; + }, + ); }, }; }; diff --git a/packages/babel-plugin-polyfill-corejs3/src/index.ts b/packages/babel-plugin-polyfill-corejs3/src/index.ts index 607510bd..4fc73db7 100644 --- a/packages/babel-plugin-polyfill-corejs3/src/index.ts +++ b/packages/babel-plugin-polyfill-corejs3/src/index.ts @@ -93,7 +93,7 @@ export default defineProvider(function ( function maybeInjectGlobalImpl(name: string, utils) { if (shouldInjectPolyfill(name)) { debug(name); - utils.injectGlobalImport(coreJSModule(name)); + utils.injectGlobalImport(coreJSModule(name), name); return true; } return false; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/entries-features-chrome-71/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/entries-features-chrome-71/output.mjs index 799439dd..71011e63 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/entries-features-chrome-71/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/entries-features-chrome-71/output.mjs @@ -1,3 +1,4 @@ +import "core-js/modules/es.object.from-entries.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"; @@ -16,5 +17,4 @@ 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/es.object.from-entries.js"; import "core-js/modules/esnext.string.replace-all.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/entries-features/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/entries-features/output.mjs index c67124b2..6f3c6d93 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/entries-features/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/entries-features/output.mjs @@ -1,7 +1,11 @@ +import "core-js/modules/es.array.from.js"; import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.object.from-entries.js"; import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.regexp.exec.js"; import "core-js/modules/es.set.js"; import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.replace.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"; @@ -20,9 +24,5 @@ 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/web.dom-collections.iterator.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/es.string.replace.js"; import "core-js/modules/esnext.string.replace-all.js"; +import "core-js/modules/web.dom-collections.iterator.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/entries-stable/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/entries-stable/output.mjs index 21776b91..013b99c3 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/entries-stable/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/entries-stable/output.mjs @@ -1,7 +1,7 @@ +import "core-js/modules/es.array.from.js"; import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.object.from-entries.js"; import "core-js/modules/es.object.to-string.js"; import "core-js/modules/es.set.js"; import "core-js/modules/es.string.iterator.js"; import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.object.from-entries.js"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/normalization/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/normalization/output.mjs index 950ff459..e291fc7d 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/normalization/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/entry-global/normalization/output.mjs @@ -1,11 +1,11 @@ +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.array.from.js"; import "core-js/modules/es.array.iterator.js"; import "core-js/modules/es.map.js"; import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/es.array.from.js"; import "core-js/modules/es.promise.js"; import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.symbol.iterator.js"; -import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.iterator.js"; import 'foo/index.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 d3c68163..db251beb 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 @@ -1,28 +1,28 @@ -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.string.match.js"; import "core-js/modules/es.symbol.js"; import "core-js/modules/es.symbol.description.js"; import "core-js/modules/es.symbol.iterator.js"; -import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/es.global-this.js"; +import "core-js/modules/es.symbol.match.js"; import "core-js/modules/es.error.cause.js"; import "core-js/modules/es.error.to-string.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.global-this.js"; +import "core-js/modules/es.map.js"; import "core-js/modules/es.object.keys.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.regexp.exec.js"; 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/web.btoa.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.queue-microtask.js"; import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/web.btoa.js"; -import "core-js/modules/esnext.array.with.js"; Array.from; // static method Map; // built-in new Promise(); // new builtin 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 51287a00..8899c361 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,41 +1,41 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.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.object.to-string.js"; -import "core-js/modules/es.promise.js"; import "core-js/modules/es.array.for-each.js"; -import "core-js/modules/web.dom-collections.for-each.js"; import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.push.js"; import "core-js/modules/es.map.js"; import "core-js/modules/es.number.constructor.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.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.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.match-all.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.string.match-all.js"; -import "core-js/modules/es.regexp.exec.js"; import "core-js/modules/es.string.replace.js"; import "core-js/modules/es.string.replace-all.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url-search-params.js"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/es.error.to-string.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/esnext.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"; 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/es.object.keys.js"; -import "core-js/modules/es.set.js"; import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/web.btoa.js"; -import "core-js/modules/esnext.array.with.js"; -import "core-js/modules/es.object.proto.js"; -import "core-js/modules/es.string.from-code-point.js"; -import "core-js/modules/es.weak-map.js"; -import "core-js/modules/es.error.cause.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url-search-params.js"; [].findLast(fn); [].findLastIndex(fn); [].asIndexedPairs(); 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 0f03d672..dd1bf216 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 @@ -1,46 +1,46 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.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.object.to-string.js"; -import "core-js/modules/es.promise.js"; import "core-js/modules/es.array.for-each.js"; -import "core-js/modules/web.dom-collections.for-each.js"; import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.push.js"; import "core-js/modules/es.map.js"; import "core-js/modules/es.number.constructor.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"; +import "core-js/modules/es.promise.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.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.match-all.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.string.match-all.js"; -import "core-js/modules/es.regexp.exec.js"; import "core-js/modules/es.string.replace.js"; import "core-js/modules/es.string.replace-all.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url-search-params.js"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/es.error.to-string.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/es.object.keys.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/web.btoa.js"; +import "core-js/modules/es.weak-map.js"; import "core-js/modules/esnext.array.with.js"; -import "core-js/modules/es.object.proto.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/es.string.from-code-point.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/es.error.cause.js"; -import "core-js/modules/es.object.create.js"; -import "core-js/modules/es.object.freeze.js"; +import "core-js/modules/web.structured-clone.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url-search-params.js"; [].findLast(fn); [].findLastIndex(fn); [].asIndexedPairs(); 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 e7303cf6..cfe011ae 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 @@ -1,46 +1,46 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.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.object.to-string.js"; -import "core-js/modules/es.promise.js"; import "core-js/modules/es.array.for-each.js"; -import "core-js/modules/web.dom-collections.for-each.js"; import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.array.with.js"; import "core-js/modules/es.map.js"; import "core-js/modules/es.number.constructor.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"; +import "core-js/modules/es.promise.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.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.match-all.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.string.match-all.js"; -import "core-js/modules/es.regexp.exec.js"; import "core-js/modules/es.string.replace.js"; import "core-js/modules/es.string.replace-all.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url-search-params.js"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/es.error.to-string.js"; +import "core-js/modules/es.weak-map.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/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/es.object.keys.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/web.btoa.js"; -import "core-js/modules/es.array.with.js"; -import "core-js/modules/es.object.proto.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/es.string.from-code-point.js"; -import "core-js/modules/es.weak-map.js"; import "core-js/modules/web.self.js"; -import "core-js/modules/es.error.cause.js"; -import "core-js/modules/es.object.create.js"; -import "core-js/modules/es.object.freeze.js"; +import "core-js/modules/web.structured-clone.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url-search-params.js"; [].findLast(fn); [].findLastIndex(fn); [].asIndexedPairs(); 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 c7bbbd7e..f02a8342 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 @@ -1,47 +1,47 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.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.object.to-string.js"; -import "core-js/modules/es.promise.js"; import "core-js/modules/es.array.for-each.js"; -import "core-js/modules/web.dom-collections.for-each.js"; import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.array.with.js"; import "core-js/modules/es.map.js"; import "core-js/modules/es.number.constructor.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"; +import "core-js/modules/es.promise.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.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.match-all.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.string.match-all.js"; -import "core-js/modules/es.regexp.exec.js"; import "core-js/modules/es.string.replace.js"; import "core-js/modules/es.string.replace-all.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url-search-params.js"; -import "core-js/modules/web.url-search-params.size.js"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/es.error.to-string.js"; +import "core-js/modules/es.weak-map.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/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/es.object.keys.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/web.btoa.js"; -import "core-js/modules/es.array.with.js"; -import "core-js/modules/es.object.proto.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/es.string.from-code-point.js"; -import "core-js/modules/es.weak-map.js"; import "core-js/modules/web.self.js"; -import "core-js/modules/es.error.cause.js"; -import "core-js/modules/es.object.create.js"; -import "core-js/modules/es.object.freeze.js"; +import "core-js/modules/web.structured-clone.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/web.url-search-params.size.js"; [].findLast(fn); [].findLastIndex(fn); [].asIndexedPairs(); 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 09af56a8..d486348b 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 @@ -1,49 +1,49 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.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.object.to-string.js"; -import "core-js/modules/es.promise.js"; import "core-js/modules/es.array.for-each.js"; -import "core-js/modules/web.dom-collections.for-each.js"; import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.array.with.js"; import "core-js/modules/es.map.js"; import "core-js/modules/es.number.constructor.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"; +import "core-js/modules/es.promise.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.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.match-all.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.string.match-all.js"; -import "core-js/modules/es.regexp.exec.js"; import "core-js/modules/es.string.replace.js"; import "core-js/modules/es.string.replace-all.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url-search-params.js"; -import "core-js/modules/web.url-search-params.size.js"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/es.error.to-string.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/esnext.map.group-by.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/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/es.object.keys.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/web.btoa.js"; -import "core-js/modules/es.array.with.js"; -import "core-js/modules/es.object.proto.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/es.string.from-code-point.js"; -import "core-js/modules/es.weak-map.js"; import "core-js/modules/web.self.js"; -import "core-js/modules/es.error.cause.js"; -import "core-js/modules/es.object.create.js"; -import "core-js/modules/es.object.freeze.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/esnext.map.group-by.js"; +import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/web.url-search-params.size.js"; [].findLast(fn); [].findLastIndex(fn); [].asIndexedPairs(); 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 0f796381..280f6d00 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 @@ -1,55 +1,55 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.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.object.to-string.js"; -import "core-js/modules/es.promise.js"; import "core-js/modules/es.array.for-each.js"; -import "core-js/modules/web.dom-collections.for-each.js"; import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.array.with.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.number.constructor.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"; +import "core-js/modules/es.promise.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.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.match-all.js"; +import "core-js/modules/es.set.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.regexp.exec.js"; import "core-js/modules/es.string.replace.js"; import "core-js/modules/es.string.replace-all.js"; -import "core-js/modules/web.url.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"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/es.error.to-string.js"; +import "core-js/modules/es.string.to-well-formed.js"; +import "core-js/modules/es.weak-map.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"; +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/es.object.keys.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/web.btoa.js"; -import "core-js/modules/es.array.with.js"; -import "core-js/modules/es.object.proto.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.string.from-code-point.js"; -import "core-js/modules/es.weak-map.js"; import "core-js/modules/web.self.js"; -import "core-js/modules/es.error.cause.js"; -import "core-js/modules/es.object.create.js"; -import "core-js/modules/es.object.freeze.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/esnext.object.group-by.js"; -import "core-js/modules/esnext.map.group-by.js"; -import "core-js/modules/esnext.promise.with-resolvers.js"; -import "core-js/modules/es.array-buffer.slice.js"; -import "core-js/modules/es.data-view.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(); 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 1c3caa64..8b773747 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 @@ -1,57 +1,57 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.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.object.to-string.js"; -import "core-js/modules/es.promise.js"; import "core-js/modules/es.array.for-each.js"; -import "core-js/modules/web.dom-collections.for-each.js"; import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.array.with.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.number.constructor.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"; +import "core-js/modules/es.promise.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.sticky.js"; -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.match-all.js"; +import "core-js/modules/es.regexp.to-string.js"; +import "core-js/modules/es.set.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.regexp.exec.js"; import "core-js/modules/es.string.replace.js"; import "core-js/modules/es.string.replace-all.js"; -import "core-js/modules/web.url.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"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/es.error.to-string.js"; +import "core-js/modules/es.string.to-well-formed.js"; +import "core-js/modules/es.weak-map.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"; +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/es.object.keys.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/web.btoa.js"; -import "core-js/modules/es.array.with.js"; -import "core-js/modules/es.object.proto.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.string.from-code-point.js"; -import "core-js/modules/es.weak-map.js"; import "core-js/modules/web.self.js"; -import "core-js/modules/es.error.cause.js"; -import "core-js/modules/es.object.create.js"; -import "core-js/modules/es.object.freeze.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/esnext.object.group-by.js"; -import "core-js/modules/esnext.map.group-by.js"; -import "core-js/modules/esnext.promise.with-resolvers.js"; -import "core-js/modules/es.array-buffer.slice.js"; -import "core-js/modules/es.data-view.js"; -import "core-js/modules/es.regexp.constructor.js"; -import "core-js/modules/es.regexp.to-string.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(); 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 d13517d6..6e94dbfe 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 @@ -1,57 +1,40 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.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.object.to-string.js"; -import "core-js/modules/es.promise.js"; import "core-js/modules/es.array.for-each.js"; -import "core-js/modules/web.dom-collections.for-each.js"; import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.array.with.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.number.constructor.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"; +import "core-js/modules/es.promise.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.sticky.js"; -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.match-all.js"; +import "core-js/modules/es.regexp.to-string.js"; +import "core-js/modules/es.set.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.regexp.exec.js"; import "core-js/modules/es.string.replace.js"; import "core-js/modules/es.string.replace-all.js"; -import "core-js/modules/web.url.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"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/es.error.to-string.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/es.object.keys.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/web.btoa.js"; -import "core-js/modules/es.array.with.js"; -import "core-js/modules/es.object.proto.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.string.from-code-point.js"; -import "core-js/modules/es.weak-map.js"; -import "core-js/modules/web.self.js"; -import "core-js/modules/es.error.cause.js"; -import "core-js/modules/es.object.create.js"; -import "core-js/modules/es.object.freeze.js"; -import "core-js/modules/web.url.can-parse.js"; -import "core-js/modules/esnext.object.group-by.js"; -import "core-js/modules/esnext.map.group-by.js"; -import "core-js/modules/esnext.promise.with-resolvers.js"; -import "core-js/modules/es.array-buffer.slice.js"; -import "core-js/modules/es.data-view.js"; -import "core-js/modules/es.regexp.constructor.js"; -import "core-js/modules/es.regexp.to-string.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"; @@ -81,7 +64,24 @@ 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.typed-array.uint8-array.js"; +import "core-js/modules/es.weak-map.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"; +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-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(); 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 7d634bbc..0d56618f 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 @@ -1,57 +1,43 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.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.object.to-string.js"; -import "core-js/modules/es.promise.js"; import "core-js/modules/es.array.for-each.js"; -import "core-js/modules/web.dom-collections.for-each.js"; import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.filter.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.number.constructor.js"; -import "core-js/modules/es.regexp.dot-all.js"; -import "core-js/modules/es.regexp.sticky.js"; -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.match-all.js"; -import "core-js/modules/es.string.match-all.js"; -import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.replace-all.js"; -import "core-js/modules/web.url.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"; import "core-js/modules/es.array.push.js"; -import "core-js/modules/es.error.to-string.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/es.object.keys.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/web.btoa.js"; import "core-js/modules/es.array.with.js"; -import "core-js/modules/es.object.proto.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.string.from-code-point.js"; -import "core-js/modules/es.weak-map.js"; -import "core-js/modules/web.self.js"; -import "core-js/modules/es.error.cause.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.map.group-by.js"; +import "core-js/modules/es.number.constructor.js"; import "core-js/modules/es.object.create.js"; import "core-js/modules/es.object.freeze.js"; -import "core-js/modules/web.url.can-parse.js"; import "core-js/modules/es.object.group-by.js"; -import "core-js/modules/es.map.group-by.js"; +import "core-js/modules/es.object.keys.js"; +import "core-js/modules/es.object.proto.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; import "core-js/modules/es.promise.with-resolvers.js"; -import "core-js/modules/es.array-buffer.slice.js"; -import "core-js/modules/es.data-view.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.sticky.js"; import "core-js/modules/es.regexp.to-string.js"; +import "core-js/modules/es.set.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"; @@ -81,7 +67,21 @@ 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.typed-array.uint8-array.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-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(); 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 718160eb..224ca377 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 @@ -1,32 +1,42 @@ -import "core-js/modules/esnext.async-iterator.constructor.js"; -import "core-js/modules/esnext.async-iterator.to-array.js"; -import "core-js/modules/esnext.iterator.constructor.js"; -import "core-js/modules/esnext.iterator.to-array.js"; -import "core-js/modules/esnext.async-iterator.for-each.js"; -import "core-js/modules/esnext.iterator.for-each.js"; -import "core-js/modules/esnext.iterator.from.js"; -import "core-js/modules/esnext.async-iterator.map.js"; -import "core-js/modules/esnext.iterator.map.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/esnext.suppressed-error.constructor.js"; import "core-js/modules/esnext.array.group-by.js"; -import "core-js/modules/esnext.async-iterator.filter.js"; -import "core-js/modules/esnext.iterator.filter.js"; -import "core-js/modules/esnext.async-iterator.take.js"; -import "core-js/modules/esnext.iterator.take.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.with.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.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.array.unique-by.js"; -import "core-js/modules/esnext.number.range.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.array.is-template-object.js"; -import "core-js/modules/esnext.map.emplace.js"; -import "core-js/modules/esnext.weak-map.emplace.js"; +import "core-js/modules/esnext.disposable-stack.constructor.js"; +import "core-js/modules/esnext.function.is-constructor.js"; +import "core-js/modules/esnext.function.un-this.js"; +import "core-js/modules/esnext.iterator.constructor.js"; +import "core-js/modules/esnext.iterator.dispose.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.indexed.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.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"; @@ -39,26 +49,16 @@ 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.async-iterator.async-dispose.js"; +import "core-js/modules/esnext.number.range.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.array.group-by-to-map.js"; -import "core-js/modules/esnext.function.un-this.js"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/esnext.function.is-constructor.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/esnext.async-iterator.indexed.js"; -import "core-js/modules/esnext.iterator.indexed.js"; -import "core-js/modules/esnext.array.with.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.string.dedent.js"; -import "core-js/modules/esnext.suppressed-error.constructor.js"; -import "core-js/modules/esnext.disposable-stack.constructor.js"; -import "core-js/modules/esnext.iterator.dispose.js"; -import "core-js/modules/esnext.async-disposable-stack.constructor.js"; [].findLast(fn); [].findLastIndex(fn); [].asIndexedPairs(); 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 2960bef0..ecb768f4 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,32 +1,47 @@ -import "core-js/modules/esnext.async-iterator.constructor.js"; -import "core-js/modules/esnext.async-iterator.to-array.js"; -import "core-js/modules/esnext.iterator.constructor.js"; -import "core-js/modules/esnext.iterator.to-array.js"; -import "core-js/modules/esnext.async-iterator.for-each.js"; -import "core-js/modules/esnext.iterator.for-each.js"; -import "core-js/modules/esnext.iterator.from.js"; -import "core-js/modules/esnext.async-iterator.map.js"; -import "core-js/modules/esnext.iterator.map.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.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.async-iterator.filter.js"; -import "core-js/modules/esnext.iterator.filter.js"; -import "core-js/modules/esnext.async-iterator.take.js"; -import "core-js/modules/esnext.iterator.take.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.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.array.unique-by.js"; -import "core-js/modules/esnext.number.range.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.array.is-template-object.js"; -import "core-js/modules/esnext.map.emplace.js"; -import "core-js/modules/esnext.weak-map.emplace.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.un-this.js"; +import "core-js/modules/esnext.iterator.constructor.js"; +import "core-js/modules/esnext.iterator.dispose.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.indexed.js"; +import "core-js/modules/esnext.iterator.map.js"; +import "core-js/modules/esnext.iterator.range.js"; +import "core-js/modules/esnext.iterator.take.js"; +import "core-js/modules/esnext.iterator.to-array.js"; +import "core-js/modules/esnext.json.is-raw-json.js"; +import "core-js/modules/esnext.json.parse.js"; +import "core-js/modules/esnext.json.raw-json.js"; import "core-js/modules/esnext.map.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"; @@ -39,33 +54,7 @@ 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.async-iterator.async-dispose.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.array.group-by-to-map.js"; -import "core-js/modules/esnext.function.un-this.js"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/esnext.function.is-constructor.js"; -import "core-js/modules/web.dom-exception.stack.js"; -import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/esnext.async-iterator.indexed.js"; -import "core-js/modules/esnext.iterator.indexed.js"; -import "core-js/modules/es.array.with.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.string.dedent.js"; -import "core-js/modules/esnext.suppressed-error.constructor.js"; -import "core-js/modules/esnext.disposable-stack.constructor.js"; -import "core-js/modules/esnext.iterator.dispose.js"; -import "core-js/modules/esnext.async-disposable-stack.constructor.js"; -import "core-js/modules/esnext.iterator.range.js"; -import "core-js/modules/esnext.json.parse.js"; -import "core-js/modules/esnext.json.is-raw-json.js"; -import "core-js/modules/esnext.json.raw-json.js"; -import "core-js/modules/esnext.symbol.is-well-known.js"; -import "core-js/modules/esnext.symbol.is-registered.js"; -import "core-js/modules/esnext.function.demethodize.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"; @@ -89,6 +78,17 @@ 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.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/web.dom-exception.stack.js"; +import "core-js/modules/web.structured-clone.js"; [].findLast(fn); [].findLastIndex(fn); [].asIndexedPairs(); 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 2b6beb6f..1118c312 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,32 +1,47 @@ -import "core-js/modules/esnext.async-iterator.constructor.js"; -import "core-js/modules/esnext.async-iterator.to-array.js"; -import "core-js/modules/esnext.iterator.constructor.js"; -import "core-js/modules/esnext.iterator.to-array.js"; -import "core-js/modules/esnext.async-iterator.for-each.js"; -import "core-js/modules/esnext.iterator.for-each.js"; -import "core-js/modules/esnext.iterator.from.js"; -import "core-js/modules/esnext.async-iterator.map.js"; -import "core-js/modules/esnext.iterator.map.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.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.async-iterator.filter.js"; -import "core-js/modules/esnext.iterator.filter.js"; -import "core-js/modules/esnext.async-iterator.take.js"; -import "core-js/modules/esnext.iterator.take.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.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.array.unique-by.js"; -import "core-js/modules/esnext.number.range.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.array.is-template-object.js"; -import "core-js/modules/esnext.map.emplace.js"; -import "core-js/modules/esnext.weak-map.emplace.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.un-this.js"; +import "core-js/modules/esnext.iterator.constructor.js"; +import "core-js/modules/esnext.iterator.dispose.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.indexed.js"; +import "core-js/modules/esnext.iterator.map.js"; +import "core-js/modules/esnext.iterator.range.js"; +import "core-js/modules/esnext.iterator.take.js"; +import "core-js/modules/esnext.iterator.to-array.js"; +import "core-js/modules/esnext.json.is-raw-json.js"; +import "core-js/modules/esnext.json.parse.js"; +import "core-js/modules/esnext.json.raw-json.js"; import "core-js/modules/esnext.map.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"; @@ -39,34 +54,7 @@ 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.async-iterator.async-dispose.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/web.url-search-params.size.js"; -import "core-js/modules/esnext.array.group-by-to-map.js"; -import "core-js/modules/esnext.function.un-this.js"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/esnext.function.is-constructor.js"; -import "core-js/modules/web.dom-exception.stack.js"; -import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/esnext.async-iterator.indexed.js"; -import "core-js/modules/esnext.iterator.indexed.js"; -import "core-js/modules/es.array.with.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.string.dedent.js"; -import "core-js/modules/esnext.suppressed-error.constructor.js"; -import "core-js/modules/esnext.disposable-stack.constructor.js"; -import "core-js/modules/esnext.iterator.dispose.js"; -import "core-js/modules/esnext.async-disposable-stack.constructor.js"; -import "core-js/modules/esnext.iterator.range.js"; -import "core-js/modules/esnext.json.parse.js"; -import "core-js/modules/esnext.json.is-raw-json.js"; -import "core-js/modules/esnext.json.raw-json.js"; -import "core-js/modules/esnext.symbol.is-well-known.js"; -import "core-js/modules/esnext.symbol.is-registered.js"; -import "core-js/modules/esnext.function.demethodize.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"; @@ -90,6 +78,18 @@ 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.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/web.dom-exception.stack.js"; +import "core-js/modules/web.structured-clone.js"; +import "core-js/modules/web.url-search-params.size.js"; [].findLast(fn); [].findLastIndex(fn); [].asIndexedPairs(); 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 d27e3251..04b3f8ec 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,36 +1,52 @@ -import "core-js/modules/esnext.async-iterator.constructor.js"; -import "core-js/modules/esnext.async-iterator.to-array.js"; -import "core-js/modules/esnext.iterator.constructor.js"; -import "core-js/modules/esnext.iterator.to-array.js"; -import "core-js/modules/esnext.async-iterator.for-each.js"; -import "core-js/modules/esnext.iterator.for-each.js"; -import "core-js/modules/esnext.iterator.from.js"; -import "core-js/modules/esnext.async-iterator.map.js"; -import "core-js/modules/esnext.iterator.map.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.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.async-iterator.filter.js"; -import "core-js/modules/esnext.iterator.filter.js"; -import "core-js/modules/esnext.async-iterator.take.js"; -import "core-js/modules/esnext.iterator.take.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.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.array.unique-by.js"; -import "core-js/modules/esnext.number.range.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.array.is-template-object.js"; -import "core-js/modules/esnext.map.emplace.js"; -import "core-js/modules/esnext.weak-map.emplace.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.un-this.js"; +import "core-js/modules/esnext.iterator.constructor.js"; +import "core-js/modules/esnext.iterator.dispose.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.indexed.js"; +import "core-js/modules/esnext.iterator.map.js"; +import "core-js/modules/esnext.iterator.range.js"; +import "core-js/modules/esnext.iterator.take.js"; +import "core-js/modules/esnext.iterator.to-array.js"; +import "core-js/modules/esnext.json.is-raw-json.js"; +import "core-js/modules/esnext.json.parse.js"; +import "core-js/modules/esnext.json.raw-json.js"; import "core-js/modules/esnext.map.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.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"; @@ -39,34 +55,7 @@ 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.async-iterator.async-dispose.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/web.url-search-params.size.js"; -import "core-js/modules/esnext.array.group-by-to-map.js"; -import "core-js/modules/esnext.function.un-this.js"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/esnext.function.is-constructor.js"; -import "core-js/modules/web.dom-exception.stack.js"; -import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/esnext.async-iterator.indexed.js"; -import "core-js/modules/esnext.iterator.indexed.js"; -import "core-js/modules/es.array.with.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.string.dedent.js"; -import "core-js/modules/esnext.suppressed-error.constructor.js"; -import "core-js/modules/esnext.disposable-stack.constructor.js"; -import "core-js/modules/esnext.iterator.dispose.js"; -import "core-js/modules/esnext.async-disposable-stack.constructor.js"; -import "core-js/modules/esnext.iterator.range.js"; -import "core-js/modules/esnext.json.parse.js"; -import "core-js/modules/esnext.json.is-raw-json.js"; -import "core-js/modules/esnext.json.raw-json.js"; -import "core-js/modules/esnext.symbol.is-well-known.js"; -import "core-js/modules/esnext.symbol.is-registered.js"; -import "core-js/modules/esnext.function.demethodize.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"; @@ -90,8 +79,19 @@ 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.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/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/esnext.map.group-by.js"; +import "core-js/modules/web.url-search-params.size.js"; [].findLast(fn); [].findLastIndex(fn); [].asIndexedPairs(); 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 d67ef287..a123a4f7 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 @@ -1,36 +1,55 @@ -import "core-js/modules/esnext.async-iterator.constructor.js"; -import "core-js/modules/esnext.async-iterator.to-array.js"; -import "core-js/modules/esnext.iterator.constructor.js"; -import "core-js/modules/esnext.iterator.to-array.js"; -import "core-js/modules/esnext.async-iterator.for-each.js"; -import "core-js/modules/esnext.iterator.for-each.js"; -import "core-js/modules/esnext.iterator.from.js"; -import "core-js/modules/esnext.async-iterator.map.js"; -import "core-js/modules/esnext.iterator.map.js"; +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/esnext.suppressed-error.constructor.js"; import "core-js/modules/esnext.array.group-by.js"; -import "core-js/modules/esnext.async-iterator.filter.js"; -import "core-js/modules/esnext.iterator.filter.js"; -import "core-js/modules/esnext.async-iterator.take.js"; -import "core-js/modules/esnext.iterator.take.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.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.array.unique-by.js"; -import "core-js/modules/esnext.number.range.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.array.is-template-object.js"; -import "core-js/modules/esnext.map.emplace.js"; -import "core-js/modules/esnext.weak-map.emplace.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.constructor.js"; +import "core-js/modules/esnext.iterator.dispose.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.indexed.js"; +import "core-js/modules/esnext.iterator.map.js"; +import "core-js/modules/esnext.iterator.range.js"; +import "core-js/modules/esnext.iterator.take.js"; +import "core-js/modules/esnext.iterator.to-array.js"; +import "core-js/modules/esnext.json.is-raw-json.js"; +import "core-js/modules/esnext.json.parse.js"; +import "core-js/modules/esnext.json.raw-json.js"; import "core-js/modules/esnext.map.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.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"; @@ -39,37 +58,9 @@ 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.async-iterator.async-dispose.js"; -import "core-js/modules/esnext.symbol.async-dispose.js"; -import "core-js/modules/esnext.symbol.matcher.js"; -import "core-js/modules/esnext.function.metadata.js"; -import "core-js/modules/esnext.symbol.metadata.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"; -import "core-js/modules/esnext.array.group-by-to-map.js"; -import "core-js/modules/esnext.function.un-this.js"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/esnext.function.is-constructor.js"; -import "core-js/modules/web.dom-exception.stack.js"; -import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/esnext.async-iterator.indexed.js"; -import "core-js/modules/esnext.iterator.indexed.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/esnext.string.dedent.js"; -import "core-js/modules/esnext.suppressed-error.constructor.js"; -import "core-js/modules/esnext.disposable-stack.constructor.js"; -import "core-js/modules/esnext.iterator.dispose.js"; -import "core-js/modules/esnext.async-disposable-stack.constructor.js"; -import "core-js/modules/esnext.iterator.range.js"; -import "core-js/modules/esnext.json.parse.js"; -import "core-js/modules/esnext.json.is-raw-json.js"; -import "core-js/modules/esnext.json.raw-json.js"; -import "core-js/modules/esnext.symbol.is-well-known.js"; -import "core-js/modules/esnext.symbol.is-registered.js"; -import "core-js/modules/esnext.function.demethodize.js"; +import "core-js/modules/esnext.number.range.js"; +import "core-js/modules/esnext.object.group-by.js"; +import "core-js/modules/esnext.promise.with-resolvers.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"; @@ -93,12 +84,21 @@ 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/web.url.can-parse.js"; -import "core-js/modules/esnext.symbol.is-well-known-symbol.js"; +import "core-js/modules/esnext.string.dedent.js"; +import "core-js/modules/esnext.symbol.async-dispose.js"; import "core-js/modules/esnext.symbol.is-registered-symbol.js"; -import "core-js/modules/esnext.object.group-by.js"; -import "core-js/modules/esnext.map.group-by.js"; -import "core-js/modules/esnext.promise.with-resolvers.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.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"; +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(); 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 a10bb330..7b45afad 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 @@ -1,36 +1,59 @@ -import "core-js/modules/esnext.async-iterator.constructor.js"; -import "core-js/modules/esnext.async-iterator.to-array.js"; -import "core-js/modules/esnext.iterator.constructor.js"; -import "core-js/modules/esnext.iterator.to-array.js"; -import "core-js/modules/esnext.async-iterator.for-each.js"; -import "core-js/modules/esnext.iterator.for-each.js"; -import "core-js/modules/esnext.iterator.from.js"; -import "core-js/modules/esnext.async-iterator.map.js"; -import "core-js/modules/esnext.iterator.map.js"; +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/esnext.suppressed-error.constructor.js"; import "core-js/modules/esnext.array.group-by.js"; -import "core-js/modules/esnext.async-iterator.filter.js"; -import "core-js/modules/esnext.iterator.filter.js"; -import "core-js/modules/esnext.async-iterator.take.js"; -import "core-js/modules/esnext.iterator.take.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.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.array.unique-by.js"; -import "core-js/modules/esnext.number.range.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.array.is-template-object.js"; -import "core-js/modules/esnext.map.emplace.js"; -import "core-js/modules/esnext.weak-map.emplace.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.constructor.js"; +import "core-js/modules/esnext.iterator.dispose.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.indexed.js"; +import "core-js/modules/esnext.iterator.map.js"; +import "core-js/modules/esnext.iterator.range.js"; +import "core-js/modules/esnext.iterator.take.js"; +import "core-js/modules/esnext.iterator.to-array.js"; +import "core-js/modules/esnext.json.is-raw-json.js"; +import "core-js/modules/esnext.json.parse.js"; +import "core-js/modules/esnext.json.raw-json.js"; import "core-js/modules/esnext.map.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.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"; @@ -39,37 +62,10 @@ 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.async-iterator.async-dispose.js"; -import "core-js/modules/esnext.symbol.async-dispose.js"; -import "core-js/modules/esnext.symbol.matcher.js"; -import "core-js/modules/esnext.function.metadata.js"; -import "core-js/modules/esnext.symbol.metadata.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"; -import "core-js/modules/esnext.array.group-by-to-map.js"; -import "core-js/modules/esnext.function.un-this.js"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/esnext.function.is-constructor.js"; -import "core-js/modules/web.dom-exception.stack.js"; -import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/esnext.async-iterator.indexed.js"; -import "core-js/modules/esnext.iterator.indexed.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/esnext.string.dedent.js"; -import "core-js/modules/esnext.suppressed-error.constructor.js"; -import "core-js/modules/esnext.disposable-stack.constructor.js"; -import "core-js/modules/esnext.iterator.dispose.js"; -import "core-js/modules/esnext.async-disposable-stack.constructor.js"; -import "core-js/modules/esnext.iterator.range.js"; -import "core-js/modules/esnext.json.parse.js"; -import "core-js/modules/esnext.json.is-raw-json.js"; -import "core-js/modules/esnext.json.raw-json.js"; -import "core-js/modules/esnext.symbol.is-well-known.js"; -import "core-js/modules/esnext.symbol.is-registered.js"; -import "core-js/modules/esnext.function.demethodize.js"; +import "core-js/modules/esnext.math.f16round.js"; +import "core-js/modules/esnext.number.range.js"; +import "core-js/modules/esnext.object.group-by.js"; +import "core-js/modules/esnext.promise.with-resolvers.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"; @@ -93,17 +89,21 @@ 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/web.url.can-parse.js"; -import "core-js/modules/esnext.symbol.is-well-known-symbol.js"; +import "core-js/modules/esnext.string.dedent.js"; +import "core-js/modules/esnext.symbol.async-dispose.js"; import "core-js/modules/esnext.symbol.is-registered-symbol.js"; -import "core-js/modules/esnext.object.group-by.js"; -import "core-js/modules/esnext.map.group-by.js"; -import "core-js/modules/esnext.promise.with-resolvers.js"; -import "core-js/modules/esnext.math.f16round.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.data-view.get-uint8-clamped.js"; -import "core-js/modules/esnext.data-view.set-uint8-clamped.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.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"; +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(); 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 a87355b5..f89c75da 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 @@ -1,36 +1,65 @@ -import "core-js/modules/esnext.async-iterator.constructor.js"; -import "core-js/modules/esnext.async-iterator.to-array.js"; -import "core-js/modules/esnext.iterator.constructor.js"; -import "core-js/modules/esnext.iterator.to-array.js"; -import "core-js/modules/esnext.async-iterator.for-each.js"; -import "core-js/modules/esnext.iterator.for-each.js"; -import "core-js/modules/esnext.iterator.from.js"; -import "core-js/modules/esnext.async-iterator.map.js"; -import "core-js/modules/esnext.iterator.map.js"; +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.async-iterator.filter.js"; -import "core-js/modules/esnext.iterator.filter.js"; -import "core-js/modules/esnext.async-iterator.take.js"; -import "core-js/modules/esnext.iterator.take.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"; import "core-js/modules/esnext.async-iterator.drop.js"; -import "core-js/modules/esnext.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.array.unique-by.js"; -import "core-js/modules/esnext.number.range.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.array.is-template-object.js"; -import "core-js/modules/esnext.map.emplace.js"; -import "core-js/modules/esnext.weak-map.emplace.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.constructor.js"; +import "core-js/modules/esnext.iterator.dispose.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.indexed.js"; +import "core-js/modules/esnext.iterator.map.js"; +import "core-js/modules/esnext.iterator.range.js"; +import "core-js/modules/esnext.iterator.take.js"; +import "core-js/modules/esnext.iterator.to-array.js"; +import "core-js/modules/esnext.json.is-raw-json.js"; +import "core-js/modules/esnext.json.parse.js"; +import "core-js/modules/esnext.json.raw-json.js"; import "core-js/modules/esnext.map.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.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"; @@ -39,37 +68,11 @@ 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.async-iterator.async-dispose.js"; -import "core-js/modules/esnext.symbol.async-dispose.js"; -import "core-js/modules/esnext.symbol.matcher.js"; -import "core-js/modules/esnext.function.metadata.js"; -import "core-js/modules/esnext.symbol.metadata.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"; -import "core-js/modules/esnext.array.group-by-to-map.js"; -import "core-js/modules/esnext.function.un-this.js"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/esnext.function.is-constructor.js"; -import "core-js/modules/web.dom-exception.stack.js"; -import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/esnext.async-iterator.indexed.js"; -import "core-js/modules/esnext.iterator.indexed.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/esnext.string.dedent.js"; -import "core-js/modules/esnext.suppressed-error.constructor.js"; -import "core-js/modules/esnext.disposable-stack.constructor.js"; -import "core-js/modules/esnext.iterator.dispose.js"; -import "core-js/modules/esnext.async-disposable-stack.constructor.js"; -import "core-js/modules/esnext.iterator.range.js"; -import "core-js/modules/esnext.json.parse.js"; -import "core-js/modules/esnext.json.is-raw-json.js"; -import "core-js/modules/esnext.json.raw-json.js"; -import "core-js/modules/esnext.symbol.is-well-known.js"; -import "core-js/modules/esnext.symbol.is-registered.js"; -import "core-js/modules/esnext.function.demethodize.js"; +import "core-js/modules/esnext.math.f16round.js"; +import "core-js/modules/esnext.number.range.js"; +import "core-js/modules/esnext.object.group-by.js"; +import "core-js/modules/esnext.promise.with-resolvers.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.v2.js"; @@ -93,28 +96,25 @@ 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/web.url.can-parse.js"; -import "core-js/modules/esnext.symbol.is-well-known-symbol.js"; +import "core-js/modules/esnext.string.dedent.js"; +import "core-js/modules/esnext.symbol.async-dispose.js"; import "core-js/modules/esnext.symbol.is-registered-symbol.js"; -import "core-js/modules/esnext.object.group-by.js"; -import "core-js/modules/esnext.map.group-by.js"; -import "core-js/modules/esnext.promise.with-resolvers.js"; -import "core-js/modules/esnext.math.f16round.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.data-view.get-uint8-clamped.js"; -import "core-js/modules/esnext.data-view.set-uint8-clamped.js"; -import "core-js/modules/esnext.regexp.escape.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.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.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.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"; +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(); 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 b49d17ce..b6bbf7c5 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 @@ -1,32 +1,63 @@ -import "core-js/modules/esnext.async-iterator.constructor.js"; -import "core-js/modules/esnext.async-iterator.to-array.js"; -import "core-js/modules/esnext.iterator.constructor.js"; -import "core-js/modules/esnext.iterator.to-array.js"; -import "core-js/modules/esnext.async-iterator.for-each.js"; -import "core-js/modules/esnext.iterator.for-each.js"; -import "core-js/modules/esnext.iterator.from.js"; -import "core-js/modules/esnext.async-iterator.map.js"; -import "core-js/modules/esnext.iterator.map.js"; +import "core-js/modules/es.array.push.js"; +import "core-js/modules/es.array.with.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.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.async-iterator.filter.js"; -import "core-js/modules/esnext.iterator.filter.js"; -import "core-js/modules/esnext.async-iterator.take.js"; -import "core-js/modules/esnext.iterator.take.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"; import "core-js/modules/esnext.async-iterator.drop.js"; -import "core-js/modules/esnext.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.array.unique-by.js"; -import "core-js/modules/esnext.number.range.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.array.is-template-object.js"; -import "core-js/modules/esnext.map.emplace.js"; -import "core-js/modules/esnext.weak-map.emplace.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.constructor.js"; +import "core-js/modules/esnext.iterator.dispose.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.indexed.js"; +import "core-js/modules/esnext.iterator.map.js"; +import "core-js/modules/esnext.iterator.range.js"; +import "core-js/modules/esnext.iterator.take.js"; +import "core-js/modules/esnext.iterator.to-array.js"; +import "core-js/modules/esnext.json.is-raw-json.js"; +import "core-js/modules/esnext.json.parse.js"; +import "core-js/modules/esnext.json.raw-json.js"; import "core-js/modules/esnext.map.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"; @@ -39,37 +70,9 @@ 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.async-iterator.async-dispose.js"; -import "core-js/modules/esnext.symbol.async-dispose.js"; -import "core-js/modules/esnext.symbol.matcher.js"; -import "core-js/modules/esnext.function.metadata.js"; -import "core-js/modules/esnext.symbol.metadata.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"; -import "core-js/modules/esnext.array.group-by-to-map.js"; -import "core-js/modules/esnext.function.un-this.js"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/esnext.function.is-constructor.js"; -import "core-js/modules/web.dom-exception.stack.js"; -import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/esnext.async-iterator.indexed.js"; -import "core-js/modules/esnext.iterator.indexed.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/esnext.string.dedent.js"; -import "core-js/modules/esnext.suppressed-error.constructor.js"; -import "core-js/modules/esnext.disposable-stack.constructor.js"; -import "core-js/modules/esnext.iterator.dispose.js"; -import "core-js/modules/esnext.async-disposable-stack.constructor.js"; -import "core-js/modules/esnext.iterator.range.js"; -import "core-js/modules/esnext.json.parse.js"; -import "core-js/modules/esnext.json.is-raw-json.js"; -import "core-js/modules/esnext.json.raw-json.js"; -import "core-js/modules/esnext.symbol.is-well-known.js"; -import "core-js/modules/esnext.symbol.is-registered.js"; -import "core-js/modules/esnext.function.demethodize.js"; +import "core-js/modules/esnext.math.f16round.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.v2.js"; @@ -93,32 +96,29 @@ 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/web.url.can-parse.js"; -import "core-js/modules/esnext.symbol.is-well-known-symbol.js"; +import "core-js/modules/esnext.string.dedent.js"; +import "core-js/modules/esnext.symbol.async-dispose.js"; import "core-js/modules/esnext.symbol.is-registered-symbol.js"; -import "core-js/modules/es.object.group-by.js"; -import "core-js/modules/es.map.group-by.js"; -import "core-js/modules/es.promise.with-resolvers.js"; -import "core-js/modules/esnext.math.f16round.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.data-view.get-uint8-clamped.js"; -import "core-js/modules/esnext.data-view.set-uint8-clamped.js"; -import "core-js/modules/esnext.regexp.escape.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.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.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.to-base64.js"; import "core-js/modules/esnext.uint8-array.to-hex.js"; -import "core-js/modules/esnext.uint8-array.from-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"; +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(); 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 109f4274..a75b2aa4 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 @@ -1,34 +1,32 @@ import "core-js/modules/esnext.array.find-last.js"; import "core-js/modules/esnext.array.find-last-index.js"; -import "core-js/modules/esnext.async-iterator.constructor.js"; -import "core-js/modules/esnext.async-iterator.to-array.js"; -import "core-js/modules/esnext.iterator.constructor.js"; -import "core-js/modules/esnext.iterator.to-array.js"; -import "core-js/modules/esnext.async-iterator.for-each.js"; -import "core-js/modules/esnext.iterator.for-each.js"; -import "core-js/modules/esnext.iterator.from.js"; -import "core-js/modules/esnext.async-iterator.map.js"; -import "core-js/modules/esnext.iterator.map.js"; import "core-js/modules/esnext.array.group-by.js"; -import "core-js/modules/esnext.async-iterator.filter.js"; -import "core-js/modules/esnext.iterator.filter.js"; -import "core-js/modules/esnext.async-iterator.take.js"; -import "core-js/modules/esnext.iterator.take.js"; +import "core-js/modules/esnext.array.is-template-object.js"; +import "core-js/modules/esnext.array.unique-by.js"; +import "core-js/modules/esnext.async-iterator.constructor.js"; import "core-js/modules/esnext.async-iterator.drop.js"; -import "core-js/modules/esnext.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.array.unique-by.js"; -import "core-js/modules/esnext.number.range.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.array.is-template-object.js"; -import "core-js/modules/esnext.map.emplace.js"; -import "core-js/modules/esnext.weak-map.emplace.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.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"; @@ -41,9 +39,11 @@ import "core-js/modules/esnext.map.merge.js"; import "core-js/modules/esnext.map.reduce.js"; import "core-js/modules/esnext.map.some.js"; import "core-js/modules/esnext.map.update.js"; +import "core-js/modules/esnext.number.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 cae13e54..867b4345 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 @@ -1,34 +1,40 @@ +import "core-js/modules/es.error.cause.js"; import "core-js/modules/es.array.find-last.js"; import "core-js/modules/es.array.find-last-index.js"; -import "core-js/modules/esnext.async-iterator.constructor.js"; -import "core-js/modules/esnext.async-iterator.to-array.js"; -import "core-js/modules/esnext.iterator.constructor.js"; -import "core-js/modules/esnext.iterator.to-array.js"; -import "core-js/modules/esnext.async-iterator.for-each.js"; -import "core-js/modules/esnext.iterator.for-each.js"; -import "core-js/modules/esnext.iterator.from.js"; -import "core-js/modules/esnext.async-iterator.map.js"; -import "core-js/modules/esnext.iterator.map.js"; +import "core-js/modules/es.array.push.js"; import "core-js/modules/esnext.array.group-by.js"; -import "core-js/modules/esnext.async-iterator.filter.js"; -import "core-js/modules/esnext.iterator.filter.js"; -import "core-js/modules/esnext.async-iterator.take.js"; -import "core-js/modules/esnext.iterator.take.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.with.js"; +import "core-js/modules/esnext.async-iterator.constructor.js"; import "core-js/modules/esnext.async-iterator.drop.js"; -import "core-js/modules/esnext.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.array.unique-by.js"; -import "core-js/modules/esnext.number.range.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.array.is-template-object.js"; -import "core-js/modules/esnext.map.emplace.js"; -import "core-js/modules/esnext.weak-map.emplace.js"; +import "core-js/modules/esnext.function.is-constructor.js"; +import "core-js/modules/esnext.function.un-this.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.indexed.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.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"; @@ -41,19 +47,13 @@ import "core-js/modules/esnext.map.merge.js"; import "core-js/modules/esnext.map.reduce.js"; import "core-js/modules/esnext.map.some.js"; import "core-js/modules/esnext.map.update.js"; +import "core-js/modules/esnext.number.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.array.group-by-to-map.js"; -import "core-js/modules/esnext.function.un-this.js"; -import "core-js/modules/es.array.push.js"; -import "core-js/modules/esnext.function.is-constructor.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/esnext.async-iterator.indexed.js"; -import "core-js/modules/esnext.iterator.indexed.js"; -import "core-js/modules/esnext.array.with.js"; -import "core-js/modules/es.error.cause.js"; [].findLast(fn); [].findLastIndex(fn); [].asIndexedPairs(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-corejs-3.20/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-corejs-3.20/output.mjs index 5ebbd6ea..a63a297b 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-corejs-3.20/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals-corejs-3.20/output.mjs @@ -1,8 +1,24 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.symbol.match.js"; +import "core-js/modules/es.error.cause.js"; +import "core-js/modules/es.error.to-string.js"; import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.global-this.js"; import "core-js/modules/es.map.js"; +import "core-js/modules/es.object.keys.js"; import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.regexp.exec.js"; +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.group-by-to-map.js"; +import "core-js/modules/esnext.array.with.js"; +import "core-js/modules/esnext.async-iterator.constructor.js"; +import "core-js/modules/esnext.iterator.constructor.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"; @@ -17,30 +33,14 @@ 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/web.dom-collections.iterator.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.string.match.js"; -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.iterator.js"; -import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/es.global-this.js"; import "core-js/modules/esnext.observable.js"; import "core-js/modules/esnext.symbol.observable.js"; -import "core-js/modules/es.error.cause.js"; -import "core-js/modules/es.error.to-string.js"; -import "core-js/modules/es.object.keys.js"; -import "core-js/modules/es.set.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.queue-microtask.js"; import "core-js/modules/web.structured-clone.js"; -import "core-js/modules/esnext.array.group-by-to-map.js"; -import "core-js/modules/esnext.async-iterator.constructor.js"; -import "core-js/modules/esnext.iterator.constructor.js"; -import "core-js/modules/esnext.array.with.js"; Array.from; // static method Map; // built-in new Promise(); // new builtin diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals/output.mjs index fe653151..12c9b670 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all-proposals/output.mjs @@ -1,8 +1,16 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.symbol.match.js"; import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.array.iterator.js"; import "core-js/modules/es.map.js"; import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.match.js"; +import "core-js/modules/esnext.global-this.js"; import "core-js/modules/esnext.map.delete-all.js"; import "core-js/modules/esnext.map.every.js"; import "core-js/modules/esnext.map.filter.js"; @@ -16,18 +24,10 @@ 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/web.dom-collections.iterator.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.string.match.js"; -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.iterator.js"; -import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/esnext.global-this.js"; import "core-js/modules/esnext.observable.js"; import "core-js/modules/esnext.symbol.observable.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.queue-microtask.js"; Array.from; // static method Map; // built-in new Promise(); // new builtin diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all/output.mjs index a91585ef..44981d24 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/all/output.mjs @@ -1,18 +1,18 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.symbol.match.js"; import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.array.iterator.js"; import "core-js/modules/es.map.js"; import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/web.dom-collections.iterator.js"; import "core-js/modules/es.promise.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.string.match.js"; -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.iterator.js"; import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.match.js"; import "core-js/modules/esnext.global-this.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.queue-microtask.js"; Array.from; // static method Map; // built-in new Promise(); // new builtin diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/array-flat/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/array-flat/output.mjs index b15f5b2f..f649b006 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/array-flat/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/array-flat/output.mjs @@ -1,6 +1,6 @@ import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.unscopables.flat.js"; import "core-js/modules/es.array.flat-map.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.object.to-string.js"; [].flat(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/async-iterator-problem-case/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/async-iterator-problem-case/output.mjs index c095e8f1..ba33426e 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/async-iterator-problem-case/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/async-iterator-problem-case/output.mjs @@ -1,10 +1,9 @@ import "core-js/modules/es.array.every.js"; +import "core-js/modules/es.array.iterator.js"; import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/esnext.async-iterator.every.js"; -import "core-js/modules/esnext.iterator.constructor.js"; -import "core-js/modules/esnext.iterator.every.js"; import "core-js/modules/es.promise.js"; import "core-js/modules/esnext.async-iterator.constructor.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"; @@ -12,6 +11,7 @@ import "core-js/modules/esnext.async-iterator.for-each.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.iterator.constructor.js"; +import "core-js/modules/esnext.iterator.every.js"; import "core-js/modules/esnext.iterator.to-async.js"; -import "core-js/modules/es.array.iterator.js"; [1, 2, 3].values().toAsync().every(fn); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/decorators/output.js b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/decorators/output.js index 41cc29e0..8da84d90 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/decorators/output.js +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/decorators/output.js @@ -1,9 +1,9 @@ var _applyDecs = require("@babel/runtime-corejs3/helpers/applyDecs2305").default; var _dec, _init_foo; +require("core-js/modules/es.array.iterator.js"); +require("core-js/modules/es.string.iterator.js"); require("core-js/modules/esnext.function.metadata.js"); require("core-js/modules/esnext.symbol.metadata.js"); -require("core-js/modules/es.string.iterator.js"); -require("core-js/modules/es.array.iterator.js"); require("core-js/modules/web.dom-collections.iterator.js"); _dec = dec; class A { diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-assignment/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-assignment/output.mjs index a41346aa..d30f7531 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-assignment/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-assignment/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.string.iterator.js"; import "core-js/modules/web.dom-collections.iterator.js"; [a, b] = c; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-catch/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-catch/output.mjs index 58ccd692..3842ed8f 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-catch/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-catch/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.string.iterator.js"; import "core-js/modules/web.dom-collections.iterator.js"; try { a(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-for-x/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-for-x/output.mjs index edaefba0..4fffc75f 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-for-x/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-for-x/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.string.iterator.js"; import "core-js/modules/web.dom-collections.iterator.js"; for (let [a, b] in c); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-iife/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-iife/output.mjs index 285b886d..7ea50381 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-iife/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-iife/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es.object.entries.js"; import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.object.entries.js"; import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.iterator.js"; !function (foo, { entries }) {}({}, Object); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-params/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-params/output.mjs index 1fa6b514..5af996d6 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-params/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-params/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.string.iterator.js"; import "core-js/modules/web.dom-collections.iterator.js"; function a([b, c]) {} diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-variable-declaration/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-variable-declaration/output.mjs index 73c95a2b..c74cde57 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-variable-declaration/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/destructuring-variable-declaration/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.string.iterator.js"; import "core-js/modules/web.dom-collections.iterator.js"; const [a, b] = c; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/determanated-instance-methods/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/determanated-instance-methods/output.mjs index a4d4643a..f333ffc1 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/determanated-instance-methods/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/determanated-instance-methods/output.mjs @@ -1,11 +1,11 @@ import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.function.bind.js"; +import "core-js/modules/es.object.define-getter.js"; import "core-js/modules/es.object.to-string.js"; import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.includes.js"; import "core-js/modules/es.regexp.flags.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.function.bind.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.replace.js"; var a = []; a.values(); ''.replace(); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/evaluated-class-methods/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/evaluated-class-methods/output.mjs index 1b6426e1..9f351068 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/evaluated-class-methods/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/evaluated-class-methods/output.mjs @@ -1,7 +1,7 @@ import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.object.assign.js"; import "core-js/modules/es.object.to-string.js"; import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/es.object.assign.js"; var objectClass = Object; var arrayInstance = []; var assignStr = "assign"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/evaluated-instance-methods/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/evaluated-instance-methods/output.mjs index 5dc7737a..d881792c 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/evaluated-instance-methods/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/evaluated-instance-methods/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es.array.includes.js"; import "core-js/modules/es.array.find.js"; +import "core-js/modules/es.array.includes.js"; import "core-js/modules/es.object.to-string.js"; var arrayInstance = []; var inclidesStr = "includes"; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/for-of-destructure-with/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/for-of-destructure-with/output.mjs index 4a93a2d0..d9e0b2eb 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/for-of-destructure-with/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/for-of-destructure-with/output.mjs @@ -1,6 +1,6 @@ import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.pad-start.js"; import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; for (const { padStart } of foo) { diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/for-of/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/for-of/output.mjs index ab6b3f52..5483896d 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/for-of/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/for-of/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.string.iterator.js"; import "core-js/modules/web.dom-collections.iterator.js"; for (let a of b); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/in/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/in/output.mjs index 88e96362..9c918242 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/in/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/in/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es.object.entries.js"; import "core-js/modules/es.array.includes.js"; -import "core-js/modules/es.object.values.js"; import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.object.entries.js"; import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.values.js"; 'entries' in Object; 'includes' in [1, 2, 3]; 'va' + 'lues' in Object; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/instance-at-proposals-corejs-3.8/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/instance-at-proposals-corejs-3.8/output.mjs index 45079935..4c85de1e 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/instance-at-proposals-corejs-3.8/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/instance-at-proposals-corejs-3.8/output.mjs @@ -2,7 +2,6 @@ import "core-js/modules/es.array.iterator.js"; import "core-js/modules/es.array-buffer.slice.js"; import "core-js/modules/es.object.to-string.js"; import "core-js/modules/es.typed-array.int8-array.js"; -import "core-js/modules/esnext.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"; @@ -28,6 +27,7 @@ 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/esnext.array.at.js"; import "core-js/modules/esnext.string.at.js"; +import "core-js/modules/esnext.typed-array.at.js"; // obscuring instance type let tmp; switch (Math.floor(Math.random() * 3)) { diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/instance-methods/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/instance-methods/output.mjs index 895150b9..85de8b01 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/instance-methods/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/instance-methods/output.mjs @@ -1,25 +1,25 @@ +import "core-js/modules/es.array.copy-within.js"; +import "core-js/modules/es.array.fill.js"; +import "core-js/modules/es.array.find.js"; import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.array.includes.js"; import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.reverse.js"; +import "core-js/modules/es.function.bind.js"; import "core-js/modules/es.map.js"; import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/es.array.includes.js"; -import "core-js/modules/es.string.includes.js"; -import "core-js/modules/es.array.find.js"; -import "core-js/modules/es.function.bind.js"; -import "core-js/modules/es.array.fill.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.starts-with.js"; +import "core-js/modules/es.regexp.exec.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.array.reverse.js"; -import "core-js/modules/es.array.copy-within.js"; -import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/es.string.search.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.iterator.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.replace.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/web.dom-collections.iterator.js"; Array.from; // static function Map; // top level built-in diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/number-ie-11/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/number-ie-11/output.mjs index 8bfc8e57..9356b7e4 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/number-ie-11/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/number-ie-11/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es.number.parse-float.js"; import "core-js/modules/es.number.constructor.js"; +import "core-js/modules/es.number.parse-float.js"; import "core-js/modules/es.number.parse-int.js"; Number.parseFloat("3.14"); Number.parseInt("10"); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/object-destructuring/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/object-destructuring/output.mjs index 20be9923..e6de4392 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/object-destructuring/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/object-destructuring/output.mjs @@ -1,19 +1,19 @@ +import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.for-each.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.of.js"; +import "core-js/modules/es.date.to-string.js"; import "core-js/modules/es.function.bind.js"; import "core-js/modules/es.object.entries.js"; -import "core-js/modules/es.date.to-string.js"; import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.regexp.exec.js"; import "core-js/modules/es.regexp.to-string.js"; +import "core-js/modules/es.string.includes.js"; import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/es.regexp.exec.js"; import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.array.filter.js"; -import "core-js/modules/es.string.includes.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.array.of.js"; -import "core-js/modules/es.array.for-each.js"; import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; var bind, toString; var { bind diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/promise-all/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/promise-all/output.mjs index d0e653be..caf4bf72 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/promise-all/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/promise-all/output.mjs @@ -1,6 +1,6 @@ +import "core-js/modules/es.array.iterator.js"; import "core-js/modules/es.object.to-string.js"; import "core-js/modules/es.promise.js"; -import "core-js/modules/es.array.iterator.js"; import "core-js/modules/es.string.iterator.js"; import "core-js/modules/web.dom-collections.iterator.js"; var p = Promise.resolve(0); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/promise-race/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/promise-race/output.mjs index 9fdbb6c9..18662bee 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/promise-race/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/promise-race/output.mjs @@ -1,6 +1,6 @@ +import "core-js/modules/es.array.iterator.js"; import "core-js/modules/es.object.to-string.js"; import "core-js/modules/es.promise.js"; -import "core-js/modules/es.array.iterator.js"; import "core-js/modules/es.string.iterator.js"; import "core-js/modules/web.dom-collections.iterator.js"; var p = Promise.resolve(0); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/proposal-to-stable-corejs-3.0-proposals/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/proposal-to-stable-corejs-3.0-proposals/output.mjs index 0b10d319..65f03f8b 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/proposal-to-stable-corejs-3.0-proposals/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/proposal-to-stable-corejs-3.0-proposals/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/esnext.global-this.js"; import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/esnext.global-this.js"; import "core-js/modules/esnext.string.match-all.js"; globalThis; foo.matchAll(bar); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/proposal-to-stable-corejs-3.0/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/proposal-to-stable-corejs-3.0/output.mjs index 0b10d319..65f03f8b 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/proposal-to-stable-corejs-3.0/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/proposal-to-stable-corejs-3.0/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/esnext.global-this.js"; import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/esnext.global-this.js"; import "core-js/modules/esnext.string.match-all.js"; globalThis; foo.matchAll(bar); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.29/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.29/output.mjs index 55b451f7..f86883e6 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.29/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals-corejs-3.29/output.mjs @@ -1,19 +1,17 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.symbol.match.js"; import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.global-this.js"; import "core-js/modules/es.map.js"; import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/web.dom-collections.iterator.js"; import "core-js/modules/es.promise.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.string.match.js"; -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.iterator.js"; import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/es.global-this.js"; 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.set.difference.v2.js"; import "core-js/modules/esnext.set.intersection.v2.js"; import "core-js/modules/esnext.set.is-disjoint-from.v2.js"; @@ -21,6 +19,8 @@ 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/web.dom-collections.iterator.js"; +import "core-js/modules/web.queue-microtask.js"; Array.from; // static method Map; // built-in new Promise(); // new builtin diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals/output.mjs index 70e50461..1896ecd9 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/shippedProposals/output.mjs @@ -1,19 +1,19 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.symbol.match.js"; import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.array.iterator.js"; import "core-js/modules/es.map.js"; import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/web.dom-collections.iterator.js"; import "core-js/modules/es.promise.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.string.match.js"; -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.iterator.js"; import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/esnext.global-this.js"; 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.global-this.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.queue-microtask.js"; Array.from; // static method Map; // built-in new Promise(); // new builtin diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/source-type-script-query/output.js b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/source-type-script-query/output.js index 4e710e66..9e45197f 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/source-type-script-query/output.js +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/source-type-script-query/output.js @@ -1,6 +1,6 @@ +require("core-js/modules/es.array.includes.js"); require("core-js/modules/es.object.to-string.js"); require("core-js/modules/es.promise.js"); -require("core-js/modules/es.array.includes.js"); require("foo"); const x = new Promise(resolve => { const p = []; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/source-type-script/output.js b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/source-type-script/output.js index 4e710e66..9e45197f 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/source-type-script/output.js +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/source-type-script/output.js @@ -1,6 +1,6 @@ +require("core-js/modules/es.array.includes.js"); require("core-js/modules/es.object.to-string.js"); require("core-js/modules/es.promise.js"); -require("core-js/modules/es.array.includes.js"); require("foo"); const x = new Promise(resolve => { const p = []; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/spread/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/spread/output.mjs index 6daa5d13..f8123ece 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/spread/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/spread/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es.string.iterator.js"; import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.string.iterator.js"; import "core-js/modules/web.dom-collections.iterator.js"; a = [b, ...c]; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/static-methods/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/static-methods/output.mjs index 204983a4..d65ed951 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/static-methods/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/static-methods/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es.object.keys.js"; import "core-js/modules/es.symbol.js"; import "core-js/modules/es.object.assign.js"; import "core-js/modules/es.object.define-property.js"; +import "core-js/modules/es.object.keys.js"; Object.keys(foo); const getOwnPropertySymbols = Object.getOwnPropertySymbols; const { diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/symbol-iterator-in/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/symbol-iterator-in/output.mjs index 1cfa0d8c..d2a01e9d 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/symbol-iterator-in/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/symbol-iterator-in/output.mjs @@ -1,8 +1,8 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; import "core-js/modules/es.symbol.iterator.js"; import "core-js/modules/es.array.iterator.js"; import "core-js/modules/es.object.to-string.js"; import "core-js/modules/es.string.iterator.js"; import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; Symbol.iterator in arr; diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/symbol-iterator/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/symbol-iterator/output.mjs index 0c35d915..54df0371 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/symbol-iterator/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/symbol-iterator/output.mjs @@ -1,8 +1,8 @@ +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; import "core-js/modules/es.symbol.iterator.js"; import "core-js/modules/es.array.iterator.js"; import "core-js/modules/es.object.to-string.js"; import "core-js/modules/es.string.iterator.js"; import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; arr[Symbol.iterator](); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/timers/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/timers/output.mjs index a6067bcc..7cc6a2b4 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/timers/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/timers/output.mjs @@ -1,7 +1,7 @@ import "core-js/modules/es.object.to-string.js"; import "core-js/modules/es.promise.js"; -import "core-js/modules/web.timers.js"; import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.timers.js"; Promise.resolve().then(it => { setTimeout(foo, 1, 2); setInterval(foo, 1, 2); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/typed-array-at-proposals-corejs-3.8/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/typed-array-at-proposals-corejs-3.8/output.mjs index 8803be2d..1238420c 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/typed-array-at-proposals-corejs-3.8/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/typed-array-at-proposals-corejs-3.8/output.mjs @@ -1,10 +1,7 @@ -import "core-js/modules/esnext.array.at.js"; -import "core-js/modules/esnext.string.at.js"; import "core-js/modules/es.array.iterator.js"; import "core-js/modules/es.array-buffer.slice.js"; import "core-js/modules/es.object.to-string.js"; import "core-js/modules/es.typed-array.int8-array.js"; -import "core-js/modules/esnext.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"; @@ -28,4 +25,7 @@ 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/esnext.array.at.js"; +import "core-js/modules/esnext.string.at.js"; +import "core-js/modules/esnext.typed-array.at.js"; new Int8Array(1).at(-1); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/typed-array-static/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/typed-array-static/output.mjs index aa407a0d..33f6402d 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/typed-array-static/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-global/typed-array-static/output.mjs @@ -1,6 +1,7 @@ import "core-js/modules/es.array.iterator.js"; import "core-js/modules/es.array-buffer.slice.js"; import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.typed-array.int8-array.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"; @@ -25,5 +26,4 @@ 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.typed-array.int8-array.js"; Int8Array.of();