diff options
Diffstat (limited to 'node_modules/babel-plugin-polyfill-corejs3/lib')
3 files changed, 40 insertions, 31 deletions
diff --git a/node_modules/babel-plugin-polyfill-corejs3/lib/built-in-definitions.js b/node_modules/babel-plugin-polyfill-corejs3/lib/built-in-definitions.js index a11d339d..3790fc58 100644 --- a/node_modules/babel-plugin-polyfill-corejs3/lib/built-in-definitions.js +++ b/node_modules/babel-plugin-polyfill-corejs3/lib/built-in-definitions.js @@ -4,6 +4,7 @@ exports.__esModule = true; exports.StaticProperties = exports.PromiseDependenciesWithIterators = exports.PromiseDependencies = exports.InstanceProperties = exports.DecoratorMetadataDependencies = exports.CommonIterators = exports.BuiltIns = void 0; var _data = _interopRequireDefault(require("../core-js-compat/data.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } const polyfillsOrder = {}; Object.keys(_data.default).forEach((name, index) => { polyfillsOrder[name] = index; @@ -16,7 +17,7 @@ const define = (pure, global, name = global[0], exclude) => { exclude }; }; -const typed = name => define(null, [name, ...TypedArrayDependencies]); +const typed = (...modules) => define(null, [...modules, ...TypedArrayDependencies]); const ArrayNatureIterators = ["es.array.iterator", "web.dom-collections.iterator"]; const CommonIterators = ["es.string.iterator", ...ArrayNatureIterators]; exports.CommonIterators = CommonIterators; @@ -24,7 +25,7 @@ const ArrayNatureIteratorsWithTag = ["es.object.to-string", ...ArrayNatureIterat const CommonIteratorsWithTag = ["es.object.to-string", ...CommonIterators]; const ErrorDependencies = ["es.error.cause", "es.error.to-string"]; const SuppressedErrorDependencies = ["esnext.suppressed-error.constructor", ...ErrorDependencies]; -const TypedArrayDependencies = ["es.typed-array.at", "es.typed-array.copy-within", "es.typed-array.every", "es.typed-array.fill", "es.typed-array.filter", "es.typed-array.find", "es.typed-array.find-index", "es.typed-array.find-last", "es.typed-array.find-last-index", "es.typed-array.for-each", "es.typed-array.includes", "es.typed-array.index-of", "es.typed-array.iterator", "es.typed-array.join", "es.typed-array.last-index-of", "es.typed-array.map", "es.typed-array.reduce", "es.typed-array.reduce-right", "es.typed-array.reverse", "es.typed-array.set", "es.typed-array.slice", "es.typed-array.some", "es.typed-array.sort", "es.typed-array.subarray", "es.typed-array.to-locale-string", "es.typed-array.to-reversed", "es.typed-array.to-sorted", "es.typed-array.to-string", "es.typed-array.with", "es.object.to-string", "es.array.iterator", "es.array-buffer.slice", "esnext.array-buffer.detached", "esnext.array-buffer.transfer", "esnext.array-buffer.transfer-to-fixed-length", "esnext.typed-array.filter-reject", "esnext.typed-array.group-by", "esnext.typed-array.to-spliced", "esnext.typed-array.unique-by"]; +const TypedArrayDependencies = ["es.typed-array.at", "es.typed-array.copy-within", "es.typed-array.every", "es.typed-array.fill", "es.typed-array.filter", "es.typed-array.find", "es.typed-array.find-index", "es.typed-array.find-last", "es.typed-array.find-last-index", "es.typed-array.for-each", "es.typed-array.includes", "es.typed-array.index-of", "es.typed-array.iterator", "es.typed-array.join", "es.typed-array.last-index-of", "es.typed-array.map", "es.typed-array.reduce", "es.typed-array.reduce-right", "es.typed-array.reverse", "es.typed-array.set", "es.typed-array.slice", "es.typed-array.some", "es.typed-array.sort", "es.typed-array.subarray", "es.typed-array.to-locale-string", "es.typed-array.to-reversed", "es.typed-array.to-sorted", "es.typed-array.to-string", "es.typed-array.with", "es.object.to-string", "es.array.iterator", "es.array-buffer.slice", "es.data-view", "es.array-buffer.detached", "es.array-buffer.transfer", "es.array-buffer.transfer-to-fixed-length", "esnext.typed-array.filter-reject", "esnext.typed-array.group-by", "esnext.typed-array.to-spliced", "esnext.typed-array.unique-by"]; const PromiseDependencies = ["es.promise", "es.object.to-string"]; exports.PromiseDependencies = PromiseDependencies; const PromiseDependenciesWithIterators = [...PromiseDependencies, ...CommonIterators]; @@ -41,17 +42,17 @@ const AsyncIteratorProblemMethods = ["esnext.async-iterator.every", "esnext.asyn const IteratorDependencies = ["esnext.iterator.constructor", "es.object.to-string"]; const DecoratorMetadataDependencies = ["esnext.symbol.metadata", "esnext.function.metadata"]; exports.DecoratorMetadataDependencies = DecoratorMetadataDependencies; -const TypedArrayStaticMethods = { - from: define(null, ["es.typed-array.from"]), - fromAsync: define(null, ["esnext.typed-array.from-async", ...PromiseDependenciesWithIterators]), - of: define(null, ["es.typed-array.of"]) -}; -const DataViewDependencies = ["es.data-view", "es.array-buffer.slice", "es.object.to-string"]; +const TypedArrayStaticMethods = base => ({ + from: define(null, ["es.typed-array.from", base, ...TypedArrayDependencies]), + fromAsync: define(null, ["esnext.typed-array.from-async", base, ...PromiseDependenciesWithIterators, ...TypedArrayDependencies]), + of: define(null, ["es.typed-array.of", base, ...TypedArrayDependencies]) +}); +const DataViewDependencies = ["es.data-view", "es.array-buffer.constructor", "es.array-buffer.slice", "es.array-buffer.detached", "es.array-buffer.transfer", "es.array-buffer.transfer-to-fixed-length", "es.object.to-string"]; const BuiltIns = { AsyncDisposableStack: define("async-disposable-stack/index", ["esnext.async-disposable-stack.constructor", "es.object.to-string", "esnext.async-iterator.async-dispose", "esnext.iterator.dispose", ...PromiseDependencies, ...SuppressedErrorDependencies]), AsyncIterator: define("async-iterator/index", AsyncIteratorDependencies), AggregateError: define("aggregate-error", ["es.aggregate-error", ...ErrorDependencies, ...CommonIteratorsWithTag, "es.aggregate-error.cause"]), - ArrayBuffer: define(null, ["es.array-buffer.constructor", "es.array-buffer.slice", "es.object.to-string"]), + ArrayBuffer: define(null, ["es.array-buffer.constructor", "es.array-buffer.slice", "es.data-view", "es.array-buffer.detached", "es.array-buffer.transfer", "es.array-buffer.transfer-to-fixed-length", "es.object.to-string"]), DataView: define(null, DataViewDependencies), Date: define(null, ["es.date.to-string"]), DOMException: define("dom-exception/index", DOMExceptionDependencies), @@ -64,7 +65,7 @@ const BuiltIns = { Int16Array: typed("es.typed-array.int16-array"), Int32Array: typed("es.typed-array.int32-array"), Iterator: define("iterator/index", IteratorDependencies), - Uint8Array: typed("es.typed-array.uint8-array"), + Uint8Array: typed("es.typed-array.uint8-array", "esnext.uint8-array.to-base64", "esnext.uint8-array.to-hex"), Uint8ClampedArray: typed("es.typed-array.uint8-clamped-array"), Uint16Array: typed("es.typed-array.uint16-array"), Uint32Array: typed("es.typed-array.uint32-array"), @@ -82,7 +83,7 @@ const BuiltIns = { SyntaxError: define(null, ErrorDependencies), TypeError: define(null, ErrorDependencies), URIError: define(null, ErrorDependencies), - URL: define("url/index", ["web.url", ...URLSearchParamsDependencies]), + URL: define("url/index", ["web.url", "web.url.to-json", ...URLSearchParamsDependencies]), URLSearchParams: define("url-search-params/index", URLSearchParamsDependencies), WeakMap: define("weak-map/index", WeakMapDependencies), WeakSet: define("weak-set/index", WeakSetDependencies), @@ -137,7 +138,7 @@ const StaticProperties = { isRawJSON: define("json/is-raw-json", ["esnext.json.is-raw-json"]), parse: define("json/parse", ["esnext.json.parse", "es.object.keys"]), rawJSON: define("json/raw-json", ["esnext.json.raw-json", "es.object.create", "es.object.freeze"]), - stringify: define("json/stringify", ["es.json.stringify"], "es.symbol") + stringify: define("json/stringify", ["es.json.stringify", "es.date.to-json"], "es.symbol") }, Math: { DEG_PER_RAD: define("math/deg-per-rad", ["esnext.math.deg-per-rad"]), @@ -174,8 +175,8 @@ const StaticProperties = { }, Map: { from: define(null, ["esnext.map.from", ...MapDependencies]), - groupBy: define(null, ["esnext.map.group-by", ...MapDependencies]), - keyBy: define(null, ["esnext.map.key-by", ...MapDependencies]), + groupBy: define("map/group-by", ["es.map.group-by", ...MapDependencies]), + keyBy: define("map/key-by", ["esnext.map.key-by", ...MapDependencies]), of: define(null, ["esnext.map.of", ...MapDependencies]) }, Number: { @@ -204,7 +205,7 @@ const StaticProperties = { getOwnPropertyNames: define("object/get-own-property-names", ["es.object.get-own-property-names"]), getOwnPropertySymbols: define("object/get-own-property-symbols", ["es.symbol"]), getPrototypeOf: define("object/get-prototype-of", ["es.object.get-prototype-of"]), - groupBy: define("object/group-by", ["esnext.object.group-by", "es.object.create"]), + groupBy: define("object/group-by", ["es.object.group-by", "es.object.create"]), hasOwn: define("object/has-own", ["es.object.has-own"]), is: define("object/is", ["es.object.is"]), isExtensible: define("object/is-extensible", ["es.object.is-extensible"]), @@ -218,11 +219,11 @@ const StaticProperties = { }, Promise: { all: define(null, PromiseDependenciesWithIterators), - allSettled: define(null, ["es.promise.all-settled", ...PromiseDependenciesWithIterators]), - any: define(null, ["es.promise.any", "es.aggregate-error", ...PromiseDependenciesWithIterators]), + allSettled: define("promise/all-settled", ["es.promise.all-settled", ...PromiseDependenciesWithIterators]), + any: define("promise/any", ["es.promise.any", "es.aggregate-error", ...PromiseDependenciesWithIterators]), race: define(null, PromiseDependenciesWithIterators), - try: define(null, ["esnext.promise.try", ...PromiseDependencies]), - withResolvers: define(null, ["esnext.promise.with-resolvers", ...PromiseDependencies]) + try: define("promise/try", ["esnext.promise.try", ...PromiseDependencies]), + withResolvers: define("promise/with-resolvers", ["es.promise.with-resolvers", ...PromiseDependencies]) }, Reflect: { apply: define("reflect/apply", ["es.reflect.apply"]), @@ -300,15 +301,18 @@ const StaticProperties = { from: define(null, ["esnext.weak-set.from", ...WeakSetDependencies]), of: define(null, ["esnext.weak-set.of", ...WeakSetDependencies]) }, - Int8Array: TypedArrayStaticMethods, - Uint8Array: TypedArrayStaticMethods, - Uint8ClampedArray: TypedArrayStaticMethods, - Int16Array: TypedArrayStaticMethods, - Uint16Array: TypedArrayStaticMethods, - Int32Array: TypedArrayStaticMethods, - Uint32Array: TypedArrayStaticMethods, - Float32Array: TypedArrayStaticMethods, - Float64Array: TypedArrayStaticMethods, + Int8Array: TypedArrayStaticMethods("es.typed-array.int8-array"), + Uint8Array: _extends({ + fromBase64: define(null, ["esnext.uint8-array.from-base64", ...TypedArrayDependencies]), + fromHex: define(null, ["esnext.uint8-array.from-hex", ...TypedArrayDependencies]) + }, TypedArrayStaticMethods("es.typed-array.uint8-array")), + Uint8ClampedArray: TypedArrayStaticMethods("es.typed-array.uint8-clamped-array"), + Int16Array: TypedArrayStaticMethods("es.typed-array.int16-array"), + Uint16Array: TypedArrayStaticMethods("es.typed-array.uint16-array"), + Int32Array: TypedArrayStaticMethods("es.typed-array.int32-array"), + Uint32Array: TypedArrayStaticMethods("es.typed-array.uint32-array"), + Float32Array: TypedArrayStaticMethods("es.typed-array.float32-array"), + Float64Array: TypedArrayStaticMethods("es.typed-array.float64-array"), WebAssembly: { CompileError: define(null, ErrorDependencies), LinkError: define(null, ErrorDependencies), @@ -420,7 +424,7 @@ const InstanceProperties = { toFixed: define(null, ["es.number.to-fixed"]), toGMTString: define(null, ["es.date.to-gmt-string"]), toISOString: define(null, ["es.date.to-iso-string"]), - toJSON: define(null, ["es.date.to-json", "web.url.to-json"]), + toJSON: define(null, ["es.date.to-json"]), toPrecision: define(null, ["es.number.to-precision"]), toReversed: define("instance/to-reversed", ["es.array.to-reversed"]), toSorted: define("instance/to-sorted", ["es.array.to-sorted", "es.array.sort"]), diff --git a/node_modules/babel-plugin-polyfill-corejs3/lib/index.js b/node_modules/babel-plugin-polyfill-corejs3/lib/index.js index ca718f19..330614c6 100644 --- a/node_modules/babel-plugin-polyfill-corejs3/lib/index.js +++ b/node_modules/babel-plugin-polyfill-corejs3/lib/index.js @@ -6,6 +6,7 @@ var _data = _interopRequireDefault(require("../core-js-compat/data.js")); var _shippedProposals = _interopRequireDefault(require("./shipped-proposals")); var _getModulesListForTargetVersion = _interopRequireDefault(require("../core-js-compat/get-modules-list-for-target-version.js")); var _builtInDefinitions = require("./built-in-definitions"); +var BabelRuntimePaths = _interopRequireWildcard(require("./babel-runtime-corejs3-paths")); var _usageFilters = _interopRequireDefault(require("./usage-filters")); var _babel = _interopRequireWildcard(require("@babel/core")); var _utils = require("./utils"); @@ -59,7 +60,7 @@ var _default = (0, _helperDefinePolyfillProvider.default)(function ({ function maybeInjectGlobalImpl(name, utils) { if (shouldInjectPolyfill(name)) { debug(name); - utils.injectGlobalImport((0, _utils.coreJSModule)(name)); + utils.injectGlobalImport((0, _utils.coreJSModule)(name), name); return true; } return false; @@ -84,6 +85,9 @@ var _default = (0, _helperDefinePolyfillProvider.default)(function ({ } else if (name.startsWith("es.") && !available.has(name)) { useProposalBase = true; } + if (useBabelRuntime && !(useProposalBase ? BabelRuntimePaths.proposals : BabelRuntimePaths.stable).has(desc.pure)) { + return; + } const coreJSPureBase = getCoreJSPureBase(useProposalBase); return utils.injectDefaultImport(`${coreJSPureBase}/${desc.pure}${ext}`, hint); } @@ -141,6 +145,7 @@ var _default = (0, _helperDefinePolyfillProvider.default)(function ({ deps = deps.filter(m => uniqueObjects.some(v => v.test(m)) ? m.includes(low) : true); } maybeInjectGlobal(deps, utils); + return true; }, usagePure(meta, utils, path) { if (meta.kind === "in") { diff --git a/node_modules/babel-plugin-polyfill-corejs3/lib/shipped-proposals.js b/node_modules/babel-plugin-polyfill-corejs3/lib/shipped-proposals.js index 0db3a529..ce8214b0 100644 --- a/node_modules/babel-plugin-polyfill-corejs3/lib/shipped-proposals.js +++ b/node_modules/babel-plugin-polyfill-corejs3/lib/shipped-proposals.js @@ -3,5 +3,5 @@ exports.__esModule = true; exports.default = void 0; // This file is automatically generated by scripts/build-corejs3-shipped-proposals.mjs -var _default = new Set(["esnext.array.from-async", "esnext.array.group", "esnext.array.group-to-map", "esnext.array-buffer.detached", "esnext.array-buffer.transfer", "esnext.array-buffer.transfer-to-fixed-length", "esnext.iterator.constructor", "esnext.iterator.drop", "esnext.iterator.every", "esnext.iterator.filter", "esnext.iterator.find", "esnext.iterator.flat-map", "esnext.iterator.for-each", "esnext.iterator.from", "esnext.iterator.map", "esnext.iterator.reduce", "esnext.iterator.some", "esnext.iterator.take", "esnext.iterator.to-array", "esnext.json.is-raw-json", "esnext.json.parse", "esnext.json.raw-json", "esnext.map.group-by", "esnext.object.group-by", "esnext.promise.with-resolvers", "esnext.set.difference.v2", "esnext.set.intersection.v2", "esnext.set.is-disjoint-from.v2", "esnext.set.is-subset-of.v2", "esnext.set.is-superset-of.v2", "esnext.set.symmetric-difference.v2", "esnext.set.union.v2", "esnext.symbol.async-dispose", "esnext.symbol.dispose"]); +var _default = new Set(["esnext.suppressed-error.constructor", "esnext.array.from-async", "esnext.array.group", "esnext.array.group-to-map", "esnext.iterator.constructor", "esnext.iterator.drop", "esnext.iterator.every", "esnext.iterator.filter", "esnext.iterator.find", "esnext.iterator.flat-map", "esnext.iterator.for-each", "esnext.iterator.from", "esnext.iterator.map", "esnext.iterator.reduce", "esnext.iterator.some", "esnext.iterator.take", "esnext.iterator.to-array", "esnext.json.is-raw-json", "esnext.json.parse", "esnext.json.raw-json", "esnext.set.difference.v2", "esnext.set.intersection.v2", "esnext.set.is-disjoint-from.v2", "esnext.set.is-subset-of.v2", "esnext.set.is-superset-of.v2", "esnext.set.symmetric-difference.v2", "esnext.set.union.v2", "esnext.symbol.async-dispose", "esnext.symbol.dispose", "esnext.symbol.metadata"]); exports.default = _default;
\ No newline at end of file |
