babel-plugin-polyfill-corejs3 0.14.2 → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +608 -66
- package/lib/index.js.map +1 -0
- package/package.json +18 -21
- package/core-js-compat/README.md +0 -4
- package/core-js-compat/data.js +0 -1
- package/core-js-compat/entries.js +0 -1
- package/core-js-compat/get-modules-list-for-target-version.js +0 -1
- package/lib/babel-runtime-corejs3-paths.js +0 -10
- package/lib/built-in-definitions.js +0 -474
- package/lib/shipped-proposals.js +0 -6
- package/lib/usage-filters.js +0 -26
- package/lib/utils.js +0 -63
package/lib/index.js
CHANGED
|
@@ -1,23 +1,564 @@
|
|
|
1
|
-
|
|
1
|
+
import corejs3Polyfills from 'core-js-compat/data.json' with { type: 'json' };
|
|
2
|
+
import getModulesListForTargetVersion from 'core-js-compat/get-modules-list-for-target-version.js';
|
|
3
|
+
import * as _babelCore from '@babel/core';
|
|
4
|
+
import corejsEntries from 'core-js-compat/entries.json' with { type: 'json' };
|
|
5
|
+
import defineProvider from '@babel/helper-define-polyfill-provider';
|
|
6
|
+
|
|
7
|
+
// This file is automatically generated by scripts/build-corejs3-shipped-proposals.mjs
|
|
8
|
+
|
|
9
|
+
var corejs3ShippedProposalsList = new Set(["esnext.array.group", "esnext.array.group-to-map", "esnext.iterator.zip", "esnext.iterator.zip-keyed", "esnext.symbol.metadata"]);
|
|
10
|
+
|
|
11
|
+
const polyfillsOrder = {};
|
|
12
|
+
Object.keys(corejs3Polyfills).forEach((name, index) => {
|
|
13
|
+
polyfillsOrder[name] = index;
|
|
14
|
+
});
|
|
15
|
+
const define = (pure, global, name = global[0], exclude) => {
|
|
16
|
+
return {
|
|
17
|
+
name,
|
|
18
|
+
pure,
|
|
19
|
+
global: global.sort((a, b) => polyfillsOrder[a] - polyfillsOrder[b]),
|
|
20
|
+
exclude
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
const typed = (...modules) => define(null, [...modules, ...TypedArrayDependencies]);
|
|
24
|
+
const ArrayNatureIterators = ["es.array.iterator", "web.dom-collections.iterator"];
|
|
25
|
+
const CommonIterators = ["es.string.iterator", ...ArrayNatureIterators];
|
|
26
|
+
const ArrayNatureIteratorsWithTag = ["es.object.to-string", ...ArrayNatureIterators];
|
|
27
|
+
const CommonIteratorsWithTag = ["es.object.to-string", ...CommonIterators];
|
|
28
|
+
const ErrorDependencies = ["es.error.cause", "es.error.to-string"];
|
|
29
|
+
const SuppressedErrorDependencies = ["es.suppressed-error.constructor", ...ErrorDependencies];
|
|
30
|
+
const ArrayBufferDependencies = ["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"];
|
|
31
|
+
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", "esnext.typed-array.filter-reject", "esnext.typed-array.group-by", "esnext.typed-array.to-spliced", "esnext.typed-array.unique-by", ...ArrayBufferDependencies];
|
|
32
|
+
const PromiseDependencies = ["es.promise", "es.object.to-string"];
|
|
33
|
+
const PromiseDependenciesWithIterators = [...PromiseDependencies, ...CommonIterators];
|
|
34
|
+
const SymbolDependencies = ["es.symbol", "es.symbol.description", "es.object.to-string"];
|
|
35
|
+
const MapDependencies = ["es.map", "es.map.get-or-insert", "es.map.get-or-insert-computed", "esnext.map.delete-all", "esnext.map.emplace", "esnext.map.every", "esnext.map.filter", "esnext.map.find", "esnext.map.find-key", "esnext.map.includes", "esnext.map.key-of", "esnext.map.map-keys", "esnext.map.map-values", "esnext.map.merge", "esnext.map.reduce", "esnext.map.some", "esnext.map.update", ...CommonIteratorsWithTag];
|
|
36
|
+
const SetDependencies = ["es.set", "es.set.difference.v2", "es.set.intersection.v2", "es.set.is-disjoint-from.v2", "es.set.is-subset-of.v2", "es.set.is-superset-of.v2", "es.set.symmetric-difference.v2", "es.set.union.v2", "esnext.set.add-all", "esnext.set.delete-all", "esnext.set.difference", "esnext.set.every", "esnext.set.filter", "esnext.set.find", "esnext.set.intersection", "esnext.set.is-disjoint-from", "esnext.set.is-subset-of", "esnext.set.is-superset-of", "esnext.set.join", "esnext.set.map", "esnext.set.reduce", "esnext.set.some", "esnext.set.symmetric-difference", "esnext.set.union", ...CommonIteratorsWithTag];
|
|
37
|
+
const WeakMapDependencies = ["es.weak-map", "es.weak-map.get-or-insert", "es.weak-map.get-or-insert-computed", "esnext.weak-map.delete-all", "esnext.weak-map.emplace", ...CommonIteratorsWithTag];
|
|
38
|
+
const WeakSetDependencies = ["es.weak-set", "esnext.weak-set.add-all", "esnext.weak-set.delete-all", ...CommonIteratorsWithTag];
|
|
39
|
+
const DOMExceptionDependencies = ["web.dom-exception.constructor", "web.dom-exception.stack", "web.dom-exception.to-string-tag", "es.error.to-string"];
|
|
40
|
+
const URLSearchParamsDependencies = ["web.url-search-params", "web.url-search-params.delete", "web.url-search-params.has", "web.url-search-params.size", ...CommonIteratorsWithTag];
|
|
41
|
+
const AsyncIteratorDependencies = ["esnext.async-iterator.constructor", ...PromiseDependencies];
|
|
42
|
+
const AsyncIteratorProblemMethods = ["esnext.async-iterator.every", "esnext.async-iterator.filter", "esnext.async-iterator.find", "esnext.async-iterator.flat-map", "esnext.async-iterator.for-each", "esnext.async-iterator.map", "esnext.async-iterator.reduce", "esnext.async-iterator.some"];
|
|
43
|
+
const IteratorDependencies = ["es.iterator.constructor", "es.object.to-string"];
|
|
44
|
+
const DecoratorMetadataDependencies = ["esnext.symbol.metadata", "esnext.function.metadata"];
|
|
45
|
+
const TypedArrayStaticMethods = base => ({
|
|
46
|
+
from: define(null, ["es.typed-array.from", base, ...TypedArrayDependencies]),
|
|
47
|
+
fromAsync: define(null, ["esnext.typed-array.from-async", base, ...PromiseDependenciesWithIterators, ...TypedArrayDependencies]),
|
|
48
|
+
of: define(null, ["es.typed-array.of", base, ...TypedArrayDependencies])
|
|
49
|
+
});
|
|
50
|
+
const DataViewDependencies = ["es.data-view", ...ArrayBufferDependencies];
|
|
51
|
+
const BuiltIns = {
|
|
52
|
+
AsyncDisposableStack: define("async-disposable-stack/index", ["es.async-disposable-stack.constructor", "es.object.to-string", "es.async-iterator.async-dispose", "es.iterator.dispose", ...PromiseDependencies, ...SuppressedErrorDependencies]),
|
|
53
|
+
AsyncIterator: define("async-iterator/index", AsyncIteratorDependencies),
|
|
54
|
+
AggregateError: define("aggregate-error", ["es.aggregate-error", ...ErrorDependencies, ...CommonIteratorsWithTag, "es.aggregate-error.cause"]),
|
|
55
|
+
ArrayBuffer: define(null, ArrayBufferDependencies),
|
|
56
|
+
DataView: define(null, DataViewDependencies),
|
|
57
|
+
Date: define(null, ["es.date.to-string"]),
|
|
58
|
+
DOMException: define("dom-exception/index", DOMExceptionDependencies),
|
|
59
|
+
DisposableStack: define("disposable-stack/index", ["es.disposable-stack.constructor", "es.object.to-string", "es.iterator.dispose", ...SuppressedErrorDependencies]),
|
|
60
|
+
Error: define(null, ErrorDependencies),
|
|
61
|
+
EvalError: define(null, ErrorDependencies),
|
|
62
|
+
Float32Array: typed("es.typed-array.float32-array"),
|
|
63
|
+
Float64Array: typed("es.typed-array.float64-array"),
|
|
64
|
+
Int8Array: typed("es.typed-array.int8-array"),
|
|
65
|
+
Int16Array: typed("es.typed-array.int16-array"),
|
|
66
|
+
Int32Array: typed("es.typed-array.int32-array"),
|
|
67
|
+
Iterator: define("iterator/index", IteratorDependencies),
|
|
68
|
+
Uint8Array: typed("es.typed-array.uint8-array", "es.uint8-array.set-from-base64", "es.uint8-array.set-from-hex", "es.uint8-array.to-base64", "es.uint8-array.to-hex"),
|
|
69
|
+
Uint8ClampedArray: typed("es.typed-array.uint8-clamped-array"),
|
|
70
|
+
Uint16Array: typed("es.typed-array.uint16-array"),
|
|
71
|
+
Uint32Array: typed("es.typed-array.uint32-array"),
|
|
72
|
+
Map: define("map/index", MapDependencies),
|
|
73
|
+
Number: define(null, ["es.number.constructor"]),
|
|
74
|
+
Observable: define("observable/index", ["esnext.observable", "esnext.symbol.observable", "es.object.to-string", ...CommonIteratorsWithTag]),
|
|
75
|
+
Promise: define("promise/index", PromiseDependencies),
|
|
76
|
+
RangeError: define(null, ErrorDependencies),
|
|
77
|
+
ReferenceError: define(null, ErrorDependencies),
|
|
78
|
+
Reflect: define(null, ["es.reflect.to-string-tag", "es.object.to-string"]),
|
|
79
|
+
RegExp: define(null, ["es.regexp.constructor", "es.regexp.dot-all", "es.regexp.exec", "es.regexp.sticky", "es.regexp.to-string"]),
|
|
80
|
+
Set: define("set/index", SetDependencies),
|
|
81
|
+
SuppressedError: define("suppressed-error", SuppressedErrorDependencies),
|
|
82
|
+
Symbol: define("symbol/index", SymbolDependencies),
|
|
83
|
+
SyntaxError: define(null, ErrorDependencies),
|
|
84
|
+
TypeError: define(null, ErrorDependencies),
|
|
85
|
+
URIError: define(null, ErrorDependencies),
|
|
86
|
+
URL: define("url/index", ["web.url", "web.url.to-json", ...URLSearchParamsDependencies]),
|
|
87
|
+
URLSearchParams: define("url-search-params/index", URLSearchParamsDependencies),
|
|
88
|
+
WeakMap: define("weak-map/index", WeakMapDependencies),
|
|
89
|
+
WeakSet: define("weak-set/index", WeakSetDependencies),
|
|
90
|
+
atob: define("atob", ["web.atob", ...DOMExceptionDependencies]),
|
|
91
|
+
btoa: define("btoa", ["web.btoa", ...DOMExceptionDependencies]),
|
|
92
|
+
clearImmediate: define("clear-immediate", ["web.immediate"]),
|
|
93
|
+
compositeKey: define("composite-key", ["esnext.composite-key"]),
|
|
94
|
+
compositeSymbol: define("composite-symbol", ["esnext.composite-symbol"]),
|
|
95
|
+
escape: define("escape", ["es.escape"]),
|
|
96
|
+
fetch: define(null, PromiseDependencies),
|
|
97
|
+
globalThis: define("global-this", ["es.global-this"]),
|
|
98
|
+
parseFloat: define("parse-float", ["es.parse-float"]),
|
|
99
|
+
parseInt: define("parse-int", ["es.parse-int"]),
|
|
100
|
+
queueMicrotask: define("queue-microtask", ["web.queue-microtask"]),
|
|
101
|
+
self: define("self", ["web.self"]),
|
|
102
|
+
setImmediate: define("set-immediate", ["web.immediate"]),
|
|
103
|
+
setInterval: define("set-interval", ["web.timers"]),
|
|
104
|
+
setTimeout: define("set-timeout", ["web.timers"]),
|
|
105
|
+
structuredClone: define("structured-clone", ["web.structured-clone", ...DOMExceptionDependencies, "es.array.iterator", "es.object.keys", "es.object.to-string", "es.map", "es.set"]),
|
|
106
|
+
unescape: define("unescape", ["es.unescape"])
|
|
107
|
+
};
|
|
108
|
+
const StaticProperties = {
|
|
109
|
+
AsyncIterator: {
|
|
110
|
+
from: define("async-iterator/from", ["esnext.async-iterator.from", ...AsyncIteratorDependencies, ...AsyncIteratorProblemMethods, ...CommonIterators])
|
|
111
|
+
},
|
|
112
|
+
Array: {
|
|
113
|
+
from: define("array/from", ["es.array.from", "es.string.iterator"]),
|
|
114
|
+
fromAsync: define("array/from-async", ["es.array.from-async", ...PromiseDependenciesWithIterators]),
|
|
115
|
+
isArray: define("array/is-array", ["es.array.is-array"]),
|
|
116
|
+
isTemplateObject: define("array/is-template-object", ["esnext.array.is-template-object"]),
|
|
117
|
+
of: define("array/of", ["es.array.of"])
|
|
118
|
+
},
|
|
119
|
+
ArrayBuffer: {
|
|
120
|
+
isView: define(null, ["es.array-buffer.is-view"])
|
|
121
|
+
},
|
|
122
|
+
BigInt: {
|
|
123
|
+
range: define("bigint/range", ["esnext.bigint.range", "es.object.to-string"])
|
|
124
|
+
},
|
|
125
|
+
Date: {
|
|
126
|
+
now: define("date/now", ["es.date.now"])
|
|
127
|
+
},
|
|
128
|
+
Error: {
|
|
129
|
+
isError: define("error/is-error", ["es.error.is-error", "es.object.create"])
|
|
130
|
+
},
|
|
131
|
+
Function: {
|
|
132
|
+
isCallable: define("function/is-callable", ["esnext.function.is-callable"]),
|
|
133
|
+
isConstructor: define("function/is-constructor", ["esnext.function.is-constructor"])
|
|
134
|
+
},
|
|
135
|
+
Iterator: {
|
|
136
|
+
concat: define("iterator/concat", ["es.iterator.concat", ...IteratorDependencies, ...CommonIterators]),
|
|
137
|
+
from: define("iterator/from", ["es.iterator.from", ...IteratorDependencies, ...CommonIterators]),
|
|
138
|
+
range: define("iterator/range", ["esnext.iterator.range", ...IteratorDependencies]),
|
|
139
|
+
zip: define("iterator/zip", ["esnext.iterator.zip", ...IteratorDependencies, ...CommonIterators]),
|
|
140
|
+
zipKeyed: define("iterator/zip-keyed", ["esnext.iterator.zip-keyed", "es.object.create", "es.reflect.own-keys", ...IteratorDependencies, ...CommonIterators])
|
|
141
|
+
},
|
|
142
|
+
JSON: {
|
|
143
|
+
isRawJSON: define("json/is-raw-json", ["es.json.is-raw-json"]),
|
|
144
|
+
parse: define("json/parse", ["es.json.parse", "es.object.keys"]),
|
|
145
|
+
rawJSON: define("json/raw-json", ["es.json.raw-json", "es.object.create", "es.object.freeze"]),
|
|
146
|
+
stringify: define("json/stringify", ["es.json.stringify", "es.date.to-json"])
|
|
147
|
+
},
|
|
148
|
+
Math: {
|
|
149
|
+
DEG_PER_RAD: define("math/deg-per-rad", ["esnext.math.deg-per-rad"]),
|
|
150
|
+
RAD_PER_DEG: define("math/rad-per-deg", ["esnext.math.rad-per-deg"]),
|
|
151
|
+
acosh: define("math/acosh", ["es.math.acosh"]),
|
|
152
|
+
asinh: define("math/asinh", ["es.math.asinh"]),
|
|
153
|
+
atanh: define("math/atanh", ["es.math.atanh"]),
|
|
154
|
+
cbrt: define("math/cbrt", ["es.math.cbrt"]),
|
|
155
|
+
clamp: define("math/clamp", ["esnext.math.clamp"]),
|
|
156
|
+
clz32: define("math/clz32", ["es.math.clz32"]),
|
|
157
|
+
cosh: define("math/cosh", ["es.math.cosh"]),
|
|
158
|
+
degrees: define("math/degrees", ["esnext.math.degrees"]),
|
|
159
|
+
expm1: define("math/expm1", ["es.math.expm1"]),
|
|
160
|
+
fround: define("math/fround", ["es.math.fround"]),
|
|
161
|
+
f16round: define("math/f16round", ["es.math.f16round"]),
|
|
162
|
+
fscale: define("math/fscale", ["esnext.math.fscale"]),
|
|
163
|
+
hypot: define("math/hypot", ["es.math.hypot"]),
|
|
164
|
+
iaddh: define("math/iaddh", ["esnext.math.iaddh"]),
|
|
165
|
+
imul: define("math/imul", ["es.math.imul"]),
|
|
166
|
+
imulh: define("math/imulh", ["esnext.math.imulh"]),
|
|
167
|
+
isubh: define("math/isubh", ["esnext.math.isubh"]),
|
|
168
|
+
log10: define("math/log10", ["es.math.log10"]),
|
|
169
|
+
log1p: define("math/log1p", ["es.math.log1p"]),
|
|
170
|
+
log2: define("math/log2", ["es.math.log2"]),
|
|
171
|
+
radians: define("math/radians", ["esnext.math.radians"]),
|
|
172
|
+
scale: define("math/scale", ["esnext.math.scale"]),
|
|
173
|
+
seededPRNG: define("math/seeded-prng", ["esnext.math.seeded-prng"]),
|
|
174
|
+
sign: define("math/sign", ["es.math.sign"]),
|
|
175
|
+
signbit: define("math/signbit", ["esnext.math.signbit"]),
|
|
176
|
+
sinh: define("math/sinh", ["es.math.sinh"]),
|
|
177
|
+
sumPrecise: define("math/sum-precise", ["es.math.sum-precise", "es.array.iterator"]),
|
|
178
|
+
tanh: define("math/tanh", ["es.math.tanh"]),
|
|
179
|
+
trunc: define("math/trunc", ["es.math.trunc"]),
|
|
180
|
+
umulh: define("math/umulh", ["esnext.math.umulh"])
|
|
181
|
+
},
|
|
182
|
+
Map: {
|
|
183
|
+
from: define("map/from", ["esnext.map.from", ...MapDependencies]),
|
|
184
|
+
groupBy: define("map/group-by", ["es.map.group-by", ...MapDependencies]),
|
|
185
|
+
keyBy: define("map/key-by", ["esnext.map.key-by", ...MapDependencies]),
|
|
186
|
+
of: define("map/of", ["esnext.map.of", ...MapDependencies])
|
|
187
|
+
},
|
|
188
|
+
Number: {
|
|
189
|
+
EPSILON: define("number/epsilon", ["es.number.epsilon"]),
|
|
190
|
+
MAX_SAFE_INTEGER: define("number/max-safe-integer", ["es.number.max-safe-integer"]),
|
|
191
|
+
MIN_SAFE_INTEGER: define("number/min-safe-integer", ["es.number.min-safe-integer"]),
|
|
192
|
+
fromString: define("number/from-string", ["esnext.number.from-string"]),
|
|
193
|
+
isFinite: define("number/is-finite", ["es.number.is-finite"]),
|
|
194
|
+
isInteger: define("number/is-integer", ["es.number.is-integer"]),
|
|
195
|
+
isNaN: define("number/is-nan", ["es.number.is-nan"]),
|
|
196
|
+
isSafeInteger: define("number/is-safe-integer", ["es.number.is-safe-integer"]),
|
|
197
|
+
parseFloat: define("number/parse-float", ["es.number.parse-float"]),
|
|
198
|
+
parseInt: define("number/parse-int", ["es.number.parse-int"]),
|
|
199
|
+
range: define("number/range", ["esnext.number.range", "es.object.to-string"])
|
|
200
|
+
},
|
|
201
|
+
Object: {
|
|
202
|
+
assign: define("object/assign", ["es.object.assign"]),
|
|
203
|
+
create: define("object/create", ["es.object.create"]),
|
|
204
|
+
defineProperties: define("object/define-properties", ["es.object.define-properties"]),
|
|
205
|
+
defineProperty: define("object/define-property", ["es.object.define-property"]),
|
|
206
|
+
entries: define("object/entries", ["es.object.entries"]),
|
|
207
|
+
freeze: define("object/freeze", ["es.object.freeze"]),
|
|
208
|
+
fromEntries: define("object/from-entries", ["es.object.from-entries", "es.array.iterator"]),
|
|
209
|
+
getOwnPropertyDescriptor: define("object/get-own-property-descriptor", ["es.object.get-own-property-descriptor"]),
|
|
210
|
+
getOwnPropertyDescriptors: define("object/get-own-property-descriptors", ["es.object.get-own-property-descriptors"]),
|
|
211
|
+
getOwnPropertyNames: define("object/get-own-property-names", ["es.object.get-own-property-names"]),
|
|
212
|
+
getOwnPropertySymbols: define("object/get-own-property-symbols", ["es.symbol"]),
|
|
213
|
+
getPrototypeOf: define("object/get-prototype-of", ["es.object.get-prototype-of"]),
|
|
214
|
+
groupBy: define("object/group-by", ["es.object.group-by", "es.object.create"]),
|
|
215
|
+
hasOwn: define("object/has-own", ["es.object.has-own"]),
|
|
216
|
+
is: define("object/is", ["es.object.is"]),
|
|
217
|
+
isExtensible: define("object/is-extensible", ["es.object.is-extensible"]),
|
|
218
|
+
isFrozen: define("object/is-frozen", ["es.object.is-frozen"]),
|
|
219
|
+
isSealed: define("object/is-sealed", ["es.object.is-sealed"]),
|
|
220
|
+
keys: define("object/keys", ["es.object.keys"]),
|
|
221
|
+
preventExtensions: define("object/prevent-extensions", ["es.object.prevent-extensions"]),
|
|
222
|
+
seal: define("object/seal", ["es.object.seal"]),
|
|
223
|
+
setPrototypeOf: define("object/set-prototype-of", ["es.object.set-prototype-of"]),
|
|
224
|
+
values: define("object/values", ["es.object.values"])
|
|
225
|
+
},
|
|
226
|
+
Promise: {
|
|
227
|
+
all: define(null, PromiseDependenciesWithIterators),
|
|
228
|
+
allSettled: define("promise/all-settled", ["es.promise.all-settled", ...PromiseDependenciesWithIterators]),
|
|
229
|
+
any: define("promise/any", ["es.promise.any", "es.aggregate-error", ...PromiseDependenciesWithIterators]),
|
|
230
|
+
race: define(null, PromiseDependenciesWithIterators),
|
|
231
|
+
try: define("promise/try", ["es.promise.try", ...PromiseDependencies]),
|
|
232
|
+
withResolvers: define("promise/with-resolvers", ["es.promise.with-resolvers", ...PromiseDependencies])
|
|
233
|
+
},
|
|
234
|
+
Reflect: {
|
|
235
|
+
apply: define("reflect/apply", ["es.reflect.apply"]),
|
|
236
|
+
construct: define("reflect/construct", ["es.reflect.construct"]),
|
|
237
|
+
defineMetadata: define("reflect/define-metadata", ["esnext.reflect.define-metadata"]),
|
|
238
|
+
defineProperty: define("reflect/define-property", ["es.reflect.define-property"]),
|
|
239
|
+
deleteMetadata: define("reflect/delete-metadata", ["esnext.reflect.delete-metadata"]),
|
|
240
|
+
deleteProperty: define("reflect/delete-property", ["es.reflect.delete-property"]),
|
|
241
|
+
get: define("reflect/get", ["es.reflect.get"]),
|
|
242
|
+
getMetadata: define("reflect/get-metadata", ["esnext.reflect.get-metadata"]),
|
|
243
|
+
getMetadataKeys: define("reflect/get-metadata-keys", ["esnext.reflect.get-metadata-keys"]),
|
|
244
|
+
getOwnMetadata: define("reflect/get-own-metadata", ["esnext.reflect.get-own-metadata"]),
|
|
245
|
+
getOwnMetadataKeys: define("reflect/get-own-metadata-keys", ["esnext.reflect.get-own-metadata-keys"]),
|
|
246
|
+
getOwnPropertyDescriptor: define("reflect/get-own-property-descriptor", ["es.reflect.get-own-property-descriptor"]),
|
|
247
|
+
getPrototypeOf: define("reflect/get-prototype-of", ["es.reflect.get-prototype-of"]),
|
|
248
|
+
has: define("reflect/has", ["es.reflect.has"]),
|
|
249
|
+
hasMetadata: define("reflect/has-metadata", ["esnext.reflect.has-metadata"]),
|
|
250
|
+
hasOwnMetadata: define("reflect/has-own-metadata", ["esnext.reflect.has-own-metadata"]),
|
|
251
|
+
isExtensible: define("reflect/is-extensible", ["es.reflect.is-extensible"]),
|
|
252
|
+
metadata: define("reflect/metadata", ["esnext.reflect.metadata"]),
|
|
253
|
+
ownKeys: define("reflect/own-keys", ["es.reflect.own-keys"]),
|
|
254
|
+
preventExtensions: define("reflect/prevent-extensions", ["es.reflect.prevent-extensions"]),
|
|
255
|
+
set: define("reflect/set", ["es.reflect.set"]),
|
|
256
|
+
setPrototypeOf: define("reflect/set-prototype-of", ["es.reflect.set-prototype-of"])
|
|
257
|
+
},
|
|
258
|
+
RegExp: {
|
|
259
|
+
escape: define("regexp/escape", ["es.regexp.escape"])
|
|
260
|
+
},
|
|
261
|
+
Set: {
|
|
262
|
+
from: define("set/from", ["esnext.set.from", ...SetDependencies]),
|
|
263
|
+
of: define("set/of", ["esnext.set.of", ...SetDependencies])
|
|
264
|
+
},
|
|
265
|
+
String: {
|
|
266
|
+
cooked: define("string/cooked", ["esnext.string.cooked"]),
|
|
267
|
+
dedent: define("string/dedent", ["esnext.string.dedent", "es.string.from-code-point", "es.weak-map"]),
|
|
268
|
+
fromCodePoint: define("string/from-code-point", ["es.string.from-code-point"]),
|
|
269
|
+
raw: define("string/raw", ["es.string.raw"])
|
|
270
|
+
},
|
|
271
|
+
Symbol: {
|
|
272
|
+
asyncDispose: define("symbol/async-dispose", ["es.symbol.async-dispose", "es.async-iterator.async-dispose"]),
|
|
273
|
+
asyncIterator: define("symbol/async-iterator", ["es.symbol.async-iterator"]),
|
|
274
|
+
customMatcher: define("symbol/custom-matcher", ["esnext.symbol.custom-matcher"]),
|
|
275
|
+
dispose: define("symbol/dispose", ["es.symbol.dispose", "es.iterator.dispose"]),
|
|
276
|
+
for: define("symbol/for", [], "es.symbol"),
|
|
277
|
+
hasInstance: define("symbol/has-instance", ["es.symbol.has-instance", "es.function.has-instance"]),
|
|
278
|
+
isConcatSpreadable: define("symbol/is-concat-spreadable", ["es.symbol.is-concat-spreadable", "es.array.concat"]),
|
|
279
|
+
isRegistered: define("symbol/is-registered", ["esnext.symbol.is-registered", "es.symbol"]),
|
|
280
|
+
isRegisteredSymbol: define("symbol/is-registered-symbol", ["esnext.symbol.is-registered-symbol", "es.symbol"]),
|
|
281
|
+
isWellKnown: define("symbol/is-well-known", ["esnext.symbol.is-well-known", "es.symbol"]),
|
|
282
|
+
isWellKnownSymbol: define("symbol/is-well-known-symbol", ["esnext.symbol.is-well-known-symbol", "es.symbol"]),
|
|
283
|
+
iterator: define("symbol/iterator", ["es.symbol.iterator", ...CommonIteratorsWithTag]),
|
|
284
|
+
keyFor: define("symbol/key-for", [], "es.symbol"),
|
|
285
|
+
match: define("symbol/match", ["es.symbol.match", "es.string.match"]),
|
|
286
|
+
matcher: define("symbol/matcher", ["esnext.symbol.matcher"]),
|
|
287
|
+
matchAll: define("symbol/match-all", ["es.symbol.match-all", "es.string.match-all"]),
|
|
288
|
+
metadata: define("symbol/metadata", DecoratorMetadataDependencies),
|
|
289
|
+
metadataKey: define("symbol/metadata-key", ["esnext.symbol.metadata-key"]),
|
|
290
|
+
observable: define("symbol/observable", ["esnext.symbol.observable"]),
|
|
291
|
+
patternMatch: define("symbol/pattern-match", ["esnext.symbol.pattern-match"]),
|
|
292
|
+
replace: define("symbol/replace", ["es.symbol.replace", "es.string.replace"]),
|
|
293
|
+
search: define("symbol/search", ["es.symbol.search", "es.string.search"]),
|
|
294
|
+
species: define("symbol/species", ["es.symbol.species", "es.array.species"]),
|
|
295
|
+
split: define("symbol/split", ["es.symbol.split", "es.string.split"]),
|
|
296
|
+
toPrimitive: define("symbol/to-primitive", ["es.symbol.to-primitive", "es.date.to-primitive"]),
|
|
297
|
+
toStringTag: define("symbol/to-string-tag", ["es.symbol.to-string-tag", "es.object.to-string", "es.math.to-string-tag", "es.json.to-string-tag"]),
|
|
298
|
+
unscopables: define("symbol/unscopables", ["es.symbol.unscopables"])
|
|
299
|
+
},
|
|
300
|
+
URL: {
|
|
301
|
+
canParse: define("url/can-parse", ["web.url.can-parse", "web.url"]),
|
|
302
|
+
parse: define("url/parse", ["web.url.parse", "web.url"])
|
|
303
|
+
},
|
|
304
|
+
WeakMap: {
|
|
305
|
+
from: define("weak-map/from", ["esnext.weak-map.from", ...WeakMapDependencies]),
|
|
306
|
+
of: define("weak-map/of", ["esnext.weak-map.of", ...WeakMapDependencies])
|
|
307
|
+
},
|
|
308
|
+
WeakSet: {
|
|
309
|
+
from: define("weak-set/from", ["esnext.weak-set.from", ...WeakSetDependencies]),
|
|
310
|
+
of: define("weak-set/of", ["esnext.weak-set.of", ...WeakSetDependencies])
|
|
311
|
+
},
|
|
312
|
+
Int8Array: TypedArrayStaticMethods("es.typed-array.int8-array"),
|
|
313
|
+
Uint8Array: {
|
|
314
|
+
fromBase64: define(null, ["es.uint8-array.from-base64", ...TypedArrayDependencies]),
|
|
315
|
+
fromHex: define(null, ["es.uint8-array.from-hex", ...TypedArrayDependencies]),
|
|
316
|
+
...TypedArrayStaticMethods("es.typed-array.uint8-array")
|
|
317
|
+
},
|
|
318
|
+
Uint8ClampedArray: TypedArrayStaticMethods("es.typed-array.uint8-clamped-array"),
|
|
319
|
+
Int16Array: TypedArrayStaticMethods("es.typed-array.int16-array"),
|
|
320
|
+
Uint16Array: TypedArrayStaticMethods("es.typed-array.uint16-array"),
|
|
321
|
+
Int32Array: TypedArrayStaticMethods("es.typed-array.int32-array"),
|
|
322
|
+
Uint32Array: TypedArrayStaticMethods("es.typed-array.uint32-array"),
|
|
323
|
+
Float32Array: TypedArrayStaticMethods("es.typed-array.float32-array"),
|
|
324
|
+
Float64Array: TypedArrayStaticMethods("es.typed-array.float64-array"),
|
|
325
|
+
WebAssembly: {
|
|
326
|
+
CompileError: define(null, ErrorDependencies),
|
|
327
|
+
LinkError: define(null, ErrorDependencies),
|
|
328
|
+
RuntimeError: define(null, ErrorDependencies)
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
["AggregateError", "EvalError", "RangeError", "ReferenceError", "SuppressedError", "SyntaxError", "TypeError", "URIError"].forEach(ERROR_SUBCLASS => {
|
|
332
|
+
StaticProperties[ERROR_SUBCLASS] = StaticProperties.Error;
|
|
333
|
+
});
|
|
334
|
+
const InstanceProperties = {
|
|
335
|
+
asIndexedPairs: define(null, ["esnext.async-iterator.as-indexed-pairs", ...AsyncIteratorDependencies, "esnext.iterator.as-indexed-pairs", ...IteratorDependencies]),
|
|
336
|
+
at: define("instance/at", [
|
|
337
|
+
// TODO: We should introduce overloaded instance methods definition
|
|
338
|
+
// Before that is implemented, the `esnext.string.at` must be the first
|
|
339
|
+
// In pure mode, the provider resolves the descriptor as a "pure" `esnext.string.at`
|
|
340
|
+
// and treats the compat-data of `esnext.string.at` as the compat-data of
|
|
341
|
+
// pure import `instance/at`. The first polyfill here should have the lowest corejs
|
|
342
|
+
// supported versions.
|
|
343
|
+
"esnext.string.at", "es.string.at-alternative", "es.array.at"]),
|
|
344
|
+
anchor: define(null, ["es.string.anchor"]),
|
|
345
|
+
big: define(null, ["es.string.big"]),
|
|
346
|
+
bind: define("instance/bind", ["es.function.bind"]),
|
|
347
|
+
blink: define(null, ["es.string.blink"]),
|
|
348
|
+
bold: define(null, ["es.string.bold"]),
|
|
349
|
+
chunks: define(null, ["esnext.iterator.chunks", ...IteratorDependencies]),
|
|
350
|
+
clamp: define("instance/clamp", ["esnext.number.clamp"]),
|
|
351
|
+
codePointAt: define("instance/code-point-at", ["es.string.code-point-at"]),
|
|
352
|
+
codePoints: define("instance/code-points", ["esnext.string.code-points"]),
|
|
353
|
+
concat: define("instance/concat", ["es.array.concat"], undefined, ["String"]),
|
|
354
|
+
copyWithin: define("instance/copy-within", ["es.array.copy-within"]),
|
|
355
|
+
demethodize: define("instance/demethodize", ["esnext.function.demethodize"]),
|
|
356
|
+
description: define(null, ["es.symbol", "es.symbol.description"]),
|
|
357
|
+
dotAll: define(null, ["es.regexp.dot-all"]),
|
|
358
|
+
drop: define(null, ["es.iterator.drop", ...IteratorDependencies, "esnext.async-iterator.drop", ...AsyncIteratorDependencies]),
|
|
359
|
+
endsWith: define("instance/ends-with", ["es.string.ends-with"]),
|
|
360
|
+
entries: define("instance/entries", ArrayNatureIteratorsWithTag),
|
|
361
|
+
every: define("instance/every", ["es.array.every", "es.iterator.every", ...IteratorDependencies
|
|
362
|
+
// TODO: add async iterator dependencies when we support sub-dependencies
|
|
363
|
+
// esnext.async-iterator.every depends on es.promise
|
|
364
|
+
// but we don't want to pull es.promise when esnext.async-iterator is disabled
|
|
365
|
+
//
|
|
366
|
+
// "esnext.async-iterator.every",
|
|
367
|
+
// ...AsyncIteratorDependencies
|
|
368
|
+
]),
|
|
369
|
+
exec: define(null, ["es.regexp.exec"]),
|
|
370
|
+
fill: define("instance/fill", ["es.array.fill"]),
|
|
371
|
+
filter: define("instance/filter", ["es.array.filter", "es.iterator.filter", ...IteratorDependencies
|
|
372
|
+
// "esnext.async-iterator.filter",
|
|
373
|
+
]),
|
|
374
|
+
filterReject: define("instance/filter-reject", ["esnext.array.filter-reject"]),
|
|
375
|
+
finally: define(null, ["es.promise.finally", ...PromiseDependencies]),
|
|
376
|
+
find: define("instance/find", ["es.array.find", "es.iterator.find", ...IteratorDependencies
|
|
377
|
+
// "esnext.async-iterator.find",
|
|
378
|
+
]),
|
|
379
|
+
findIndex: define("instance/find-index", ["es.array.find-index"]),
|
|
380
|
+
findLast: define("instance/find-last", ["es.array.find-last"]),
|
|
381
|
+
findLastIndex: define("instance/find-last-index", ["es.array.find-last-index"]),
|
|
382
|
+
fixed: define(null, ["es.string.fixed"]),
|
|
383
|
+
flags: define("instance/flags", ["es.regexp.flags"]),
|
|
384
|
+
flatMap: define("instance/flat-map", ["es.array.flat-map", "es.array.unscopables.flat-map", "es.iterator.flat-map", ...IteratorDependencies
|
|
385
|
+
// "esnext.async-iterator.flat-map",
|
|
386
|
+
]),
|
|
387
|
+
flat: define("instance/flat", ["es.array.flat", "es.array.unscopables.flat"]),
|
|
388
|
+
getFloat16: define(null, ["es.data-view.get-float16", ...DataViewDependencies]),
|
|
389
|
+
getUint8Clamped: define(null, ["esnext.data-view.get-uint8-clamped", ...DataViewDependencies]),
|
|
390
|
+
getYear: define(null, ["es.date.get-year"]),
|
|
391
|
+
group: define("instance/group", ["esnext.array.group"]),
|
|
392
|
+
groupBy: define("instance/group-by", ["esnext.array.group-by"]),
|
|
393
|
+
groupByToMap: define("instance/group-by-to-map", ["esnext.array.group-by-to-map", "es.map", "es.object.to-string"]),
|
|
394
|
+
groupToMap: define("instance/group-to-map", ["esnext.array.group-to-map", "es.map", "es.object.to-string"]),
|
|
395
|
+
fontcolor: define(null, ["es.string.fontcolor"]),
|
|
396
|
+
fontsize: define(null, ["es.string.fontsize"]),
|
|
397
|
+
forEach: define("instance/for-each", ["es.array.for-each", "es.iterator.for-each", ...IteratorDependencies,
|
|
398
|
+
// "esnext.async-iterator.for-each",
|
|
399
|
+
"web.dom-collections.for-each"]),
|
|
400
|
+
includes: define("instance/includes", ["es.array.includes", "es.string.includes"]),
|
|
401
|
+
indexed: define(null, ["esnext.async-iterator.indexed", ...AsyncIteratorDependencies, "esnext.iterator.indexed", ...IteratorDependencies]),
|
|
402
|
+
indexOf: define("instance/index-of", ["es.array.index-of"]),
|
|
403
|
+
isWellFormed: define("instance/is-well-formed", ["es.string.is-well-formed"]),
|
|
404
|
+
italics: define(null, ["es.string.italics"]),
|
|
405
|
+
join: define(null, ["es.array.join"]),
|
|
406
|
+
keys: define("instance/keys", ArrayNatureIteratorsWithTag),
|
|
407
|
+
lastIndex: define(null, ["esnext.array.last-index"]),
|
|
408
|
+
lastIndexOf: define("instance/last-index-of", ["es.array.last-index-of"]),
|
|
409
|
+
lastItem: define(null, ["esnext.array.last-item"]),
|
|
410
|
+
link: define(null, ["es.string.link"]),
|
|
411
|
+
map: define("instance/map", ["es.array.map", "es.iterator.map", ...IteratorDependencies
|
|
412
|
+
// "esnext.async-iterator.map",
|
|
413
|
+
]),
|
|
414
|
+
match: define(null, ["es.string.match", "es.regexp.exec"]),
|
|
415
|
+
matchAll: define("instance/match-all", ["es.string.match-all", "es.regexp.exec"]),
|
|
416
|
+
name: define(null, ["es.function.name"]),
|
|
417
|
+
padEnd: define("instance/pad-end", ["es.string.pad-end"]),
|
|
418
|
+
padStart: define("instance/pad-start", ["es.string.pad-start"]),
|
|
419
|
+
push: define("instance/push", ["es.array.push"]),
|
|
420
|
+
reduce: define("instance/reduce", ["es.array.reduce", "es.iterator.reduce", ...IteratorDependencies
|
|
421
|
+
// "esnext.async-iterator.reduce",
|
|
422
|
+
]),
|
|
423
|
+
reduceRight: define("instance/reduce-right", ["es.array.reduce-right"]),
|
|
424
|
+
repeat: define("instance/repeat", ["es.string.repeat"]),
|
|
425
|
+
replace: define(null, ["es.string.replace", "es.regexp.exec"]),
|
|
426
|
+
replaceAll: define("instance/replace-all", ["es.string.replace-all", "es.string.replace", "es.regexp.exec"]),
|
|
427
|
+
reverse: define("instance/reverse", ["es.array.reverse"]),
|
|
428
|
+
search: define(null, ["es.string.search", "es.regexp.exec"]),
|
|
429
|
+
setFloat16: define(null, ["es.data-view.set-float16", ...DataViewDependencies]),
|
|
430
|
+
setUint8Clamped: define(null, ["esnext.data-view.set-uint8-clamped", ...DataViewDependencies]),
|
|
431
|
+
setYear: define(null, ["es.date.set-year"]),
|
|
432
|
+
slice: define("instance/slice", ["es.array.slice"]),
|
|
433
|
+
sliding: define(null, ["esnext.iterator.sliding", ...IteratorDependencies]),
|
|
434
|
+
small: define(null, ["es.string.small"]),
|
|
435
|
+
some: define("instance/some", ["es.array.some", "es.iterator.some", ...IteratorDependencies
|
|
436
|
+
// "esnext.async-iterator.some",
|
|
437
|
+
]),
|
|
438
|
+
sort: define("instance/sort", ["es.array.sort"]),
|
|
439
|
+
splice: define("instance/splice", ["es.array.splice"]),
|
|
440
|
+
split: define(null, ["es.string.split", "es.regexp.exec"]),
|
|
441
|
+
startsWith: define("instance/starts-with", ["es.string.starts-with"]),
|
|
442
|
+
sticky: define(null, ["es.regexp.sticky"]),
|
|
443
|
+
strike: define(null, ["es.string.strike"]),
|
|
444
|
+
sub: define(null, ["es.string.sub"]),
|
|
445
|
+
substr: define(null, ["es.string.substr"]),
|
|
446
|
+
sup: define(null, ["es.string.sup"]),
|
|
447
|
+
take: define(null, ["es.iterator.take", ...IteratorDependencies, "esnext.async-iterator.take", ...AsyncIteratorDependencies]),
|
|
448
|
+
test: define(null, ["es.regexp.test", "es.regexp.exec"]),
|
|
449
|
+
toArray: define(null, ["es.iterator.to-array", ...IteratorDependencies, "esnext.async-iterator.to-array", ...AsyncIteratorDependencies]),
|
|
450
|
+
toAsync: define(null, ["esnext.iterator.to-async", ...IteratorDependencies, ...AsyncIteratorDependencies, ...AsyncIteratorProblemMethods]),
|
|
451
|
+
toExponential: define(null, ["es.number.to-exponential"]),
|
|
452
|
+
toFixed: define(null, ["es.number.to-fixed"]),
|
|
453
|
+
toGMTString: define(null, ["es.date.to-gmt-string"]),
|
|
454
|
+
toISOString: define(null, ["es.date.to-iso-string"]),
|
|
455
|
+
toJSON: define(null, ["es.date.to-json"]),
|
|
456
|
+
toPrecision: define(null, ["es.number.to-precision"]),
|
|
457
|
+
toReversed: define("instance/to-reversed", ["es.array.to-reversed"]),
|
|
458
|
+
toSorted: define("instance/to-sorted", ["es.array.to-sorted", "es.array.sort"]),
|
|
459
|
+
toSpliced: define("instance/to-spliced", ["es.array.to-spliced"]),
|
|
460
|
+
toString: define(null, ["es.object.to-string", "es.error.to-string", "es.date.to-string", "es.regexp.to-string"]),
|
|
461
|
+
toWellFormed: define("instance/to-well-formed", ["es.string.to-well-formed"]),
|
|
462
|
+
trim: define("instance/trim", ["es.string.trim"]),
|
|
463
|
+
trimEnd: define("instance/trim-end", ["es.string.trim-end"]),
|
|
464
|
+
trimLeft: define("instance/trim-left", ["es.string.trim-start"]),
|
|
465
|
+
trimRight: define("instance/trim-right", ["es.string.trim-end"]),
|
|
466
|
+
trimStart: define("instance/trim-start", ["es.string.trim-start"]),
|
|
467
|
+
uniqueBy: define("instance/unique-by", ["esnext.array.unique-by", "es.map"]),
|
|
468
|
+
unshift: define("instance/unshift", ["es.array.unshift"]),
|
|
469
|
+
unThis: define("instance/un-this", ["esnext.function.un-this"]),
|
|
470
|
+
values: define("instance/values", ArrayNatureIteratorsWithTag),
|
|
471
|
+
windows: define(null, ["esnext.iterator.windows", ...IteratorDependencies]),
|
|
472
|
+
with: define("instance/with", ["es.array.with"]),
|
|
473
|
+
__defineGetter__: define(null, ["es.object.define-getter"]),
|
|
474
|
+
__defineSetter__: define(null, ["es.object.define-setter"]),
|
|
475
|
+
__lookupGetter__: define(null, ["es.object.lookup-getter"]),
|
|
476
|
+
__lookupSetter__: define(null, ["es.object.lookup-setter"]),
|
|
477
|
+
["__proto__"]: define(null, ["es.object.proto"])
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
// This file contains the list of paths supported by @babel/runtime-corejs3.
|
|
481
|
+
// It must _not_ be edited, as all new features should go through direct
|
|
482
|
+
// injection of core-js-pure imports.
|
|
483
|
+
|
|
484
|
+
const stable = new Set(["array", "array/from", "array/is-array", "array/of", "clear-immediate", "date/now", "instance/bind", "instance/code-point-at", "instance/concat", "instance/copy-within", "instance/ends-with", "instance/entries", "instance/every", "instance/fill", "instance/filter", "instance/find", "instance/find-index", "instance/flags", "instance/flat", "instance/flat-map", "instance/for-each", "instance/includes", "instance/index-of", "instance/keys", "instance/last-index-of", "instance/map", "instance/pad-end", "instance/pad-start", "instance/reduce", "instance/reduce-right", "instance/repeat", "instance/reverse", "instance/slice", "instance/some", "instance/sort", "instance/splice", "instance/starts-with", "instance/trim", "instance/trim-end", "instance/trim-left", "instance/trim-right", "instance/trim-start", "instance/values", "json/stringify", "map", "math/acosh", "math/asinh", "math/atanh", "math/cbrt", "math/clz32", "math/cosh", "math/expm1", "math/fround", "math/hypot", "math/imul", "math/log10", "math/log1p", "math/log2", "math/sign", "math/sinh", "math/tanh", "math/trunc", "number/epsilon", "number/is-finite", "number/is-integer", "number/is-nan", "number/is-safe-integer", "number/max-safe-integer", "number/min-safe-integer", "number/parse-float", "number/parse-int", "object/assign", "object/create", "object/define-properties", "object/define-property", "object/entries", "object/freeze", "object/from-entries", "object/get-own-property-descriptor", "object/get-own-property-descriptors", "object/get-own-property-names", "object/get-own-property-symbols", "object/get-prototype-of", "object/is", "object/is-extensible", "object/is-frozen", "object/is-sealed", "object/keys", "object/prevent-extensions", "object/seal", "object/set-prototype-of", "object/values", "parse-float", "parse-int", "promise", "queue-microtask", "reflect/apply", "reflect/construct", "reflect/define-property", "reflect/delete-property", "reflect/get", "reflect/get-own-property-descriptor", "reflect/get-prototype-of", "reflect/has", "reflect/is-extensible", "reflect/own-keys", "reflect/prevent-extensions", "reflect/set", "reflect/set-prototype-of", "set", "set-immediate", "set-interval", "set-timeout", "string/from-code-point", "string/raw", "symbol", "symbol/async-iterator", "symbol/for", "symbol/has-instance", "symbol/is-concat-spreadable", "symbol/iterator", "symbol/key-for", "symbol/match", "symbol/replace", "symbol/search", "symbol/species", "symbol/split", "symbol/to-primitive", "symbol/to-string-tag", "symbol/unscopables", "url", "url-search-params", "weak-map", "weak-set"]);
|
|
485
|
+
const proposals = new Set([...stable, "aggregate-error", "composite-key", "composite-symbol", "global-this", "instance/at", "instance/code-points", "instance/match-all", "instance/replace-all", "math/clamp", "math/degrees", "math/deg-per-rad", "math/fscale", "math/iaddh", "math/imulh", "math/isubh", "math/rad-per-deg", "math/radians", "math/scale", "math/seeded-prng", "math/signbit", "math/umulh", "number/from-string", "observable", "reflect/define-metadata", "reflect/delete-metadata", "reflect/get-metadata", "reflect/get-metadata-keys", "reflect/get-own-metadata", "reflect/get-own-metadata-keys", "reflect/has-metadata", "reflect/has-own-metadata", "reflect/metadata", "symbol/dispose", "symbol/observable", "symbol/pattern-match"]);
|
|
486
|
+
|
|
487
|
+
const {
|
|
488
|
+
types: t$2
|
|
489
|
+
} = _babelCore.default && _babelCore.default.__esModule ? _babelCore.default : _babelCore;
|
|
490
|
+
function canSkipPolyfill(desc, path) {
|
|
491
|
+
const {
|
|
492
|
+
node,
|
|
493
|
+
parent
|
|
494
|
+
} = path;
|
|
495
|
+
switch (desc.name) {
|
|
496
|
+
case "es.string.split":
|
|
497
|
+
{
|
|
498
|
+
if (!t$2.isCallExpression(parent, {
|
|
499
|
+
callee: node
|
|
500
|
+
})) return false;
|
|
501
|
+
if (parent.arguments.length < 1) return true;
|
|
502
|
+
const splitter = parent.arguments[0];
|
|
503
|
+
return t$2.isStringLiteral(splitter) || t$2.isTemplateLiteral(splitter);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
const {
|
|
509
|
+
types: t$1
|
|
510
|
+
} = _babelCore.default && _babelCore.default.__esModule ? _babelCore.default : _babelCore;
|
|
511
|
+
const BABEL_RUNTIME = "@babel/runtime-corejs3";
|
|
512
|
+
function callMethod(path, id, optionalCall, wrapCallee) {
|
|
513
|
+
const [context1, context2] = maybeMemoizeContext(path.node, path.scope);
|
|
514
|
+
let callee = t$1.callExpression(id, [context1]);
|
|
515
|
+
if (wrapCallee) callee = wrapCallee(callee);
|
|
516
|
+
const call = t$1.identifier("call");
|
|
517
|
+
path.replaceWith(optionalCall ? t$1.optionalMemberExpression(callee, call, false, true) : t$1.memberExpression(callee, call));
|
|
518
|
+
path.parentPath.unshiftContainer("arguments", context2);
|
|
519
|
+
}
|
|
520
|
+
function maybeMemoizeContext(node, scope) {
|
|
521
|
+
const {
|
|
522
|
+
object
|
|
523
|
+
} = node;
|
|
524
|
+
let context1, context2;
|
|
525
|
+
if (t$1.isIdentifier(object)) {
|
|
526
|
+
context2 = object;
|
|
527
|
+
context1 = t$1.cloneNode(object);
|
|
528
|
+
} else {
|
|
529
|
+
context2 = scope.generateDeclaredUidIdentifier("context");
|
|
530
|
+
context1 = t$1.assignmentExpression("=", t$1.cloneNode(context2), object);
|
|
531
|
+
}
|
|
532
|
+
return [context1, context2];
|
|
533
|
+
}
|
|
534
|
+
function extractOptionalCheck(scope, node) {
|
|
535
|
+
let optionalNode = node;
|
|
536
|
+
while (!optionalNode.optional && t$1.isOptionalMemberExpression(optionalNode.object)) {
|
|
537
|
+
optionalNode = optionalNode.object;
|
|
538
|
+
}
|
|
539
|
+
optionalNode.optional = false;
|
|
540
|
+
const ctx = scope.generateDeclaredUidIdentifier("context");
|
|
541
|
+
const assign = t$1.assignmentExpression("=", ctx, optionalNode.object);
|
|
542
|
+
optionalNode.object = t$1.cloneNode(ctx);
|
|
543
|
+
return ifNotNullish => t$1.conditionalExpression(t$1.binaryExpression("==", assign, t$1.nullLiteral()), t$1.unaryExpression("void", t$1.numericLiteral(0)), ifNotNullish);
|
|
544
|
+
}
|
|
545
|
+
function isCoreJSSource(source) {
|
|
546
|
+
if (typeof source === "string") {
|
|
547
|
+
source = source.replace(/\\/g, "/").replace(/(\/(index)?)?(\.js)?$/i, "").toLowerCase();
|
|
548
|
+
}
|
|
549
|
+
return Object.prototype.hasOwnProperty.call(corejsEntries, source) && corejsEntries[source];
|
|
550
|
+
}
|
|
551
|
+
function coreJSModule(name) {
|
|
552
|
+
return `core-js/modules/${name}.js`;
|
|
553
|
+
}
|
|
554
|
+
function coreJSPureHelper(name, useBabelRuntime, ext) {
|
|
555
|
+
return useBabelRuntime ? `${BABEL_RUNTIME}/core-js/${name}${ext}` : `core-js-pure/features/${name}.js`;
|
|
556
|
+
}
|
|
2
557
|
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.default = void 0;
|
|
5
|
-
var _data = _interopRequireDefault(require("../core-js-compat/data.js"));
|
|
6
|
-
var _shippedProposals = _interopRequireDefault(require("./shipped-proposals"));
|
|
7
|
-
var _getModulesListForTargetVersion = _interopRequireDefault(require("../core-js-compat/get-modules-list-for-target-version.js"));
|
|
8
|
-
var _builtInDefinitions = require("./built-in-definitions");
|
|
9
|
-
var BabelRuntimePaths = _interopRequireWildcard(require("./babel-runtime-corejs3-paths"));
|
|
10
|
-
var _usageFilters = _interopRequireDefault(require("./usage-filters"));
|
|
11
|
-
var _babel = _interopRequireWildcard(require("@babel/core"));
|
|
12
|
-
var _utils = require("./utils");
|
|
13
|
-
var _helperDefinePolyfillProvider = _interopRequireDefault(require("@babel/helper-define-polyfill-provider"));
|
|
14
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
17
558
|
const {
|
|
18
559
|
types: t,
|
|
19
560
|
template: template
|
|
20
|
-
} =
|
|
561
|
+
} = _babelCore.default && _babelCore.default.__esModule ? _babelCore.default : _babelCore;
|
|
21
562
|
const presetEnvCompat = "#__secret_key__@babel/preset-env__compatibility";
|
|
22
563
|
const runtimeCompat = "#__secret_key__@babel/runtime__compatibility";
|
|
23
564
|
const uniqueObjects = ["array", "string", "iterator", "async-iterator", "dom-collections"].map(v => new RegExp(`[a-z]*\\.${v}\\..*`));
|
|
@@ -25,10 +566,10 @@ const esnextFallback = (name, cb) => {
|
|
|
25
566
|
if (cb(name)) return true;
|
|
26
567
|
if (!name.startsWith("es.")) return false;
|
|
27
568
|
const fallback = `esnext.${name.slice(3)}`;
|
|
28
|
-
if (!
|
|
569
|
+
if (!corejs3Polyfills[fallback]) return false;
|
|
29
570
|
return cb(fallback);
|
|
30
571
|
};
|
|
31
|
-
var
|
|
572
|
+
var index = defineProvider(function ({
|
|
32
573
|
getUtils,
|
|
33
574
|
method,
|
|
34
575
|
shouldInjectPolyfill,
|
|
@@ -37,7 +578,7 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
37
578
|
babel
|
|
38
579
|
}, {
|
|
39
580
|
version = 3,
|
|
40
|
-
proposals,
|
|
581
|
+
proposals: proposals$1,
|
|
41
582
|
shippedProposals,
|
|
42
583
|
[presetEnvCompat]: {
|
|
43
584
|
noRuntimeName = false
|
|
@@ -47,20 +588,20 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
47
588
|
ext = ".js"
|
|
48
589
|
} = {}
|
|
49
590
|
}) {
|
|
50
|
-
const isWebpack = babel.caller(caller =>
|
|
591
|
+
const isWebpack = babel.caller(caller => caller?.name === "babel-loader");
|
|
51
592
|
const resolve = createMetaResolver({
|
|
52
|
-
global:
|
|
53
|
-
static:
|
|
54
|
-
instance:
|
|
593
|
+
global: BuiltIns,
|
|
594
|
+
static: StaticProperties,
|
|
595
|
+
instance: InstanceProperties
|
|
55
596
|
});
|
|
56
|
-
const available = new Set((
|
|
597
|
+
const available = new Set(getModulesListForTargetVersion(String(version)));
|
|
57
598
|
function getCoreJSPureBase(useProposalBase) {
|
|
58
|
-
return useBabelRuntime ? useProposalBase ? `${
|
|
599
|
+
return useBabelRuntime ? useProposalBase ? `${BABEL_RUNTIME}/core-js` : `${BABEL_RUNTIME}/core-js-stable` : useProposalBase ? "core-js-pure/features" : "core-js-pure/stable";
|
|
59
600
|
}
|
|
60
601
|
function maybeInjectGlobalImpl(name, utils) {
|
|
61
602
|
if (shouldInjectPolyfill(name)) {
|
|
62
603
|
debug(name);
|
|
63
|
-
utils.injectGlobalImport(
|
|
604
|
+
utils.injectGlobalImport(coreJSModule(name), name);
|
|
64
605
|
return true;
|
|
65
606
|
}
|
|
66
607
|
return false;
|
|
@@ -80,12 +621,12 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
80
621
|
name
|
|
81
622
|
} = desc;
|
|
82
623
|
let useProposalBase = false;
|
|
83
|
-
if (proposals || shippedProposals && name.startsWith("esnext.")) {
|
|
624
|
+
if (proposals$1 || shippedProposals && name.startsWith("esnext.")) {
|
|
84
625
|
useProposalBase = true;
|
|
85
626
|
} else if (name.startsWith("es.") && !available.has(name)) {
|
|
86
627
|
useProposalBase = true;
|
|
87
628
|
}
|
|
88
|
-
if (useBabelRuntime && !(useProposalBase ?
|
|
629
|
+
if (useBabelRuntime && !(useProposalBase ? proposals : stable).has(desc.pure)) {
|
|
89
630
|
return;
|
|
90
631
|
}
|
|
91
632
|
const coreJSPureBase = getCoreJSPureBase(useProposalBase);
|
|
@@ -97,27 +638,27 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
97
638
|
const esName = `es.${name.slice(7)}`;
|
|
98
639
|
// If its imaginative esName is not in latest compat data, it means
|
|
99
640
|
// the proposal is not stage 4
|
|
100
|
-
return esName in
|
|
641
|
+
return esName in corejs3Polyfills;
|
|
101
642
|
}
|
|
102
643
|
return true;
|
|
103
644
|
}
|
|
104
645
|
return {
|
|
105
646
|
name: "corejs3",
|
|
106
|
-
runtimeName: noRuntimeName ? null :
|
|
107
|
-
polyfills:
|
|
647
|
+
runtimeName: noRuntimeName ? null : BABEL_RUNTIME,
|
|
648
|
+
polyfills: corejs3Polyfills,
|
|
108
649
|
filterPolyfills(name) {
|
|
109
650
|
if (!available.has(name)) return false;
|
|
110
|
-
if (proposals || method === "entry-global") return true;
|
|
111
|
-
if (shippedProposals &&
|
|
651
|
+
if (proposals$1 || method === "entry-global") return true;
|
|
652
|
+
if (shippedProposals && corejs3ShippedProposalsList.has(name)) {
|
|
112
653
|
return true;
|
|
113
654
|
}
|
|
114
655
|
return isFeatureStable(name);
|
|
115
656
|
},
|
|
116
657
|
entryGlobal(meta, utils, path) {
|
|
117
658
|
if (meta.kind !== "import") return;
|
|
118
|
-
const modules =
|
|
659
|
+
const modules = isCoreJSSource(meta.source);
|
|
119
660
|
if (!modules) return;
|
|
120
|
-
if (modules.length === 1 && meta.source ===
|
|
661
|
+
if (modules.length === 1 && meta.source === coreJSModule(modules[0]) && shouldInjectPolyfill(modules[0])) {
|
|
121
662
|
// Avoid infinite loop: do not replace imports with a new copy of
|
|
122
663
|
// themselves.
|
|
123
664
|
debug(null);
|
|
@@ -138,7 +679,7 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
138
679
|
usageGlobal(meta, utils, path) {
|
|
139
680
|
const resolved = resolve(meta);
|
|
140
681
|
if (!resolved) return;
|
|
141
|
-
if ((
|
|
682
|
+
if (canSkipPolyfill(resolved.desc, path)) return;
|
|
142
683
|
let deps = resolved.desc.global;
|
|
143
684
|
if (resolved.kind !== "global" && "object" in meta && meta.object && meta.placement === "prototype") {
|
|
144
685
|
const low = meta.object.toLowerCase();
|
|
@@ -150,7 +691,7 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
150
691
|
usagePure(meta, utils, path) {
|
|
151
692
|
if (meta.kind === "in") {
|
|
152
693
|
if (meta.key === "Symbol.iterator") {
|
|
153
|
-
path.replaceWith(t.callExpression(utils.injectDefaultImport(
|
|
694
|
+
path.replaceWith(t.callExpression(utils.injectDefaultImport(coreJSPureHelper("is-iterable", useBabelRuntime, ext), "isIterable"), [path.node.right] // meta.kind === "in" narrows this
|
|
154
695
|
));
|
|
155
696
|
}
|
|
156
697
|
return;
|
|
@@ -178,27 +719,29 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
178
719
|
callee: node
|
|
179
720
|
})) {
|
|
180
721
|
if (parent.arguments.length === 0) {
|
|
181
|
-
path.parentPath.replaceWith(t.callExpression(utils.injectDefaultImport(
|
|
722
|
+
path.parentPath.replaceWith(t.callExpression(utils.injectDefaultImport(coreJSPureHelper("get-iterator", useBabelRuntime, ext), "getIterator"), [node.object]));
|
|
182
723
|
path.skip();
|
|
183
724
|
} else {
|
|
184
|
-
|
|
725
|
+
callMethod(path, utils.injectDefaultImport(coreJSPureHelper("get-iterator-method", useBabelRuntime, ext), "getIteratorMethod"));
|
|
185
726
|
}
|
|
186
727
|
} else {
|
|
187
|
-
path.replaceWith(t.callExpression(utils.injectDefaultImport(
|
|
728
|
+
path.replaceWith(t.callExpression(utils.injectDefaultImport(coreJSPureHelper("get-iterator-method", useBabelRuntime, ext), "getIteratorMethod"), [path.node.object]));
|
|
188
729
|
}
|
|
189
730
|
return;
|
|
190
731
|
}
|
|
191
732
|
}
|
|
192
733
|
let resolved = resolve(meta);
|
|
193
734
|
if (!resolved) return;
|
|
194
|
-
if ((
|
|
735
|
+
if (canSkipPolyfill(resolved.desc, path)) return;
|
|
195
736
|
if (useBabelRuntime && resolved.desc.pure && resolved.desc.pure.slice(-6) === "/index") {
|
|
196
737
|
// Remove /index, since it doesn't exist in @babel/runtime-corejs3s
|
|
197
|
-
resolved =
|
|
198
|
-
|
|
738
|
+
resolved = {
|
|
739
|
+
...resolved,
|
|
740
|
+
desc: {
|
|
741
|
+
...resolved.desc,
|
|
199
742
|
pure: resolved.desc.pure.slice(0, -6)
|
|
200
|
-
}
|
|
201
|
-
}
|
|
743
|
+
}
|
|
744
|
+
};
|
|
202
745
|
}
|
|
203
746
|
if (resolved.kind === "global") {
|
|
204
747
|
const id = maybeInjectPure(resolved.desc, resolved.name, utils);
|
|
@@ -216,7 +759,7 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
216
759
|
do {
|
|
217
760
|
const parentAsNotOptional = parentPath;
|
|
218
761
|
parentAsNotOptional.type = parentAsNotOptional.node.type = parentPath.type === "OptionalMemberExpression" ? "MemberExpression" : "CallExpression";
|
|
219
|
-
delete
|
|
762
|
+
delete parentPath.node.optional;
|
|
220
763
|
({
|
|
221
764
|
parentPath
|
|
222
765
|
} = parentPath);
|
|
@@ -236,21 +779,21 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
236
779
|
const wasOptional = parent.optional;
|
|
237
780
|
parent.optional = !wasOptional;
|
|
238
781
|
if (!wasOptional) {
|
|
239
|
-
const check =
|
|
240
|
-
const [thisArg, thisArg2] =
|
|
782
|
+
const check = extractOptionalCheck(path.scope, node);
|
|
783
|
+
const [thisArg, thisArg2] = maybeMemoizeContext(node, path.scope);
|
|
241
784
|
path.replaceWith(check(template.expression.ast`
|
|
242
785
|
Function.call.bind(${id}(${thisArg}), ${thisArg2})
|
|
243
786
|
`));
|
|
244
787
|
} else if (t.isOptionalMemberExpression(node)) {
|
|
245
|
-
const check =
|
|
246
|
-
|
|
788
|
+
const check = extractOptionalCheck(path.scope, node);
|
|
789
|
+
callMethod(path, id, true, check);
|
|
247
790
|
} else {
|
|
248
|
-
|
|
791
|
+
callMethod(path, id, true);
|
|
249
792
|
}
|
|
250
793
|
} else if (t.isCallExpression(parent) && parent.callee === node) {
|
|
251
|
-
|
|
794
|
+
callMethod(path, id, false);
|
|
252
795
|
} else if (t.isOptionalMemberExpression(node)) {
|
|
253
|
-
const check =
|
|
796
|
+
const check = extractOptionalCheck(path.scope, node);
|
|
254
797
|
path.replaceWith(check(t.callExpression(id, [node.object])));
|
|
255
798
|
if (t.isOptionalMemberExpression(parent)) parent.optional = true;
|
|
256
799
|
} else {
|
|
@@ -265,45 +808,44 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
265
808
|
const utils = getUtils(path);
|
|
266
809
|
if (isWebpack) {
|
|
267
810
|
// Webpack uses Promise.all to handle dynamic import.
|
|
268
|
-
maybeInjectGlobal(
|
|
811
|
+
maybeInjectGlobal(PromiseDependenciesWithIterators, utils);
|
|
269
812
|
} else {
|
|
270
|
-
maybeInjectGlobal(
|
|
813
|
+
maybeInjectGlobal(PromiseDependencies, utils);
|
|
271
814
|
}
|
|
272
815
|
}
|
|
273
816
|
},
|
|
274
817
|
// (async function () { }).finally(...)
|
|
275
818
|
Function(path) {
|
|
276
819
|
if (path.node.async) {
|
|
277
|
-
maybeInjectGlobal(
|
|
820
|
+
maybeInjectGlobal(PromiseDependencies, getUtils(path));
|
|
278
821
|
}
|
|
279
822
|
},
|
|
280
823
|
// for-of, [a, b] = c
|
|
281
824
|
"ForOfStatement|ArrayPattern"(path) {
|
|
282
|
-
maybeInjectGlobal(
|
|
825
|
+
maybeInjectGlobal(CommonIterators, getUtils(path));
|
|
283
826
|
},
|
|
284
827
|
// [...spread]
|
|
285
828
|
SpreadElement(path) {
|
|
286
829
|
if (!path.parentPath.isObjectExpression()) {
|
|
287
|
-
maybeInjectGlobal(
|
|
830
|
+
maybeInjectGlobal(CommonIterators, getUtils(path));
|
|
288
831
|
}
|
|
289
832
|
},
|
|
290
833
|
// yield*
|
|
291
834
|
YieldExpression(path) {
|
|
292
835
|
if (path.node.delegate) {
|
|
293
|
-
maybeInjectGlobal(
|
|
836
|
+
maybeInjectGlobal(CommonIterators, getUtils(path));
|
|
294
837
|
}
|
|
295
838
|
},
|
|
296
839
|
// Decorators metadata
|
|
297
840
|
Class(path) {
|
|
298
|
-
|
|
299
|
-
const hasDecorators = ((_path$node$decorators = path.node.decorators) == null ? void 0 : _path$node$decorators.length) || path.node.body.body.some(el => {
|
|
300
|
-
var _decorators;
|
|
301
|
-
return (_decorators = el.decorators) == null ? void 0 : _decorators.length;
|
|
302
|
-
});
|
|
841
|
+
const hasDecorators = path.node.decorators?.length || path.node.body.body.some(el => el.decorators?.length);
|
|
303
842
|
if (hasDecorators) {
|
|
304
|
-
maybeInjectGlobal(
|
|
843
|
+
maybeInjectGlobal(DecoratorMetadataDependencies, getUtils(path));
|
|
305
844
|
}
|
|
306
845
|
}
|
|
307
846
|
}
|
|
308
847
|
};
|
|
309
|
-
});
|
|
848
|
+
});
|
|
849
|
+
|
|
850
|
+
export { index as default };
|
|
851
|
+
//# sourceMappingURL=index.js.map
|