babel-plugin-polyfill-es-shims 0.10.11 → 1.0.0-rc.2
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 +251 -16
- package/lib/index.js.map +1 -0
- package/package.json +11 -14
- package/data/polyfills.js +0 -1
- package/lib/mappings.js +0 -240
package/lib/index.js
CHANGED
|
@@ -1,12 +1,244 @@
|
|
|
1
|
-
|
|
1
|
+
import defineProvider from '@babel/helper-define-polyfill-provider';
|
|
2
|
+
import polyfills from '../data/polyfills.json' with { type: 'json' };
|
|
3
|
+
import * as _babelCore from '@babel/core';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const {
|
|
6
|
+
types: t,
|
|
7
|
+
template: template
|
|
8
|
+
} = _babelCore.default && _babelCore.default.__esModule ? _babelCore.default : _babelCore;
|
|
9
|
+
const expr = template.expression.ast;
|
|
10
|
+
const has = Function.call.bind(Object.hasOwnProperty);
|
|
11
|
+
const Globals = {};
|
|
12
|
+
const StaticProperties = {};
|
|
13
|
+
const InstanceProperties = {};
|
|
14
|
+
const lessThanArgs = num => (meta, path) => {
|
|
15
|
+
const {
|
|
16
|
+
node,
|
|
17
|
+
parent
|
|
18
|
+
} = path;
|
|
19
|
+
if (!t.isNewExpression(parent, {
|
|
20
|
+
callee: node
|
|
21
|
+
})) return false;
|
|
22
|
+
if (parent.arguments.length >= num) return false;
|
|
23
|
+
return parent.arguments.every(arg => !t.isSpreadElement(arg));
|
|
24
|
+
};
|
|
25
|
+
for (const [name, causeArgNum] of [["Error", 2], ["AggregateError", 3], ["EvalError", 2], ["RangeError", 2], ["ReferenceError", 2], ["SyntaxError", 2], ["TypeError", 2], ["URIError", 2]
|
|
26
|
+
// SuppressedError is not in this list because it does not have a cause
|
|
27
|
+
]) {
|
|
28
|
+
defineGlobal(name, "1.0.1", "error-cause", {
|
|
29
|
+
exclude: lessThanArgs(causeArgNum),
|
|
30
|
+
subfolder: name,
|
|
31
|
+
polyfillName: "Error cause"
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
// This needs to come after the AggregateError cause polyfill, since this
|
|
35
|
+
// one polyfills less features.
|
|
36
|
+
defineGlobal("AggregateError", "1.0.2", "es-aggregate-error");
|
|
37
|
+
const DATE_VERSION = "2.0.0";
|
|
38
|
+
// MISSING DATA: defineGlobal("Date", DATE_VERSION, "date", { subfolder: "Date" });
|
|
39
|
+
defineGlobal("globalThis", "1.0.0");
|
|
40
|
+
defineGlobal("parseInt", "2.0.0");
|
|
41
|
+
defineGlobal("Map", "1.0.4", "es-map");
|
|
42
|
+
defineGlobal("Set", "1.1.0", "es-set");
|
|
43
|
+
|
|
44
|
+
// TODO: Uncomment when stage 4
|
|
45
|
+
// defineGlobal("SuppressedError", "1.0.2", "suppressed-error");
|
|
46
|
+
// const DisposableStackPackage = ["1.1.2", "disposablestack"] as const;
|
|
47
|
+
// defineGlobal("AsyncDisposableStack", ...DisposableStackPackage, {
|
|
48
|
+
// subfolder: "AsyncDisposableStack",
|
|
49
|
+
// });
|
|
50
|
+
// defineGlobal("DisposableStack", ...DisposableStackPackage, {
|
|
51
|
+
// subfolder: "DisposableStack",
|
|
52
|
+
// });
|
|
53
|
+
|
|
54
|
+
const arrayCheck = thisObj => expr`Array.isArray(${thisObj})`;
|
|
55
|
+
const typeofCheck = type => thisObj => expr`typeof ${thisObj} === "${type}"`;
|
|
56
|
+
const instanceofCheck = Class => thisObj => expr`${thisObj} instanceof ${t.identifier(Class)}`;
|
|
57
|
+
const stringCheck = typeofCheck("string");
|
|
58
|
+
// const setCheck = instanceofCheck("Set");
|
|
59
|
+
|
|
60
|
+
const getter = {
|
|
61
|
+
getter: true
|
|
62
|
+
};
|
|
63
|
+
const excludeStatic = obj => ({
|
|
64
|
+
exclude: meta => meta.kind === "property" && meta.placement === "static" && meta.object === obj
|
|
65
|
+
});
|
|
66
|
+
const excludeObject = excludeStatic("Object");
|
|
67
|
+
defineStatic("Array", "from", "1.1.0");
|
|
68
|
+
defineStatic("Array", "of", "1.0.0");
|
|
69
|
+
defineInstance("Array", "at", "1.0.0", arrayCheck);
|
|
70
|
+
defineInstance("Array", "concat", "1.0.2", arrayCheck);
|
|
71
|
+
defineInstance("Array", "copyWithin", "1.0.0", arrayCheck);
|
|
72
|
+
defineInstance("Array", "entries", "1.0.0", arrayCheck, excludeObject);
|
|
73
|
+
defineInstance("Array", "every", "1.1.0", arrayCheck);
|
|
74
|
+
defineInstance("Array", "filter", "1.0.0", arrayCheck);
|
|
75
|
+
defineInstance("Array", "find", "2.1.1", arrayCheck);
|
|
76
|
+
defineInstance("Array", "findIndex", "2.1.0", arrayCheck);
|
|
77
|
+
defineInstance("Array", "findLast", "1.0.0", arrayCheck);
|
|
78
|
+
defineInstance("Array", "findLastIndex", "1.0.0", arrayCheck);
|
|
79
|
+
defineInstance("Array", "flat", "1.2.3", arrayCheck);
|
|
80
|
+
defineInstance("Array", "flatMap", "1.2.3", arrayCheck);
|
|
81
|
+
defineInstance("Array", "includes", "3.1.1", arrayCheck, {
|
|
82
|
+
pkg: "array-includes"
|
|
83
|
+
});
|
|
84
|
+
defineInstance("Array", "indexOf", "1.0.1", arrayCheck);
|
|
85
|
+
// MISSING DATA: defineInstance("Array", "join", "1.0.0", arrayCheck);
|
|
86
|
+
defineInstance("Array", "keys", "1.0.0", arrayCheck, excludeObject);
|
|
87
|
+
defineInstance("Array", "lastIndexOf", "1.0.0", arrayCheck);
|
|
88
|
+
defineInstance("Array", "map", "1.0.2", arrayCheck);
|
|
89
|
+
defineInstance("Array", "reduce", "1.0.1", arrayCheck);
|
|
90
|
+
defineInstance("Array", "reduceRight", "1.0.1", arrayCheck);
|
|
91
|
+
// MISSING DATA: defineInstance("Array", "slice", "1.0.0", arrayCheck);
|
|
92
|
+
defineInstance("Array", "some", "1.1.1", arrayCheck);
|
|
93
|
+
defineInstance("Array", "splice", "1.0.1", arrayCheck);
|
|
94
|
+
defineInstance("Array", "toReversed", "1.0.1", arrayCheck);
|
|
95
|
+
defineInstance("Array", "toSorted", "1.0.0", arrayCheck);
|
|
96
|
+
defineInstance("Array", "toSpliced", "1.0.0", arrayCheck);
|
|
97
|
+
defineInstance("Array", "unshift", "1.0.0", arrayCheck);
|
|
98
|
+
defineInstance("Array", "values", "1.0.0", arrayCheck, excludeObject);
|
|
99
|
+
defineInstance("Array", "with", "1.0.1", arrayCheck);
|
|
100
|
+
for (const name of ["now"
|
|
101
|
+
// MISSING DATA: "parse"
|
|
102
|
+
]) {
|
|
103
|
+
defineStatic("Date", name, DATE_VERSION, {
|
|
104
|
+
pkg: "date",
|
|
105
|
+
subfolder: `Date.${name}`
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
for (const name of [
|
|
109
|
+
// MISSING DATA: "getFullYear",
|
|
110
|
+
// MISSING DATA: "getMonth",
|
|
111
|
+
// MISSING DATA: "getDate",
|
|
112
|
+
// MISSING DATA: "getUTCDate",
|
|
113
|
+
// MISSING DATA: "getUTCFullYear",
|
|
114
|
+
// MISSING DATA: "getUTCMonth",
|
|
115
|
+
// MISSING DATA: "toUTCString",
|
|
116
|
+
// MISSING DATA: "toDateString",
|
|
117
|
+
// MISSING DATA: "toString",
|
|
118
|
+
"toISOString", "toJSON"]) {
|
|
119
|
+
defineInstance("Date", name, DATE_VERSION, instanceofCheck("Date"), {
|
|
120
|
+
pkg: "date",
|
|
121
|
+
subfolder: `Date.prototype.${name}`
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
defineInstance("Function", "name", "1.1.2", typeofCheck("function"), getter);
|
|
125
|
+
defineStatic("Math", "acosh", "1.0.0");
|
|
126
|
+
defineStatic("Math", "atanh", "1.0.0");
|
|
127
|
+
defineStatic("Math", "clz32", "1.0.0");
|
|
128
|
+
defineStatic("Math", "cbrt", "1.0.0");
|
|
129
|
+
defineStatic("Math", "fround", "1.0.0");
|
|
130
|
+
defineStatic("Math", "log1p", "1.0.1");
|
|
131
|
+
defineStatic("Math", "sign", "2.0.0");
|
|
132
|
+
defineStatic("Number", "isFinite", "1.0.0");
|
|
133
|
+
defineStatic("Number", "isInteger", "1.0.0");
|
|
134
|
+
defineStatic("Number", "isSafeInteger", "1.0.0");
|
|
135
|
+
defineStatic("Number", "isNaN", "1.0.0", {
|
|
136
|
+
pkg: "number.isnan"
|
|
137
|
+
});
|
|
138
|
+
defineStatic("Number", "parseFloat", "1.0.0");
|
|
139
|
+
defineStatic("Number", "parseInt", "1.0.0");
|
|
140
|
+
defineStatic("Object", "assign", "4.1.0");
|
|
141
|
+
defineStatic("Object", "defineProperties", "1.0.0");
|
|
142
|
+
defineStatic("Object", "entries", "1.1.1");
|
|
143
|
+
defineStatic("Object", "fromEntries", "2.0.2");
|
|
144
|
+
defineStatic("Object", "hasOwn", "1.0.0");
|
|
145
|
+
defineStatic("Object", "is", "1.1.2", {
|
|
146
|
+
pkg: "object-is"
|
|
147
|
+
});
|
|
148
|
+
defineStatic("Object", "getOwnPropertyDescriptors", "2.1.0");
|
|
149
|
+
defineStatic("Object", "getPrototypeOf", "1.0.1");
|
|
150
|
+
defineStatic("Object", "values", "1.1.1");
|
|
151
|
+
defineStatic("Promise", "allSettled", "1.0.2");
|
|
152
|
+
defineStatic("Promise", "any", "2.0.1");
|
|
153
|
+
defineStatic("Promise", "try", "1.0.0");
|
|
154
|
+
defineInstance("Promise", "finally", "1.2.1", instanceofCheck("Promise"));
|
|
155
|
+
defineStatic("Reflect", "apply", "1.0.0");
|
|
156
|
+
defineStatic("Reflect", "ownKeys", "1.0.1");
|
|
157
|
+
defineStatic("Reflect", "getPrototypeOf", "1.0.0");
|
|
158
|
+
defineInstance("RegExp", "flags", "1.3.0", instanceofCheck("RegExp"), getter);
|
|
159
|
+
|
|
160
|
+
// TODO: Uncomment when Stage 4
|
|
161
|
+
// defineInstance("Set", "difference", "1.0.2", setCheck);
|
|
162
|
+
// defineInstance("Set", "intersection", "1.0.2", setCheck);
|
|
163
|
+
// defineInstance("Set", "isDisjointFrom", "1.0.2", setCheck);
|
|
164
|
+
// defineInstance("Set", "isSubsetOf", "1.0.2", setCheck);
|
|
165
|
+
// defineInstance("Set", "isSupersetOf", "1.0.2", setCheck);
|
|
166
|
+
// defineInstance("Set", "symmetricDifference", "1.0.2", setCheck);
|
|
167
|
+
// defineInstance("Set", "union", "1.0.2", setCheck);
|
|
168
|
+
|
|
169
|
+
defineStatic("String", "fromCodePoint", "1.0.0");
|
|
170
|
+
defineStatic("String", "raw", "1.0.1");
|
|
171
|
+
defineInstance("String", "codePoitAt", "1.0.0", stringCheck);
|
|
172
|
+
defineInstance("String", "endsWith", "1.0.0", stringCheck);
|
|
173
|
+
defineInstance("String", "includes", "2.0.0", stringCheck);
|
|
174
|
+
defineInstance("String", "isWellFormed", "1.0.1", stringCheck);
|
|
175
|
+
defineInstance("String", "at", "1.0.0", stringCheck);
|
|
176
|
+
defineInstance("String", "matchAll", "4.0.2", stringCheck);
|
|
177
|
+
defineInstance("String", "padEnd", "1.1.1", stringCheck);
|
|
178
|
+
defineInstance("String", "padStart", "3.1.0", stringCheck);
|
|
179
|
+
defineInstance("String", "repeat", "1.0.0", stringCheck);
|
|
180
|
+
defineInstance("String", "replaceAll", "1.0.3", stringCheck);
|
|
181
|
+
defineInstance("String", "split", "1.0.1", stringCheck, excludeStatic("Symbol"));
|
|
182
|
+
defineInstance("String", "startsWith", "1.0.0", stringCheck);
|
|
183
|
+
defineInstance("String", "substr", "1.0.0", stringCheck);
|
|
184
|
+
defineInstance("String", "toWellFormed", "1.0.1", stringCheck);
|
|
185
|
+
defineInstance("String", "trim", "1.2.1", stringCheck);
|
|
186
|
+
defineInstance("String", "trimEnd", "1.0.0", stringCheck);
|
|
187
|
+
defineInstance("String", "trimLeft", "2.1.1", stringCheck);
|
|
188
|
+
defineInstance("String", "trimRight", "2.1.1", stringCheck);
|
|
189
|
+
defineInstance("String", "trimStart", "1.0.0", stringCheck);
|
|
190
|
+
defineInstance("Symbol", "description", "1.0.2", instanceofCheck("Symbol"), getter);
|
|
191
|
+
|
|
192
|
+
// Annex B
|
|
193
|
+
for (const name of ["anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"]) {
|
|
194
|
+
defineInstance("String", name, "1.0.0", stringCheck, {
|
|
195
|
+
pkg: `es-string-html-methods`,
|
|
196
|
+
subfolder: name
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
function createDescriptor(name, version, pkg = name.toLowerCase(), subfolder) {
|
|
200
|
+
return {
|
|
201
|
+
name,
|
|
202
|
+
version,
|
|
203
|
+
package: pkg,
|
|
204
|
+
path: subfolder ? `${pkg}/${subfolder}` : pkg
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function defineGlobal(name, version, pkg, {
|
|
208
|
+
exclude,
|
|
209
|
+
subfolder,
|
|
210
|
+
polyfillName = name
|
|
211
|
+
} = {}) {
|
|
212
|
+
if (!has(Globals, name)) Globals[name] = [];
|
|
213
|
+
Globals[name].push({
|
|
214
|
+
...createDescriptor(polyfillName, version, pkg, subfolder),
|
|
215
|
+
exclude,
|
|
216
|
+
nameHint: name
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
function defineStatic(object, property, version, {
|
|
220
|
+
pkg,
|
|
221
|
+
subfolder
|
|
222
|
+
} = {}) {
|
|
223
|
+
if (!has(StaticProperties, object)) StaticProperties[object] = {};
|
|
224
|
+
StaticProperties[object][property] = [createDescriptor(`${object}.${property}`, version, pkg, subfolder)];
|
|
225
|
+
}
|
|
226
|
+
function defineInstance(object, property, version, thisCheck, {
|
|
227
|
+
getter = false,
|
|
228
|
+
exclude,
|
|
229
|
+
pkg,
|
|
230
|
+
subfolder
|
|
231
|
+
} = {}) {
|
|
232
|
+
if (!has(InstanceProperties, property)) InstanceProperties[property] = [];
|
|
233
|
+
InstanceProperties[property].push({
|
|
234
|
+
...createDescriptor(`${object}.prototype.${property}`, version, pkg, subfolder),
|
|
235
|
+
thisCheck,
|
|
236
|
+
exclude,
|
|
237
|
+
getter
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
var index = defineProvider(function ({
|
|
10
242
|
shouldInjectPolyfill,
|
|
11
243
|
assertDependency,
|
|
12
244
|
createMetaResolver,
|
|
@@ -18,9 +250,9 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
18
250
|
}) {
|
|
19
251
|
const expr = template.expression.ast;
|
|
20
252
|
const resolvePolyfill = createMetaResolver({
|
|
21
|
-
global:
|
|
22
|
-
static:
|
|
23
|
-
instance:
|
|
253
|
+
global: Globals,
|
|
254
|
+
static: StaticProperties,
|
|
255
|
+
instance: InstanceProperties
|
|
24
256
|
});
|
|
25
257
|
function createDescIterator(cb, instance) {
|
|
26
258
|
return (meta, utils, path) => {
|
|
@@ -34,7 +266,7 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
34
266
|
return;
|
|
35
267
|
}
|
|
36
268
|
for (const desc of resolved.desc) {
|
|
37
|
-
if (!
|
|
269
|
+
if (!desc.exclude?.(meta, path) && shouldInjectPolyfill(desc.name)) {
|
|
38
270
|
cb(desc, utils, path);
|
|
39
271
|
|
|
40
272
|
// Since global and static polyfills are unambiguous, we only need to
|
|
@@ -54,7 +286,7 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
54
286
|
const seen = new WeakSet();
|
|
55
287
|
return {
|
|
56
288
|
name: "es-shims",
|
|
57
|
-
polyfills
|
|
289
|
+
polyfills,
|
|
58
290
|
usageGlobal: createDescIterator((desc, utils) => {
|
|
59
291
|
if (desc.global === false) return;
|
|
60
292
|
assertDependency(desc.package, desc.version);
|
|
@@ -110,7 +342,7 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
110
342
|
const {
|
|
111
343
|
thisCheck
|
|
112
344
|
} = desc;
|
|
113
|
-
if (!thisCheck || desc.exclude
|
|
345
|
+
if (!thisCheck || desc.exclude?.(meta) || !shouldInjectPolyfill(desc.name)) {
|
|
114
346
|
continue;
|
|
115
347
|
}
|
|
116
348
|
if (!tmp) {
|
|
@@ -122,7 +354,7 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
122
354
|
}
|
|
123
355
|
const id = injectDefault(desc, utils);
|
|
124
356
|
replacement = t.conditionalExpression(thisCheck(t.cloneNode(tmp)), isGetter ? expr`${id}(${t.cloneNode(tmp)})` : isCall ? id : expr`${id}.getPolyfill()`, replacement);
|
|
125
|
-
parent = parent
|
|
357
|
+
parent = parent ?? replacement;
|
|
126
358
|
}
|
|
127
359
|
if (!parent) return;
|
|
128
360
|
replacement = expr`(${t.cloneNode(tmp)} = ${object}, ${replacement})`;
|
|
@@ -134,4 +366,7 @@ var _default = exports.default = (0, _helperDefinePolyfillProvider.default)(func
|
|
|
134
366
|
}
|
|
135
367
|
})
|
|
136
368
|
};
|
|
137
|
-
});
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
export { index as default };
|
|
372
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/mappings.ts","../src/index.ts"],"sourcesContent":["import { types as t, template } from \"@babel/core\";\nimport type { NodePath } from \"@babel/traverse\";\nimport type { MetaDescriptor } from \"@babel/helper-define-polyfill-provider\";\n\nconst expr = template.expression.ast;\n\nconst has = Function.call.bind(Object.hasOwnProperty);\n\nexport type Descriptor = {\n name: string;\n version: string;\n package: string;\n path: string; // This is different from .package for multi-entry-point packages,\n pure?: false;\n global?: false;\n thisCheck?: (thisObj: any) => any;\n exclude?: (meta: MetaDescriptor, path: NodePath) => boolean;\n getter?: true;\n};\n\nexport const Globals = {};\nexport const StaticProperties = {};\nexport const InstanceProperties = {};\n\nconst lessThanArgs = num => (meta, path: NodePath) => {\n const { node, parent } = path;\n if (!t.isNewExpression(parent, { callee: node })) return false;\n if (parent.arguments.length >= num) return false;\n return parent.arguments.every(arg => !t.isSpreadElement(arg));\n};\n\nfor (const [name, causeArgNum] of [\n [\"Error\", 2],\n [\"AggregateError\", 3],\n [\"EvalError\", 2],\n [\"RangeError\", 2],\n [\"ReferenceError\", 2],\n [\"SyntaxError\", 2],\n [\"TypeError\", 2],\n [\"URIError\", 2],\n // SuppressedError is not in this list because it does not have a cause\n] as [string, number][]) {\n defineGlobal(name, \"1.0.1\", \"error-cause\", {\n exclude: lessThanArgs(causeArgNum),\n subfolder: name,\n polyfillName: \"Error cause\",\n });\n}\n// This needs to come after the AggregateError cause polyfill, since this\n// one polyfills less features.\ndefineGlobal(\"AggregateError\", \"1.0.2\", \"es-aggregate-error\");\nconst DATE_VERSION = \"2.0.0\";\n// MISSING DATA: defineGlobal(\"Date\", DATE_VERSION, \"date\", { subfolder: \"Date\" });\ndefineGlobal(\"globalThis\", \"1.0.0\");\ndefineGlobal(\"parseInt\", \"2.0.0\");\n\ndefineGlobal(\"Map\", \"1.0.4\", \"es-map\");\ndefineGlobal(\"Set\", \"1.1.0\", \"es-set\");\n\n// TODO: Uncomment when stage 4\n// defineGlobal(\"SuppressedError\", \"1.0.2\", \"suppressed-error\");\n// const DisposableStackPackage = [\"1.1.2\", \"disposablestack\"] as const;\n// defineGlobal(\"AsyncDisposableStack\", ...DisposableStackPackage, {\n// subfolder: \"AsyncDisposableStack\",\n// });\n// defineGlobal(\"DisposableStack\", ...DisposableStackPackage, {\n// subfolder: \"DisposableStack\",\n// });\n\nconst arrayCheck = thisObj => expr`Array.isArray(${thisObj})`;\nconst typeofCheck = type => thisObj => expr`typeof ${thisObj} === \"${type}\"`;\nconst instanceofCheck = Class => thisObj =>\n expr`${thisObj} instanceof ${t.identifier(Class)}`;\nconst stringCheck = typeofCheck(\"string\");\n// const setCheck = instanceofCheck(\"Set\");\n\nconst getter = { getter: true };\nconst excludeStatic = obj => ({\n exclude: meta =>\n meta.kind === \"property\" &&\n meta.placement === \"static\" &&\n meta.object === obj,\n});\nconst excludeObject = excludeStatic(\"Object\");\n\ndefineStatic(\"Array\", \"from\", \"1.1.0\");\ndefineStatic(\"Array\", \"of\", \"1.0.0\");\ndefineInstance(\"Array\", \"at\", \"1.0.0\", arrayCheck);\ndefineInstance(\"Array\", \"concat\", \"1.0.2\", arrayCheck);\ndefineInstance(\"Array\", \"copyWithin\", \"1.0.0\", arrayCheck);\ndefineInstance(\"Array\", \"entries\", \"1.0.0\", arrayCheck, excludeObject);\ndefineInstance(\"Array\", \"every\", \"1.1.0\", arrayCheck);\ndefineInstance(\"Array\", \"filter\", \"1.0.0\", arrayCheck);\ndefineInstance(\"Array\", \"find\", \"2.1.1\", arrayCheck);\ndefineInstance(\"Array\", \"findIndex\", \"2.1.0\", arrayCheck);\ndefineInstance(\"Array\", \"findLast\", \"1.0.0\", arrayCheck);\ndefineInstance(\"Array\", \"findLastIndex\", \"1.0.0\", arrayCheck);\ndefineInstance(\"Array\", \"flat\", \"1.2.3\", arrayCheck);\ndefineInstance(\"Array\", \"flatMap\", \"1.2.3\", arrayCheck);\ndefineInstance(\"Array\", \"includes\", \"3.1.1\", arrayCheck, {\n pkg: \"array-includes\",\n});\ndefineInstance(\"Array\", \"indexOf\", \"1.0.1\", arrayCheck);\n// MISSING DATA: defineInstance(\"Array\", \"join\", \"1.0.0\", arrayCheck);\ndefineInstance(\"Array\", \"keys\", \"1.0.0\", arrayCheck, excludeObject);\ndefineInstance(\"Array\", \"lastIndexOf\", \"1.0.0\", arrayCheck);\ndefineInstance(\"Array\", \"map\", \"1.0.2\", arrayCheck);\ndefineInstance(\"Array\", \"reduce\", \"1.0.1\", arrayCheck);\ndefineInstance(\"Array\", \"reduceRight\", \"1.0.1\", arrayCheck);\n// MISSING DATA: defineInstance(\"Array\", \"slice\", \"1.0.0\", arrayCheck);\ndefineInstance(\"Array\", \"some\", \"1.1.1\", arrayCheck);\ndefineInstance(\"Array\", \"splice\", \"1.0.1\", arrayCheck);\ndefineInstance(\"Array\", \"toReversed\", \"1.0.1\", arrayCheck);\ndefineInstance(\"Array\", \"toSorted\", \"1.0.0\", arrayCheck);\ndefineInstance(\"Array\", \"toSpliced\", \"1.0.0\", arrayCheck);\ndefineInstance(\"Array\", \"unshift\", \"1.0.0\", arrayCheck);\ndefineInstance(\"Array\", \"values\", \"1.0.0\", arrayCheck, excludeObject);\ndefineInstance(\"Array\", \"with\", \"1.0.1\", arrayCheck);\n\nfor (const name of [\n \"now\",\n // MISSING DATA: \"parse\"\n]) {\n defineStatic(\"Date\", name, DATE_VERSION, {\n pkg: \"date\",\n subfolder: `Date.${name}`,\n });\n}\nfor (const name of [\n // MISSING DATA: \"getFullYear\",\n // MISSING DATA: \"getMonth\",\n // MISSING DATA: \"getDate\",\n // MISSING DATA: \"getUTCDate\",\n // MISSING DATA: \"getUTCFullYear\",\n // MISSING DATA: \"getUTCMonth\",\n // MISSING DATA: \"toUTCString\",\n // MISSING DATA: \"toDateString\",\n // MISSING DATA: \"toString\",\n \"toISOString\",\n \"toJSON\",\n]) {\n defineInstance(\"Date\", name, DATE_VERSION, instanceofCheck(\"Date\"), {\n pkg: \"date\",\n subfolder: `Date.prototype.${name}`,\n });\n}\n\ndefineInstance(\"Function\", \"name\", \"1.1.2\", typeofCheck(\"function\"), getter);\n\ndefineStatic(\"Math\", \"acosh\", \"1.0.0\");\ndefineStatic(\"Math\", \"atanh\", \"1.0.0\");\ndefineStatic(\"Math\", \"clz32\", \"1.0.0\");\ndefineStatic(\"Math\", \"cbrt\", \"1.0.0\");\ndefineStatic(\"Math\", \"fround\", \"1.0.0\");\ndefineStatic(\"Math\", \"log1p\", \"1.0.1\");\ndefineStatic(\"Math\", \"sign\", \"2.0.0\");\n\ndefineStatic(\"Number\", \"isFinite\", \"1.0.0\");\ndefineStatic(\"Number\", \"isInteger\", \"1.0.0\");\ndefineStatic(\"Number\", \"isSafeInteger\", \"1.0.0\");\ndefineStatic(\"Number\", \"isNaN\", \"1.0.0\", { pkg: \"number.isnan\" });\ndefineStatic(\"Number\", \"parseFloat\", \"1.0.0\");\ndefineStatic(\"Number\", \"parseInt\", \"1.0.0\");\n\ndefineStatic(\"Object\", \"assign\", \"4.1.0\");\ndefineStatic(\"Object\", \"defineProperties\", \"1.0.0\");\ndefineStatic(\"Object\", \"entries\", \"1.1.1\");\ndefineStatic(\"Object\", \"fromEntries\", \"2.0.2\");\ndefineStatic(\"Object\", \"hasOwn\", \"1.0.0\");\ndefineStatic(\"Object\", \"is\", \"1.1.2\", { pkg: \"object-is\" });\ndefineStatic(\"Object\", \"getOwnPropertyDescriptors\", \"2.1.0\");\ndefineStatic(\"Object\", \"getPrototypeOf\", \"1.0.1\");\ndefineStatic(\"Object\", \"values\", \"1.1.1\");\n\ndefineStatic(\"Promise\", \"allSettled\", \"1.0.2\");\ndefineStatic(\"Promise\", \"any\", \"2.0.1\");\ndefineStatic(\"Promise\", \"try\", \"1.0.0\");\ndefineInstance(\"Promise\", \"finally\", \"1.2.1\", instanceofCheck(\"Promise\"));\n\ndefineStatic(\"Reflect\", \"apply\", \"1.0.0\");\ndefineStatic(\"Reflect\", \"ownKeys\", \"1.0.1\");\ndefineStatic(\"Reflect\", \"getPrototypeOf\", \"1.0.0\");\n\ndefineInstance(\"RegExp\", \"flags\", \"1.3.0\", instanceofCheck(\"RegExp\"), getter);\n\n// TODO: Uncomment when Stage 4\n// defineInstance(\"Set\", \"difference\", \"1.0.2\", setCheck);\n// defineInstance(\"Set\", \"intersection\", \"1.0.2\", setCheck);\n// defineInstance(\"Set\", \"isDisjointFrom\", \"1.0.2\", setCheck);\n// defineInstance(\"Set\", \"isSubsetOf\", \"1.0.2\", setCheck);\n// defineInstance(\"Set\", \"isSupersetOf\", \"1.0.2\", setCheck);\n// defineInstance(\"Set\", \"symmetricDifference\", \"1.0.2\", setCheck);\n// defineInstance(\"Set\", \"union\", \"1.0.2\", setCheck);\n\ndefineStatic(\"String\", \"fromCodePoint\", \"1.0.0\");\ndefineStatic(\"String\", \"raw\", \"1.0.1\");\ndefineInstance(\"String\", \"codePoitAt\", \"1.0.0\", stringCheck);\ndefineInstance(\"String\", \"endsWith\", \"1.0.0\", stringCheck);\ndefineInstance(\"String\", \"includes\", \"2.0.0\", stringCheck);\ndefineInstance(\"String\", \"isWellFormed\", \"1.0.1\", stringCheck);\ndefineInstance(\"String\", \"at\", \"1.0.0\", stringCheck);\ndefineInstance(\"String\", \"matchAll\", \"4.0.2\", stringCheck);\ndefineInstance(\"String\", \"padEnd\", \"1.1.1\", stringCheck);\ndefineInstance(\"String\", \"padStart\", \"3.1.0\", stringCheck);\ndefineInstance(\"String\", \"repeat\", \"1.0.0\", stringCheck);\ndefineInstance(\"String\", \"replaceAll\", \"1.0.3\", stringCheck);\ndefineInstance(\n \"String\",\n \"split\",\n \"1.0.1\",\n stringCheck,\n excludeStatic(\"Symbol\"),\n);\ndefineInstance(\"String\", \"startsWith\", \"1.0.0\", stringCheck);\ndefineInstance(\"String\", \"substr\", \"1.0.0\", stringCheck);\ndefineInstance(\"String\", \"toWellFormed\", \"1.0.1\", stringCheck);\ndefineInstance(\"String\", \"trim\", \"1.2.1\", stringCheck);\ndefineInstance(\"String\", \"trimEnd\", \"1.0.0\", stringCheck);\ndefineInstance(\"String\", \"trimLeft\", \"2.1.1\", stringCheck);\ndefineInstance(\"String\", \"trimRight\", \"2.1.1\", stringCheck);\ndefineInstance(\"String\", \"trimStart\", \"1.0.0\", stringCheck);\n\ndefineInstance(\n \"Symbol\",\n \"description\",\n \"1.0.2\",\n instanceofCheck(\"Symbol\"),\n getter,\n);\n\n// Annex B\nfor (const name of [\n \"anchor\",\n \"big\",\n \"blink\",\n \"bold\",\n \"fixed\",\n \"fontcolor\",\n \"fontsize\",\n \"italics\",\n \"link\",\n \"small\",\n \"strike\",\n \"sub\",\n \"sup\",\n]) {\n defineInstance(\"String\", name, \"1.0.0\", stringCheck, {\n pkg: `es-string-html-methods`,\n subfolder: name,\n });\n}\n\nfunction createDescriptor(name, version, pkg = name.toLowerCase(), subfolder?) {\n return {\n name,\n version,\n package: pkg,\n path: subfolder ? `${pkg}/${subfolder}` : pkg,\n };\n}\n\ntype ExcludeFilter = (meta: MetaDescriptor, path: NodePath) => boolean;\n\nfunction defineGlobal(\n name,\n version,\n pkg?,\n {\n exclude,\n subfolder,\n polyfillName = name,\n }: {\n exclude?: ExcludeFilter;\n subfolder?: string;\n polyfillName?: string;\n } = {},\n) {\n if (!has(Globals, name)) Globals[name] = [];\n Globals[name].push({\n ...createDescriptor(polyfillName, version, pkg, subfolder),\n exclude,\n nameHint: name,\n });\n}\n\nfunction defineStatic(\n object,\n property,\n version,\n { pkg, subfolder }: { pkg?: string; subfolder?: string } = {},\n) {\n if (!has(StaticProperties, object)) StaticProperties[object] = {};\n\n StaticProperties[object][property] = [\n createDescriptor(`${object}.${property}`, version, pkg, subfolder),\n ];\n}\n\nfunction defineInstance(\n object,\n property,\n version,\n thisCheck,\n {\n getter = false,\n exclude,\n pkg,\n subfolder,\n }: {\n getter?: boolean;\n exclude?: ExcludeFilter;\n pkg?: string;\n subfolder?: string;\n } = {},\n) {\n if (!has(InstanceProperties, property)) InstanceProperties[property] = [];\n\n InstanceProperties[property].push({\n ...createDescriptor(\n `${object}.prototype.${property}`,\n version,\n pkg,\n subfolder,\n ),\n thisCheck,\n exclude,\n getter,\n });\n}\n","import defineProvider, {\n type Utils,\n type MetaDescriptor,\n} from \"@babel/helper-define-polyfill-provider\";\nimport type { NodePath } from \"@babel/traverse\";\n\nimport polyfills from \"../data/polyfills.json\" with { type: \"json\" };\n\nimport {\n type Descriptor,\n Globals,\n StaticProperties,\n InstanceProperties,\n} from \"./mappings\";\n\nexport default defineProvider<{}>(function ({\n shouldInjectPolyfill,\n assertDependency,\n createMetaResolver,\n debug,\n babel: { template, types: t },\n}) {\n const expr = template.expression.ast;\n\n const resolvePolyfill = createMetaResolver<Descriptor[]>({\n global: Globals,\n static: StaticProperties,\n instance: InstanceProperties,\n });\n\n function createDescIterator(\n cb: (desc: Descriptor, utils: Utils, path: NodePath) => void,\n instance?: (\n meta: MetaDescriptor,\n resolved: any,\n utils: Utils,\n path: any,\n ) => void,\n ) {\n return (meta: MetaDescriptor, utils: Utils, path: NodePath): undefined => {\n if (path.parentPath.isUnaryExpression({ operator: \"delete\" })) return;\n\n const resolved = resolvePolyfill(meta);\n if (!resolved) return;\n\n if (instance && resolved.kind === \"instance\") {\n instance(meta, resolved, utils, path);\n return;\n }\n\n for (const desc of resolved.desc) {\n if (!desc.exclude?.(meta, path) && shouldInjectPolyfill(desc.name)) {\n cb(desc, utils, path);\n\n // Since global and static polyfills are unambiguous, we only need to\n // inject the first non-excluded one.\n if (resolved.kind !== \"instance\") {\n break;\n }\n }\n }\n };\n }\n\n function injectDefault(desc, utils) {\n assertDependency(desc.package, desc.version);\n debug(desc.name);\n\n return utils.injectDefaultImport(desc.path, desc.nameHint || desc.name);\n }\n\n const seen = new WeakSet();\n\n return {\n name: \"es-shims\",\n polyfills,\n\n usageGlobal: createDescIterator((desc, utils) => {\n if (desc.global === false) return;\n\n assertDependency(desc.package, desc.version);\n\n utils.injectGlobalImport(`${desc.path}/auto`);\n\n debug(desc.name);\n }),\n\n usagePure: createDescIterator(\n (desc, utils, path) => {\n path.replaceWith(injectDefault(desc, utils));\n },\n (meta, resolved, utils, path) => {\n if (meta.kind !== \"property\") return;\n if (path.parentPath.isAssignmentExpression({ left: path.node })) return;\n\n if (seen.has(path.node)) return;\n seen.add(path.node);\n\n const isCall = path.parentPath.isCallExpression({ callee: path.node });\n const isGetter = resolved.desc[0].getter;\n\n const matchesPolyfill = ({ name }) =>\n name.startsWith(meta.object as any as string);\n\n let index = -1;\n if (\n // This is the actual method for sure.\n meta.kind === \"property\" &&\n meta.placement === \"prototype\" &&\n meta.object != null &&\n (index = resolved.desc.findIndex(matchesPolyfill)) !== -1\n ) {\n const desc = resolved.desc[index];\n if (!shouldInjectPolyfill(desc.name)) return;\n\n const id = injectDefault(desc, utils);\n\n if (isGetter) {\n path.replaceWith(expr`${id}(${path.node.object})`);\n } else if (isCall) {\n path.parentPath.unshiftContainer(\"arguments\", path.node.object);\n path.replaceWith(id);\n } else if (\n path.parentPath.isMemberExpression({\n object: path.node,\n computed: false,\n }) &&\n path.parent.property.name === \"call\" &&\n path.parentPath.parentPath.isCallExpression({ callee: path.parent })\n ) {\n path.parentPath.replaceWith(id);\n } else {\n path.replaceWith(expr`${id}.getPolyfill()`);\n }\n } else {\n let tmp;\n let parent;\n let replacement = path.node;\n const { object } = path.node;\n\n for (const desc of resolved.desc) {\n const { thisCheck } = desc;\n if (\n !thisCheck ||\n desc.exclude?.(meta) ||\n !shouldInjectPolyfill(desc.name)\n ) {\n continue;\n }\n\n if (!tmp) {\n tmp = path.scope.generateUidIdentifierBasedOnNode(object);\n path.scope.push({ id: t.cloneNode(tmp) });\n path.get(\"object\").replaceWith(tmp);\n }\n\n const id = injectDefault(desc, utils);\n\n replacement = t.conditionalExpression(\n thisCheck(t.cloneNode(tmp)),\n isGetter\n ? expr`${id}(${t.cloneNode(tmp)})`\n : isCall\n ? id\n : expr`${id}.getPolyfill()`,\n replacement,\n );\n\n parent = parent ?? replacement;\n }\n\n if (!parent) return;\n\n replacement = expr`(${t.cloneNode(tmp)} = ${object}, ${replacement})`;\n\n if (!isGetter && isCall) {\n parent.alternate = expr`Function.call.bind(${parent.alternate})`;\n path.parentPath.unshiftContainer(\"arguments\", t.cloneNode(tmp));\n }\n\n path.replaceWith(replacement);\n }\n },\n ),\n };\n});\n"],"names":["types","t","template","_babelCore","default","__esModule","expr","expression","ast","has","Function","call","bind","Object","hasOwnProperty","Globals","StaticProperties","InstanceProperties","lessThanArgs","num","meta","path","node","parent","isNewExpression","callee","arguments","length","every","arg","isSpreadElement","name","causeArgNum","defineGlobal","exclude","subfolder","polyfillName","DATE_VERSION","arrayCheck","thisObj","typeofCheck","type","instanceofCheck","Class","identifier","stringCheck","getter","excludeStatic","obj","kind","placement","object","excludeObject","defineStatic","defineInstance","pkg","createDescriptor","version","toLowerCase","package","push","nameHint","property","thisCheck","defineProvider","shouldInjectPolyfill","assertDependency","createMetaResolver","debug","babel","resolvePolyfill","global","static","instance","createDescIterator","cb","utils","parentPath","isUnaryExpression","operator","resolved","desc","injectDefault","injectDefaultImport","seen","WeakSet","polyfills","usageGlobal","injectGlobalImport","usagePure","replaceWith","isAssignmentExpression","left","add","isCall","isCallExpression","isGetter","matchesPolyfill","startsWith","index","findIndex","id","unshiftContainer","isMemberExpression","computed","tmp","replacement","scope","generateUidIdentifierBasedOnNode","cloneNode","get","conditionalExpression","alternate"],"mappings":";;;;;AAASA,EAAAA,KAAK,EAAIC,CAAC;AAAEC,EAAAA,QAAQ,EAARA;AAAQ,CAAA,GAAAC,UAAA,CAAAC,OAAA,IAAAD,UAAA,CAAAC,OAAA,CAAAC,UAAA,GAAAF,UAAA,CAAAC,OAAA,GAAAD,UAAA;AAI7B,MAAMG,IAAI,GAAGJ,QAAQ,CAACK,UAAU,CAACC,GAAG;AAEpC,MAAMC,GAAG,GAAGC,QAAQ,CAACC,IAAI,CAACC,IAAI,CAACC,MAAM,CAACC,cAAc,CAAC;AAc9C,MAAMC,OAAO,GAAG,EAAE;AAClB,MAAMC,gBAAgB,GAAG,EAAE;AAC3B,MAAMC,kBAAkB,GAAG,EAAE;AAEpC,MAAMC,YAAY,GAAGC,GAAG,IAAI,CAACC,IAAI,EAAEC,IAAc,KAAK;EACpD,MAAM;IAAEC,IAAI;AAAEC,IAAAA;AAAO,GAAC,GAAGF,IAAI;AAC7B,EAAA,IAAI,CAACpB,CAAC,CAACuB,eAAe,CAACD,MAAM,EAAE;AAAEE,IAAAA,MAAM,EAAEH;GAAM,CAAC,EAAE,OAAO,KAAK;EAC9D,IAAIC,MAAM,CAACG,SAAS,CAACC,MAAM,IAAIR,GAAG,EAAE,OAAO,KAAK;AAChD,EAAA,OAAOI,MAAM,CAACG,SAAS,CAACE,KAAK,CAACC,GAAG,IAAI,CAAC5B,CAAC,CAAC6B,eAAe,CA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,IAAI,sBAAsBiB,MAAM,CAACyF,SAAS,CAAA,CAAA,CAAG;AAChE3F,UAAAA,IAAI,CAACwD,UAAU,CAACyB,gBAAgB,CAAC,WAAW,EAAErG,CAAC,CAAC4G,SAAS,CAACJ,GAAG,CAAC,CAAC;AACjE,QAAA;AAEApF,QAAAA,IAAI,CAACqE,WAAW,CAACgB,WAAW,CAAC;AAC/B,MAAA;IACF,CACF;GACD;AACH,CAAC,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babel-plugin-polyfill-es-shims",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-rc.2",
|
|
4
4
|
"description": "A Babel plugin to inject imports to es-shims polyfills",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,31 +11,28 @@
|
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
14
|
-
"
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
16
|
+
},
|
|
17
|
+
"type": "module",
|
|
15
18
|
"exports": {
|
|
16
|
-
".":
|
|
17
|
-
{
|
|
18
|
-
"import": "./esm/index.mjs",
|
|
19
|
-
"default": "./lib/index.js"
|
|
20
|
-
},
|
|
21
|
-
"./lib/index.js"
|
|
22
|
-
],
|
|
19
|
+
".": "./lib/index.js",
|
|
23
20
|
"./package.json": "./package.json"
|
|
24
21
|
},
|
|
25
22
|
"keywords": [
|
|
26
23
|
"babel-plugin"
|
|
27
24
|
],
|
|
28
25
|
"dependencies": {
|
|
29
|
-
"@babel/helper-define-polyfill-provider": "^0.
|
|
26
|
+
"@babel/helper-define-polyfill-provider": "^1.0.0-rc.2"
|
|
30
27
|
},
|
|
31
28
|
"devDependencies": {
|
|
32
|
-
"@babel/core": "^
|
|
33
|
-
"@babel/helper-plugin-test-runner": "^
|
|
29
|
+
"@babel/core": "^8.0.0-rc.3 <8.0.0",
|
|
30
|
+
"@babel/helper-plugin-test-runner": "^8.0.0-rc.3 <8.0.0",
|
|
34
31
|
"array.from": "^1.1.6",
|
|
35
32
|
"math.clz32": "^1.0.3"
|
|
36
33
|
},
|
|
37
34
|
"peerDependencies": {
|
|
38
|
-
"@babel/core": "^7.4.0 || ^8.0.0-
|
|
35
|
+
"@babel/core": "^7.4.0 || ^8.0.0-rc.3"
|
|
39
36
|
},
|
|
40
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "07135f7cc464ea3e87bdf51baf00704a2aa20aef"
|
|
41
38
|
}
|
package/data/polyfills.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require("./polyfills.json");
|
package/lib/mappings.js
DELETED
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.StaticProperties = exports.InstanceProperties = exports.Globals = void 0;
|
|
5
|
-
var _babel = _interopRequireWildcard(require("@babel/core"));
|
|
6
|
-
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); }
|
|
7
|
-
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); }
|
|
8
|
-
const {
|
|
9
|
-
types: t,
|
|
10
|
-
template: template
|
|
11
|
-
} = _babel.default || _babel;
|
|
12
|
-
const expr = template.expression.ast;
|
|
13
|
-
const has = Function.call.bind(Object.hasOwnProperty);
|
|
14
|
-
const Globals = exports.Globals = {};
|
|
15
|
-
const StaticProperties = exports.StaticProperties = {};
|
|
16
|
-
const InstanceProperties = exports.InstanceProperties = {};
|
|
17
|
-
const lessThanArgs = num => (meta, path) => {
|
|
18
|
-
const {
|
|
19
|
-
node,
|
|
20
|
-
parent
|
|
21
|
-
} = path;
|
|
22
|
-
if (!t.isNewExpression(parent, {
|
|
23
|
-
callee: node
|
|
24
|
-
})) return false;
|
|
25
|
-
if (parent.arguments.length >= num) return false;
|
|
26
|
-
return parent.arguments.every(arg => !t.isSpreadElement(arg));
|
|
27
|
-
};
|
|
28
|
-
for (const [name, causeArgNum] of [["Error", 2], ["AggregateError", 3], ["EvalError", 2], ["RangeError", 2], ["ReferenceError", 2], ["SyntaxError", 2], ["TypeError", 2], ["URIError", 2]
|
|
29
|
-
// SuppressedError is not in this list because it does not have a cause
|
|
30
|
-
]) {
|
|
31
|
-
defineGlobal(name, "1.0.1", "error-cause", {
|
|
32
|
-
exclude: lessThanArgs(causeArgNum),
|
|
33
|
-
subfolder: name,
|
|
34
|
-
polyfillName: "Error cause"
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
// This needs to come after the AggregateError cause polyfill, since this
|
|
38
|
-
// one polyfills less features.
|
|
39
|
-
defineGlobal("AggregateError", "1.0.2", "es-aggregate-error");
|
|
40
|
-
const DATE_VERSION = "2.0.0";
|
|
41
|
-
// MISSING DATA: defineGlobal("Date", DATE_VERSION, "date", { subfolder: "Date" });
|
|
42
|
-
defineGlobal("globalThis", "1.0.0");
|
|
43
|
-
defineGlobal("parseInt", "2.0.0");
|
|
44
|
-
defineGlobal("Map", "1.0.4", "es-map");
|
|
45
|
-
defineGlobal("Set", "1.1.0", "es-set");
|
|
46
|
-
|
|
47
|
-
// TODO: Uncomment when stage 4
|
|
48
|
-
// defineGlobal("SuppressedError", "1.0.2", "suppressed-error");
|
|
49
|
-
// const DisposableStackPackage = ["1.1.2", "disposablestack"] as const;
|
|
50
|
-
// defineGlobal("AsyncDisposableStack", ...DisposableStackPackage, {
|
|
51
|
-
// subfolder: "AsyncDisposableStack",
|
|
52
|
-
// });
|
|
53
|
-
// defineGlobal("DisposableStack", ...DisposableStackPackage, {
|
|
54
|
-
// subfolder: "DisposableStack",
|
|
55
|
-
// });
|
|
56
|
-
|
|
57
|
-
const arrayCheck = thisObj => expr`Array.isArray(${thisObj})`;
|
|
58
|
-
const typeofCheck = type => thisObj => expr`typeof ${thisObj} === "${type}"`;
|
|
59
|
-
const instanceofCheck = Class => thisObj => expr`${thisObj} instanceof ${t.identifier(Class)}`;
|
|
60
|
-
const stringCheck = typeofCheck("string");
|
|
61
|
-
// const setCheck = instanceofCheck("Set");
|
|
62
|
-
|
|
63
|
-
const getter = {
|
|
64
|
-
getter: true
|
|
65
|
-
};
|
|
66
|
-
const excludeStatic = obj => ({
|
|
67
|
-
exclude: meta => meta.kind === "property" && meta.placement === "static" && meta.object === obj
|
|
68
|
-
});
|
|
69
|
-
const excludeObject = excludeStatic("Object");
|
|
70
|
-
defineStatic("Array", "from", "1.1.0");
|
|
71
|
-
defineStatic("Array", "of", "1.0.0");
|
|
72
|
-
defineInstance("Array", "at", "1.0.0", arrayCheck);
|
|
73
|
-
defineInstance("Array", "concat", "1.0.2", arrayCheck);
|
|
74
|
-
defineInstance("Array", "copyWithin", "1.0.0", arrayCheck);
|
|
75
|
-
defineInstance("Array", "entries", "1.0.0", arrayCheck, excludeObject);
|
|
76
|
-
defineInstance("Array", "every", "1.1.0", arrayCheck);
|
|
77
|
-
defineInstance("Array", "filter", "1.0.0", arrayCheck);
|
|
78
|
-
defineInstance("Array", "find", "2.1.1", arrayCheck);
|
|
79
|
-
defineInstance("Array", "findIndex", "2.1.0", arrayCheck);
|
|
80
|
-
defineInstance("Array", "findLast", "1.0.0", arrayCheck);
|
|
81
|
-
defineInstance("Array", "findLastIndex", "1.0.0", arrayCheck);
|
|
82
|
-
defineInstance("Array", "flat", "1.2.3", arrayCheck);
|
|
83
|
-
defineInstance("Array", "flatMap", "1.2.3", arrayCheck);
|
|
84
|
-
defineInstance("Array", "includes", "3.1.1", arrayCheck, {
|
|
85
|
-
pkg: "array-includes"
|
|
86
|
-
});
|
|
87
|
-
defineInstance("Array", "indexOf", "1.0.1", arrayCheck);
|
|
88
|
-
// MISSING DATA: defineInstance("Array", "join", "1.0.0", arrayCheck);
|
|
89
|
-
defineInstance("Array", "keys", "1.0.0", arrayCheck, excludeObject);
|
|
90
|
-
defineInstance("Array", "lastIndexOf", "1.0.0", arrayCheck);
|
|
91
|
-
defineInstance("Array", "map", "1.0.2", arrayCheck);
|
|
92
|
-
defineInstance("Array", "reduce", "1.0.1", arrayCheck);
|
|
93
|
-
defineInstance("Array", "reduceRight", "1.0.1", arrayCheck);
|
|
94
|
-
// MISSING DATA: defineInstance("Array", "slice", "1.0.0", arrayCheck);
|
|
95
|
-
defineInstance("Array", "some", "1.1.1", arrayCheck);
|
|
96
|
-
defineInstance("Array", "splice", "1.0.1", arrayCheck);
|
|
97
|
-
defineInstance("Array", "toReversed", "1.0.1", arrayCheck);
|
|
98
|
-
defineInstance("Array", "toSorted", "1.0.0", arrayCheck);
|
|
99
|
-
defineInstance("Array", "toSpliced", "1.0.0", arrayCheck);
|
|
100
|
-
defineInstance("Array", "unshift", "1.0.0", arrayCheck);
|
|
101
|
-
defineInstance("Array", "values", "1.0.0", arrayCheck, excludeObject);
|
|
102
|
-
defineInstance("Array", "with", "1.0.1", arrayCheck);
|
|
103
|
-
for (const name of ["now"
|
|
104
|
-
// MISSING DATA: "parse"
|
|
105
|
-
]) {
|
|
106
|
-
defineStatic("Date", name, DATE_VERSION, {
|
|
107
|
-
pkg: "date",
|
|
108
|
-
subfolder: `Date.${name}`
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
for (const name of [
|
|
112
|
-
// MISSING DATA: "getFullYear",
|
|
113
|
-
// MISSING DATA: "getMonth",
|
|
114
|
-
// MISSING DATA: "getDate",
|
|
115
|
-
// MISSING DATA: "getUTCDate",
|
|
116
|
-
// MISSING DATA: "getUTCFullYear",
|
|
117
|
-
// MISSING DATA: "getUTCMonth",
|
|
118
|
-
// MISSING DATA: "toUTCString",
|
|
119
|
-
// MISSING DATA: "toDateString",
|
|
120
|
-
// MISSING DATA: "toString",
|
|
121
|
-
"toISOString", "toJSON"]) {
|
|
122
|
-
defineInstance("Date", name, DATE_VERSION, instanceofCheck("Date"), {
|
|
123
|
-
pkg: "date",
|
|
124
|
-
subfolder: `Date.prototype.${name}`
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
defineInstance("Function", "name", "1.1.2", typeofCheck("function"), getter);
|
|
128
|
-
defineStatic("Math", "acosh", "1.0.0");
|
|
129
|
-
defineStatic("Math", "atanh", "1.0.0");
|
|
130
|
-
defineStatic("Math", "clz32", "1.0.0");
|
|
131
|
-
defineStatic("Math", "cbrt", "1.0.0");
|
|
132
|
-
defineStatic("Math", "fround", "1.0.0");
|
|
133
|
-
defineStatic("Math", "log1p", "1.0.1");
|
|
134
|
-
defineStatic("Math", "sign", "2.0.0");
|
|
135
|
-
defineStatic("Number", "isFinite", "1.0.0");
|
|
136
|
-
defineStatic("Number", "isInteger", "1.0.0");
|
|
137
|
-
defineStatic("Number", "isSafeInteger", "1.0.0");
|
|
138
|
-
defineStatic("Number", "isNaN", "1.0.0", {
|
|
139
|
-
pkg: "number.isnan"
|
|
140
|
-
});
|
|
141
|
-
defineStatic("Number", "parseFloat", "1.0.0");
|
|
142
|
-
defineStatic("Number", "parseInt", "1.0.0");
|
|
143
|
-
defineStatic("Object", "assign", "4.1.0");
|
|
144
|
-
defineStatic("Object", "defineProperties", "1.0.0");
|
|
145
|
-
defineStatic("Object", "entries", "1.1.1");
|
|
146
|
-
defineStatic("Object", "fromEntries", "2.0.2");
|
|
147
|
-
defineStatic("Object", "hasOwn", "1.0.0");
|
|
148
|
-
defineStatic("Object", "is", "1.1.2", {
|
|
149
|
-
pkg: "object-is"
|
|
150
|
-
});
|
|
151
|
-
defineStatic("Object", "getOwnPropertyDescriptors", "2.1.0");
|
|
152
|
-
defineStatic("Object", "getPrototypeOf", "1.0.1");
|
|
153
|
-
defineStatic("Object", "values", "1.1.1");
|
|
154
|
-
defineStatic("Promise", "allSettled", "1.0.2");
|
|
155
|
-
defineStatic("Promise", "any", "2.0.1");
|
|
156
|
-
defineStatic("Promise", "try", "1.0.0");
|
|
157
|
-
defineInstance("Promise", "finally", "1.2.1", instanceofCheck("Promise"));
|
|
158
|
-
defineStatic("Reflect", "apply", "1.0.0");
|
|
159
|
-
defineStatic("Reflect", "ownKeys", "1.0.1");
|
|
160
|
-
defineStatic("Reflect", "getPrototypeOf", "1.0.0");
|
|
161
|
-
defineInstance("RegExp", "flags", "1.3.0", instanceofCheck("RegExp"), getter);
|
|
162
|
-
|
|
163
|
-
// TODO: Uncomment when Stage 4
|
|
164
|
-
// defineInstance("Set", "difference", "1.0.2", setCheck);
|
|
165
|
-
// defineInstance("Set", "intersection", "1.0.2", setCheck);
|
|
166
|
-
// defineInstance("Set", "isDisjointFrom", "1.0.2", setCheck);
|
|
167
|
-
// defineInstance("Set", "isSubsetOf", "1.0.2", setCheck);
|
|
168
|
-
// defineInstance("Set", "isSupersetOf", "1.0.2", setCheck);
|
|
169
|
-
// defineInstance("Set", "symmetricDifference", "1.0.2", setCheck);
|
|
170
|
-
// defineInstance("Set", "union", "1.0.2", setCheck);
|
|
171
|
-
|
|
172
|
-
defineStatic("String", "fromCodePoint", "1.0.0");
|
|
173
|
-
defineStatic("String", "raw", "1.0.1");
|
|
174
|
-
defineInstance("String", "codePoitAt", "1.0.0", stringCheck);
|
|
175
|
-
defineInstance("String", "endsWith", "1.0.0", stringCheck);
|
|
176
|
-
defineInstance("String", "includes", "2.0.0", stringCheck);
|
|
177
|
-
defineInstance("String", "isWellFormed", "1.0.1", stringCheck);
|
|
178
|
-
defineInstance("String", "at", "1.0.0", stringCheck);
|
|
179
|
-
defineInstance("String", "matchAll", "4.0.2", stringCheck);
|
|
180
|
-
defineInstance("String", "padEnd", "1.1.1", stringCheck);
|
|
181
|
-
defineInstance("String", "padStart", "3.1.0", stringCheck);
|
|
182
|
-
defineInstance("String", "repeat", "1.0.0", stringCheck);
|
|
183
|
-
defineInstance("String", "replaceAll", "1.0.3", stringCheck);
|
|
184
|
-
defineInstance("String", "split", "1.0.1", stringCheck, excludeStatic("Symbol"));
|
|
185
|
-
defineInstance("String", "startsWith", "1.0.0", stringCheck);
|
|
186
|
-
defineInstance("String", "substr", "1.0.0", stringCheck);
|
|
187
|
-
defineInstance("String", "toWellFormed", "1.0.1", stringCheck);
|
|
188
|
-
defineInstance("String", "trim", "1.2.1", stringCheck);
|
|
189
|
-
defineInstance("String", "trimEnd", "1.0.0", stringCheck);
|
|
190
|
-
defineInstance("String", "trimLeft", "2.1.1", stringCheck);
|
|
191
|
-
defineInstance("String", "trimRight", "2.1.1", stringCheck);
|
|
192
|
-
defineInstance("String", "trimStart", "1.0.0", stringCheck);
|
|
193
|
-
defineInstance("Symbol", "description", "1.0.2", instanceofCheck("Symbol"), getter);
|
|
194
|
-
|
|
195
|
-
// Annex B
|
|
196
|
-
for (const name of ["anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"]) {
|
|
197
|
-
defineInstance("String", name, "1.0.0", stringCheck, {
|
|
198
|
-
pkg: `es-string-html-methods`,
|
|
199
|
-
subfolder: name
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
function createDescriptor(name, version, pkg = name.toLowerCase(), subfolder) {
|
|
203
|
-
return {
|
|
204
|
-
name,
|
|
205
|
-
version,
|
|
206
|
-
package: pkg,
|
|
207
|
-
path: subfolder ? `${pkg}/${subfolder}` : pkg
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
function defineGlobal(name, version, pkg, {
|
|
211
|
-
exclude,
|
|
212
|
-
subfolder,
|
|
213
|
-
polyfillName = name
|
|
214
|
-
} = {}) {
|
|
215
|
-
if (!has(Globals, name)) Globals[name] = [];
|
|
216
|
-
Globals[name].push(_extends({}, createDescriptor(polyfillName, version, pkg, subfolder), {
|
|
217
|
-
exclude,
|
|
218
|
-
nameHint: name
|
|
219
|
-
}));
|
|
220
|
-
}
|
|
221
|
-
function defineStatic(object, property, version, {
|
|
222
|
-
pkg,
|
|
223
|
-
subfolder
|
|
224
|
-
} = {}) {
|
|
225
|
-
if (!has(StaticProperties, object)) StaticProperties[object] = {};
|
|
226
|
-
StaticProperties[object][property] = [createDescriptor(`${object}.${property}`, version, pkg, subfolder)];
|
|
227
|
-
}
|
|
228
|
-
function defineInstance(object, property, version, thisCheck, {
|
|
229
|
-
getter = false,
|
|
230
|
-
exclude,
|
|
231
|
-
pkg,
|
|
232
|
-
subfolder
|
|
233
|
-
} = {}) {
|
|
234
|
-
if (!has(InstanceProperties, property)) InstanceProperties[property] = [];
|
|
235
|
-
InstanceProperties[property].push(_extends({}, createDescriptor(`${object}.prototype.${property}`, version, pkg, subfolder), {
|
|
236
|
-
thisCheck,
|
|
237
|
-
exclude,
|
|
238
|
-
getter
|
|
239
|
-
}));
|
|
240
|
-
}
|