@tlockney/cdp-kernel 0.8.0 → 0.10.0
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/README.md +4 -2
- package/dist/browser/kernel.js +592 -426
- package/dist/browser/kernel.js.map +3 -3
- package/dist/browser/target.d.ts +7 -0
- package/dist/browser/target.js +2 -1
- package/dist/browser/worker.js +224 -6
- package/dist/browser/worker.js.map +4 -4
- package/dist/celld-target.d.ts +2 -1
- package/dist/celld-target.js +5 -3
- package/dist/globals.d.ts +35 -4
- package/dist/kernel-core.js +11 -0
- package/dist/package.d.ts +3 -3
- package/dist/package.js +3 -2
- package/dist/transform.d.ts +10 -1
- package/dist/transform.js +20 -2
- package/dist/workerd-target.js +6 -2
- package/dist/workers-project.js +1 -1
- package/package.json +3 -3
- package/runtime/bootstrap.mjs +2 -0
- package/runtime/browser-worker.mjs +5 -1
- package/runtime/comm.d.mts +87 -1
- package/runtime/display.d.mts +315 -6
- package/runtime/display.mjs +63 -0
- package/runtime/host.d.mts +246 -0
- package/runtime/host.mjs +215 -0
- package/runtime/widget.d.mts +205 -6
- package/runtime/workerd-worker.mjs +5 -1
package/dist/browser/kernel.js
CHANGED
|
@@ -4,11 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __esm = (fn, res) => function __init() {
|
|
8
|
-
|
|
7
|
+
var __esm = (fn, res, err) => function __init() {
|
|
8
|
+
if (err) throw err[0];
|
|
9
|
+
try {
|
|
10
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
|
+
} catch (e) {
|
|
12
|
+
throw err = [e], e;
|
|
13
|
+
}
|
|
9
14
|
};
|
|
10
15
|
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
-
|
|
16
|
+
try {
|
|
17
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
|
+
} catch (e) {
|
|
19
|
+
throw mod = 0, e;
|
|
20
|
+
}
|
|
12
21
|
};
|
|
13
22
|
var __export = (target, all) => {
|
|
14
23
|
for (var name in all)
|
|
@@ -34,12 +43,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
34
43
|
// node_modules/acorn/dist/acorn.mjs
|
|
35
44
|
function isInAstralSet(code, set) {
|
|
36
45
|
var pos = 65536;
|
|
37
|
-
for (var
|
|
38
|
-
pos += set[
|
|
46
|
+
for (var i2 = 0; i2 < set.length; i2 += 2) {
|
|
47
|
+
pos += set[i2];
|
|
39
48
|
if (pos > code) {
|
|
40
49
|
return false;
|
|
41
50
|
}
|
|
42
|
-
pos += set[
|
|
51
|
+
pos += set[i2 + 1];
|
|
43
52
|
if (pos >= code) {
|
|
44
53
|
return true;
|
|
45
54
|
}
|
|
@@ -107,10 +116,10 @@ function isNewLine(code) {
|
|
|
107
116
|
}
|
|
108
117
|
function nextLineBreak(code, from, end) {
|
|
109
118
|
if (end === void 0) end = code.length;
|
|
110
|
-
for (var
|
|
111
|
-
var next2 = code.charCodeAt(
|
|
119
|
+
for (var i2 = from; i2 < end; i2++) {
|
|
120
|
+
var next2 = code.charCodeAt(i2);
|
|
112
121
|
if (isNewLine(next2)) {
|
|
113
|
-
return
|
|
122
|
+
return i2 < end - 1 && next2 === 13 && code.charCodeAt(i2 + 1) === 10 ? i2 + 2 : i2 + 1;
|
|
114
123
|
}
|
|
115
124
|
}
|
|
116
125
|
return -1;
|
|
@@ -166,6 +175,9 @@ function getOptions(opts) {
|
|
|
166
175
|
if (isArray(options.onComment)) {
|
|
167
176
|
options.onComment = pushComment(options, options.onComment);
|
|
168
177
|
}
|
|
178
|
+
if (options.sourceType === "commonjs" && options.allowAwaitOutsideFunction) {
|
|
179
|
+
throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");
|
|
180
|
+
}
|
|
169
181
|
return options;
|
|
170
182
|
}
|
|
171
183
|
function pushComment(options, array2) {
|
|
@@ -188,6 +200,17 @@ function pushComment(options, array2) {
|
|
|
188
200
|
function functionFlags(async, generator) {
|
|
189
201
|
return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0);
|
|
190
202
|
}
|
|
203
|
+
function keywordOpAt(parser, pos) {
|
|
204
|
+
var end = pos + 1, stop = Math.min(parser.input.length, pos + 11);
|
|
205
|
+
while (end < stop) {
|
|
206
|
+
var ch = parser.fullCharCodeAt(end);
|
|
207
|
+
if (!isIdentifierChar(ch, true)) {
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
end += ch <= 65535 ? 1 : 2;
|
|
211
|
+
}
|
|
212
|
+
return end === pos + 2 && parser.input.slice(pos, end) === "in" || end === pos + 10 && parser.input.slice(pos, end) === "instanceof";
|
|
213
|
+
}
|
|
191
214
|
function isPrivateNameConflicted(privateNameMap, element) {
|
|
192
215
|
var name = element.key.name;
|
|
193
216
|
var curr = privateNameMap[name];
|
|
@@ -227,13 +250,13 @@ function finishNodeAt(node, type, pos, loc) {
|
|
|
227
250
|
}
|
|
228
251
|
return node;
|
|
229
252
|
}
|
|
230
|
-
function buildUnicodeData(
|
|
231
|
-
var d = data[
|
|
232
|
-
binary: wordsRegexp(unicodeBinaryProperties[
|
|
233
|
-
binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[
|
|
253
|
+
function buildUnicodeData(ecmaVersion2) {
|
|
254
|
+
var d = data[ecmaVersion2] = {
|
|
255
|
+
binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion2] + " " + unicodeGeneralCategoryValues),
|
|
256
|
+
binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion2]),
|
|
234
257
|
nonBinary: {
|
|
235
258
|
General_Category: wordsRegexp(unicodeGeneralCategoryValues),
|
|
236
|
-
Script: wordsRegexp(unicodeScriptValues[
|
|
259
|
+
Script: wordsRegexp(unicodeScriptValues[ecmaVersion2])
|
|
237
260
|
}
|
|
238
261
|
};
|
|
239
262
|
d.nonBinary.Script_Extensions = d.nonBinary.Script;
|
|
@@ -316,13 +339,13 @@ function stringToBigInt(str) {
|
|
|
316
339
|
function parse3(input2, options) {
|
|
317
340
|
return Parser.parse(input2, options);
|
|
318
341
|
}
|
|
319
|
-
var astralIdentifierCodes, astralIdentifierStartCodes, nonASCIIidentifierChars, nonASCIIidentifierStartChars, reservedWords, ecma5AndLessKeywords, keywords$1, keywordRelationalOperator, nonASCIIidentifierStart, nonASCIIidentifier, TokenType, beforeExpr, startsExpr, keywords, types$1, lineBreak, lineBreakG, nonASCIIwhitespace, skipWhiteSpace, ref, hasOwnProperty, toString, hasOwn, isArray, regexpCache, loneSurrogate, Position, SourceLocation, defaultOptions, warnedAboutEcmaVersion, SCOPE_TOP, SCOPE_FUNCTION, SCOPE_ASYNC, SCOPE_GENERATOR, SCOPE_ARROW, SCOPE_SIMPLE_CATCH, SCOPE_SUPER, SCOPE_DIRECT_SUPER, SCOPE_CLASS_STATIC_BLOCK, SCOPE_CLASS_FIELD_INIT, SCOPE_VAR, BIND_NONE, BIND_VAR, BIND_LEXICAL, BIND_FUNCTION, BIND_SIMPLE_CATCH, BIND_OUTSIDE, Parser, prototypeAccessors, pp$9, literal, DestructuringErrors, pp$8, loopLabel, switchLabel, empty$1, FUNC_STATEMENT, FUNC_HANGING_STATEMENT, FUNC_NULLABLE_ID, pp$7, TokContext, types, pp$6, pp$5, empty, pp$4, pp$3, Scope, Node, pp$2, scriptValuesAddedInUnicode, ecma9BinaryProperties, ecma10BinaryProperties, ecma11BinaryProperties, ecma12BinaryProperties, ecma13BinaryProperties, ecma14BinaryProperties, unicodeBinaryProperties, ecma14BinaryPropertiesOfStrings, unicodeBinaryPropertiesOfStrings, unicodeGeneralCategoryValues, ecma9ScriptValues, ecma10ScriptValues, ecma11ScriptValues, ecma12ScriptValues, ecma13ScriptValues, ecma14ScriptValues, unicodeScriptValues, data, ecmaVersion, i, list, pp$1, BranchID, RegExpValidationState, CharSetNone, CharSetOk, CharSetString, Token, pp, INVALID_TEMPLATE_ESCAPE_ERROR, version;
|
|
342
|
+
var astralIdentifierCodes, astralIdentifierStartCodes, nonASCIIidentifierChars, nonASCIIidentifierStartChars, reservedWords, ecma5AndLessKeywords, keywords$1, keywordRelationalOperator, nonASCIIidentifierStart, nonASCIIidentifier, TokenType, beforeExpr, startsExpr, keywords, types$1, lineBreak, lineBreakG, nonASCIIwhitespace, skipWhiteSpace, ref, hasOwnProperty, toString, hasOwn, isArray, regexpCache, loneSurrogate, Position, SourceLocation, defaultOptions, warnedAboutEcmaVersion, SCOPE_TOP, SCOPE_FUNCTION, SCOPE_ASYNC, SCOPE_GENERATOR, SCOPE_ARROW, SCOPE_SIMPLE_CATCH, SCOPE_SUPER, SCOPE_DIRECT_SUPER, SCOPE_CLASS_STATIC_BLOCK, SCOPE_CLASS_FIELD_INIT, SCOPE_SWITCH, SCOPE_VAR, BIND_NONE, BIND_VAR, BIND_LEXICAL, BIND_FUNCTION, BIND_SIMPLE_CATCH, BIND_OUTSIDE, Parser, prototypeAccessors, pp$9, literal, DestructuringErrors, pp$8, loopLabel, switchLabel, empty$1, FUNC_STATEMENT, FUNC_HANGING_STATEMENT, FUNC_NULLABLE_ID, pp$7, TokContext, types, pp$6, pp$5, empty, pp$4, pp$3, Scope, Node, pp$2, scriptValuesAddedInUnicode, ecma9BinaryProperties, ecma10BinaryProperties, ecma11BinaryProperties, ecma12BinaryProperties, ecma13BinaryProperties, ecma14BinaryProperties, unicodeBinaryProperties, ecma14BinaryPropertiesOfStrings, unicodeBinaryPropertiesOfStrings, unicodeGeneralCategoryValues, ecma9ScriptValues, ecma10ScriptValues, ecma11ScriptValues, ecma12ScriptValues, ecma13ScriptValues, ecma14ScriptValues, unicodeScriptValues, data, ecmaVersion, i, list, pp$1, BranchID, RegExpValidationState, CharSetNone, CharSetOk, CharSetString, Token, pp, INVALID_TEMPLATE_ESCAPE_ERROR, version;
|
|
320
343
|
var init_acorn = __esm({
|
|
321
344
|
"node_modules/acorn/dist/acorn.mjs"() {
|
|
322
|
-
astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1,
|
|
323
|
-
astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2,
|
|
324
|
-
nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\
|
|
325
|
-
nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\
|
|
345
|
+
astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 31, 4, 33, 15, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 199, 7, 137, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 55, 9, 7, 0, 259, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 481, 1, 61, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 12, 2, 9, 1, 3, 0, 33, 1, 1357, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
346
|
+
astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 13, 65, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 18, 21, 18, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 18, 0, 182, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 22, 0, 239, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 111, 6, 206, 13, 310, 2314, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7386, 37, 33, 96, 114, 14, 913, 15, 50, 7710, 3, 2, 6, 2, 1, 2, 296, 10, 0, 30, 2, 3, 0, 15, 4, 8, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 340, 2, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 129, 15, 6, 55, 50, 49, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4382, 2, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489, 39815, 11327];
|
|
347
|
+
nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05C9\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B53-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1AF0\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65";
|
|
348
|
+
nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0558\u0559\u0560-\u0588\u058B\u058C\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u208F-\u209F\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DD\uA7E2\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB6C\uAB6D\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
|
|
326
349
|
reservedWords = {
|
|
327
350
|
3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
|
|
328
351
|
5: "class enum extends super const export import",
|
|
@@ -487,9 +510,12 @@ var init_acorn = __esm({
|
|
|
487
510
|
// for new syntax features.
|
|
488
511
|
ecmaVersion: null,
|
|
489
512
|
// `sourceType` indicates the mode the code should be parsed in.
|
|
490
|
-
// Can be either `"script"` or `"
|
|
513
|
+
// Can be either `"script"`, `"module"` or `"commonjs"`. This influences global
|
|
491
514
|
// strict mode and parsing of `import` and `export` declarations.
|
|
492
515
|
sourceType: "script",
|
|
516
|
+
// When set to true, enable strict parsing mode even if `sourceType`
|
|
517
|
+
// is `"script"`.
|
|
518
|
+
strict: false,
|
|
493
519
|
// `onInsertedSemicolon` can be a callback that will be called when
|
|
494
520
|
// a semicolon is automatically inserted. It will be passed the
|
|
495
521
|
// position of the inserted semicolon as an offset, and if
|
|
@@ -531,6 +557,11 @@ var init_acorn = __esm({
|
|
|
531
557
|
// line being 1-based and column 0-based) will be attached to the
|
|
532
558
|
// nodes.
|
|
533
559
|
locations: false,
|
|
560
|
+
// Pass an optional `{line, column}` object to use for the start of
|
|
561
|
+
// the parse. This is mostly useful when using `parseExpressionAt`
|
|
562
|
+
// with `locations: true`, to prevent the parser from having to
|
|
563
|
+
// determine the line position at the start position.
|
|
564
|
+
startLocation: null,
|
|
534
565
|
// A function can be passed as `onToken` option, which will
|
|
535
566
|
// cause Acorn to call that function with object in the same
|
|
536
567
|
// format as tokens returned from `tokenizer().getToken()`. Note
|
|
@@ -586,6 +617,7 @@ var init_acorn = __esm({
|
|
|
586
617
|
SCOPE_DIRECT_SUPER = 128;
|
|
587
618
|
SCOPE_CLASS_STATIC_BLOCK = 256;
|
|
588
619
|
SCOPE_CLASS_FIELD_INIT = 512;
|
|
620
|
+
SCOPE_SWITCH = 1024;
|
|
589
621
|
SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
|
|
590
622
|
BIND_NONE = 0;
|
|
591
623
|
BIND_VAR = 1;
|
|
@@ -610,13 +642,18 @@ var init_acorn = __esm({
|
|
|
610
642
|
this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind);
|
|
611
643
|
this.input = String(input2);
|
|
612
644
|
this.containsEsc = false;
|
|
613
|
-
|
|
614
|
-
|
|
645
|
+
this.pos = startPos || 0;
|
|
646
|
+
this.curLine = 1;
|
|
647
|
+
if (options.startLocation) {
|
|
648
|
+
this.lineStart = this.pos - options.startLocation.column;
|
|
649
|
+
this.curLine = options.startLocation.line;
|
|
650
|
+
} else if (startPos) {
|
|
615
651
|
this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
|
|
616
|
-
|
|
652
|
+
if (this.options.locations) {
|
|
653
|
+
this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
|
|
654
|
+
}
|
|
617
655
|
} else {
|
|
618
|
-
this.
|
|
619
|
-
this.curLine = 1;
|
|
656
|
+
this.lineStart = 0;
|
|
620
657
|
}
|
|
621
658
|
this.type = types$1.eof;
|
|
622
659
|
this.value = null;
|
|
@@ -627,7 +664,7 @@ var init_acorn = __esm({
|
|
|
627
664
|
this.context = this.initialContext();
|
|
628
665
|
this.exprAllowed = true;
|
|
629
666
|
this.inModule = options.sourceType === "module";
|
|
630
|
-
this.strict = this.inModule || this.strictDirective(this.pos);
|
|
667
|
+
this.strict = this.inModule || options.strict === true || this.strictDirective(this.pos);
|
|
631
668
|
this.potentialArrowAt = -1;
|
|
632
669
|
this.potentialArrowInForAwait = false;
|
|
633
670
|
this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
|
|
@@ -637,15 +674,20 @@ var init_acorn = __esm({
|
|
|
637
674
|
this.skipLineComment(2);
|
|
638
675
|
}
|
|
639
676
|
this.scopeStack = [];
|
|
640
|
-
this.enterScope(
|
|
677
|
+
this.enterScope(
|
|
678
|
+
this.options.sourceType === "commonjs" ? SCOPE_FUNCTION : SCOPE_TOP
|
|
679
|
+
);
|
|
641
680
|
this.regexpState = null;
|
|
642
681
|
this.privateNameStack = [];
|
|
643
682
|
};
|
|
644
|
-
prototypeAccessors = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, inClassStaticBlock: { configurable: true } };
|
|
683
|
+
prototypeAccessors = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowReturn: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, allowUsing: { configurable: true }, inClassStaticBlock: { configurable: true } };
|
|
645
684
|
Parser.prototype.parse = function parse() {
|
|
685
|
+
var this$1$1 = this;
|
|
646
686
|
var node = this.options.program || this.startNode();
|
|
647
687
|
this.nextToken();
|
|
648
|
-
return this.
|
|
688
|
+
return this.catchStackOverflow(function() {
|
|
689
|
+
return this$1$1.parseTopLevel(node);
|
|
690
|
+
});
|
|
649
691
|
};
|
|
650
692
|
prototypeAccessors.inFunction.get = function() {
|
|
651
693
|
return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
|
|
@@ -657,8 +699,8 @@ var init_acorn = __esm({
|
|
|
657
699
|
return (this.currentVarScope().flags & SCOPE_ASYNC) > 0;
|
|
658
700
|
};
|
|
659
701
|
prototypeAccessors.canAwait.get = function() {
|
|
660
|
-
for (var
|
|
661
|
-
var ref2 = this.scopeStack[
|
|
702
|
+
for (var i2 = this.scopeStack.length - 1; i2 >= 0; i2--) {
|
|
703
|
+
var ref2 = this.scopeStack[i2];
|
|
662
704
|
var flags = ref2.flags;
|
|
663
705
|
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT)) {
|
|
664
706
|
return false;
|
|
@@ -669,6 +711,15 @@ var init_acorn = __esm({
|
|
|
669
711
|
}
|
|
670
712
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
671
713
|
};
|
|
714
|
+
prototypeAccessors.allowReturn.get = function() {
|
|
715
|
+
if (this.inFunction) {
|
|
716
|
+
return true;
|
|
717
|
+
}
|
|
718
|
+
if (this.options.allowReturnOutsideFunction && this.currentVarScope().flags & SCOPE_TOP) {
|
|
719
|
+
return true;
|
|
720
|
+
}
|
|
721
|
+
return false;
|
|
722
|
+
};
|
|
672
723
|
prototypeAccessors.allowSuper.get = function() {
|
|
673
724
|
var ref2 = this.currentThisScope();
|
|
674
725
|
var flags = ref2.flags;
|
|
@@ -681,8 +732,8 @@ var init_acorn = __esm({
|
|
|
681
732
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
682
733
|
};
|
|
683
734
|
prototypeAccessors.allowNewDotTarget.get = function() {
|
|
684
|
-
for (var
|
|
685
|
-
var ref2 = this.scopeStack[
|
|
735
|
+
for (var i2 = this.scopeStack.length - 1; i2 >= 0; i2--) {
|
|
736
|
+
var ref2 = this.scopeStack[i2];
|
|
686
737
|
var flags = ref2.flags;
|
|
687
738
|
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT) || flags & SCOPE_FUNCTION && !(flags & SCOPE_ARROW)) {
|
|
688
739
|
return true;
|
|
@@ -690,6 +741,17 @@ var init_acorn = __esm({
|
|
|
690
741
|
}
|
|
691
742
|
return false;
|
|
692
743
|
};
|
|
744
|
+
prototypeAccessors.allowUsing.get = function() {
|
|
745
|
+
var ref2 = this.currentScope();
|
|
746
|
+
var flags = ref2.flags;
|
|
747
|
+
if (flags & SCOPE_SWITCH) {
|
|
748
|
+
return false;
|
|
749
|
+
}
|
|
750
|
+
if (!this.inModule && flags & SCOPE_TOP) {
|
|
751
|
+
return false;
|
|
752
|
+
}
|
|
753
|
+
return true;
|
|
754
|
+
};
|
|
693
755
|
prototypeAccessors.inClassStaticBlock.get = function() {
|
|
694
756
|
return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0;
|
|
695
757
|
};
|
|
@@ -697,8 +759,8 @@ var init_acorn = __esm({
|
|
|
697
759
|
var plugins = [], len = arguments.length;
|
|
698
760
|
while (len--) plugins[len] = arguments[len];
|
|
699
761
|
var cls = this;
|
|
700
|
-
for (var
|
|
701
|
-
cls = plugins[
|
|
762
|
+
for (var i2 = 0; i2 < plugins.length; i2++) {
|
|
763
|
+
cls = plugins[i2](cls);
|
|
702
764
|
}
|
|
703
765
|
return cls;
|
|
704
766
|
};
|
|
@@ -731,7 +793,7 @@ var init_acorn = __esm({
|
|
|
731
793
|
skipWhiteSpace.lastIndex = start + match2[0].length;
|
|
732
794
|
var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
|
|
733
795
|
var next2 = this.input.charAt(end);
|
|
734
|
-
return next2 === ";" || next2 === "}" || lineBreak.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next2) || next2 === "!" && this.input.charAt(end + 1) === "=");
|
|
796
|
+
return next2 === ";" || next2 === "}" || lineBreak.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next2) || next2 === "!" && this.input.charAt(end + 1) === "=" || next2 === "i" && keywordOpAt(this, end));
|
|
735
797
|
}
|
|
736
798
|
start += match2[0].length;
|
|
737
799
|
skipWhiteSpace.lastIndex = start;
|
|
@@ -759,6 +821,17 @@ var init_acorn = __esm({
|
|
|
759
821
|
this.next();
|
|
760
822
|
return true;
|
|
761
823
|
};
|
|
824
|
+
pp$9.catchStackOverflow = function(f) {
|
|
825
|
+
try {
|
|
826
|
+
return f();
|
|
827
|
+
} catch (e) {
|
|
828
|
+
if (e instanceof Error && (/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message) || /\btoo much recursion\b/i.test(e.message))) {
|
|
829
|
+
this.raise(this.start, "Not enough stack space to parse input");
|
|
830
|
+
} else {
|
|
831
|
+
throw e;
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
};
|
|
762
835
|
pp$9.expectContextual = function(name) {
|
|
763
836
|
if (!this.eatContextual(name)) {
|
|
764
837
|
this.unexpected();
|
|
@@ -844,23 +917,23 @@ var init_acorn = __esm({
|
|
|
844
917
|
};
|
|
845
918
|
pp$8 = Parser.prototype;
|
|
846
919
|
pp$8.parseTopLevel = function(node) {
|
|
847
|
-
var exports = /* @__PURE__ */ Object.create(null);
|
|
920
|
+
var exports$1 = /* @__PURE__ */ Object.create(null);
|
|
848
921
|
if (!node.body) {
|
|
849
922
|
node.body = [];
|
|
850
923
|
}
|
|
851
924
|
while (this.type !== types$1.eof) {
|
|
852
|
-
var stmt = this.parseStatement(null, true, exports);
|
|
925
|
+
var stmt = this.parseStatement(null, true, exports$1);
|
|
853
926
|
node.body.push(stmt);
|
|
854
927
|
}
|
|
855
928
|
if (this.inModule) {
|
|
856
|
-
for (var
|
|
857
|
-
var name =
|
|
929
|
+
for (var i2 = 0, list2 = Object.keys(this.undefinedExports); i2 < list2.length; i2 += 1) {
|
|
930
|
+
var name = list2[i2];
|
|
858
931
|
this.raiseRecoverable(this.undefinedExports[name].start, "Export '" + name + "' is not defined");
|
|
859
932
|
}
|
|
860
933
|
}
|
|
861
934
|
this.adaptDirectivePrologue(node.body);
|
|
862
935
|
this.next();
|
|
863
|
-
node.sourceType = this.options.sourceType;
|
|
936
|
+
node.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType;
|
|
864
937
|
return this.finishNode(node, "Program");
|
|
865
938
|
};
|
|
866
939
|
loopLabel = { kind: "loop" };
|
|
@@ -871,25 +944,25 @@ var init_acorn = __esm({
|
|
|
871
944
|
}
|
|
872
945
|
skipWhiteSpace.lastIndex = this.pos;
|
|
873
946
|
var skip = skipWhiteSpace.exec(this.input);
|
|
874
|
-
var next2 = this.pos + skip[0].length, nextCh = this.
|
|
947
|
+
var next2 = this.pos + skip[0].length, nextCh = this.fullCharCodeAt(next2);
|
|
875
948
|
if (nextCh === 91 || nextCh === 92) {
|
|
876
949
|
return true;
|
|
877
950
|
}
|
|
878
951
|
if (context) {
|
|
879
952
|
return false;
|
|
880
953
|
}
|
|
881
|
-
if (nextCh === 123
|
|
954
|
+
if (nextCh === 123) {
|
|
882
955
|
return true;
|
|
883
956
|
}
|
|
884
|
-
if (isIdentifierStart(nextCh
|
|
885
|
-
var
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
}
|
|
889
|
-
if (nextCh === 92
|
|
957
|
+
if (isIdentifierStart(nextCh)) {
|
|
958
|
+
var start = next2;
|
|
959
|
+
do {
|
|
960
|
+
next2 += nextCh <= 65535 ? 1 : 2;
|
|
961
|
+
} while (isIdentifierChar(nextCh = this.fullCharCodeAt(next2)));
|
|
962
|
+
if (nextCh === 92) {
|
|
890
963
|
return true;
|
|
891
964
|
}
|
|
892
|
-
var ident = this.input.slice(
|
|
965
|
+
var ident = this.input.slice(start, next2);
|
|
893
966
|
if (!keywordRelationalOperator.test(ident)) {
|
|
894
967
|
return true;
|
|
895
968
|
}
|
|
@@ -903,7 +976,7 @@ var init_acorn = __esm({
|
|
|
903
976
|
skipWhiteSpace.lastIndex = this.pos;
|
|
904
977
|
var skip = skipWhiteSpace.exec(this.input);
|
|
905
978
|
var next2 = this.pos + skip[0].length, after;
|
|
906
|
-
return !lineBreak.test(this.input.slice(this.pos, next2)) && this.input.slice(next2, next2 + 8) === "function" && (next2 + 8 === this.input.length || !(isIdentifierChar(after = this.
|
|
979
|
+
return !lineBreak.test(this.input.slice(this.pos, next2)) && this.input.slice(next2, next2 + 8) === "function" && (next2 + 8 === this.input.length || !(isIdentifierChar(after = this.fullCharCodeAt(next2 + 8)) || after === 92));
|
|
907
980
|
};
|
|
908
981
|
pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
|
|
909
982
|
if (this.options.ecmaVersion < 17 || !this.isContextual(isAwaitUsing ? "await" : "using")) {
|
|
@@ -916,26 +989,42 @@ var init_acorn = __esm({
|
|
|
916
989
|
return false;
|
|
917
990
|
}
|
|
918
991
|
if (isAwaitUsing) {
|
|
919
|
-
var
|
|
920
|
-
if (this.input.slice(next2,
|
|
992
|
+
var usingEndPos = next2 + 5, after;
|
|
993
|
+
if (this.input.slice(next2, usingEndPos) !== "using" || usingEndPos === this.input.length || isIdentifierChar(after = this.fullCharCodeAt(usingEndPos)) || after === 92) {
|
|
921
994
|
return false;
|
|
922
995
|
}
|
|
923
|
-
skipWhiteSpace.lastIndex =
|
|
996
|
+
skipWhiteSpace.lastIndex = usingEndPos;
|
|
924
997
|
var skipAfterUsing = skipWhiteSpace.exec(this.input);
|
|
925
|
-
|
|
998
|
+
next2 = usingEndPos + skipAfterUsing[0].length;
|
|
999
|
+
if (skipAfterUsing && lineBreak.test(this.input.slice(usingEndPos, next2))) {
|
|
926
1000
|
return false;
|
|
927
1001
|
}
|
|
928
1002
|
}
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
1003
|
+
var ch = this.fullCharCodeAt(next2);
|
|
1004
|
+
if (!isIdentifierStart(ch) && ch !== 92) {
|
|
1005
|
+
return false;
|
|
1006
|
+
}
|
|
1007
|
+
var idStart = next2;
|
|
1008
|
+
do {
|
|
1009
|
+
next2 += ch <= 65535 ? 1 : 2;
|
|
1010
|
+
} while (isIdentifierChar(ch = this.fullCharCodeAt(next2)));
|
|
1011
|
+
if (ch === 92) {
|
|
1012
|
+
return true;
|
|
1013
|
+
}
|
|
1014
|
+
var id = this.input.slice(idStart, next2);
|
|
1015
|
+
if (keywordRelationalOperator.test(id)) {
|
|
1016
|
+
return false;
|
|
1017
|
+
}
|
|
1018
|
+
if (isFor && !isAwaitUsing && id === "of") {
|
|
1019
|
+
skipWhiteSpace.lastIndex = next2;
|
|
1020
|
+
var skipAfterOf = skipWhiteSpace.exec(this.input);
|
|
1021
|
+
next2 = next2 + skipAfterOf[0].length;
|
|
1022
|
+
if (this.input.charCodeAt(next2) !== 61 || // Check for ==, === and => operators
|
|
1023
|
+
(ch = this.input.charCodeAt(next2 + 1)) === 61 || ch === 62) {
|
|
1024
|
+
return false;
|
|
935
1025
|
}
|
|
936
1026
|
}
|
|
937
|
-
|
|
938
|
-
return isIdentifierStart(ch, true) || ch === 92;
|
|
1027
|
+
return true;
|
|
939
1028
|
};
|
|
940
1029
|
pp$8.isAwaitUsing = function(isFor) {
|
|
941
1030
|
return this.isUsingKeyword(true, isFor);
|
|
@@ -943,7 +1032,7 @@ var init_acorn = __esm({
|
|
|
943
1032
|
pp$8.isUsing = function(isFor) {
|
|
944
1033
|
return this.isUsingKeyword(false, isFor);
|
|
945
1034
|
};
|
|
946
|
-
pp$8.parseStatement = function(context, topLevel, exports) {
|
|
1035
|
+
pp$8.parseStatement = function(context, topLevel, exports$1) {
|
|
947
1036
|
var starttype = this.type, node = this.startNode(), kind;
|
|
948
1037
|
if (this.isLet(context)) {
|
|
949
1038
|
starttype = types$1._var;
|
|
@@ -1012,7 +1101,7 @@ var init_acorn = __esm({
|
|
|
1012
1101
|
this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'");
|
|
1013
1102
|
}
|
|
1014
1103
|
}
|
|
1015
|
-
return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports);
|
|
1104
|
+
return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports$1);
|
|
1016
1105
|
// If the statement does not start with a statement keyword or a
|
|
1017
1106
|
// brace, it's an ExpressionStatement or LabeledStatement. We
|
|
1018
1107
|
// simply start parsing an expression, and afterwards, if the
|
|
@@ -1028,8 +1117,11 @@ var init_acorn = __esm({
|
|
|
1028
1117
|
}
|
|
1029
1118
|
var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
|
|
1030
1119
|
if (usingKind) {
|
|
1031
|
-
if (
|
|
1032
|
-
this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script`");
|
|
1120
|
+
if (!this.allowUsing) {
|
|
1121
|
+
this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");
|
|
1122
|
+
}
|
|
1123
|
+
if (context) {
|
|
1124
|
+
this.raise(this.start, "Using declaration is not allowed in single-statement positions");
|
|
1033
1125
|
}
|
|
1034
1126
|
if (usingKind === "await using") {
|
|
1035
1127
|
if (!this.canAwait) {
|
|
@@ -1061,9 +1153,9 @@ var init_acorn = __esm({
|
|
|
1061
1153
|
node.label = this.parseIdent();
|
|
1062
1154
|
this.semicolon();
|
|
1063
1155
|
}
|
|
1064
|
-
var
|
|
1065
|
-
for (;
|
|
1066
|
-
var lab = this.labels[
|
|
1156
|
+
var i2 = 0;
|
|
1157
|
+
for (; i2 < this.labels.length; ++i2) {
|
|
1158
|
+
var lab = this.labels[i2];
|
|
1067
1159
|
if (node.label == null || lab.name === node.label.name) {
|
|
1068
1160
|
if (lab.kind != null && (isBreak || lab.kind === "loop")) {
|
|
1069
1161
|
break;
|
|
@@ -1073,7 +1165,7 @@ var init_acorn = __esm({
|
|
|
1073
1165
|
}
|
|
1074
1166
|
}
|
|
1075
1167
|
}
|
|
1076
|
-
if (
|
|
1168
|
+
if (i2 === this.labels.length) {
|
|
1077
1169
|
this.raise(node.start, "Unsyntactic " + keyword);
|
|
1078
1170
|
}
|
|
1079
1171
|
return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
|
|
@@ -1123,6 +1215,9 @@ var init_acorn = __esm({
|
|
|
1123
1215
|
var init$2 = this.startNode();
|
|
1124
1216
|
this.next();
|
|
1125
1217
|
if (usingKind === "await using") {
|
|
1218
|
+
if (!this.canAwait) {
|
|
1219
|
+
this.raise(this.start, "Await using cannot appear outside of async function");
|
|
1220
|
+
}
|
|
1126
1221
|
this.next();
|
|
1127
1222
|
}
|
|
1128
1223
|
this.parseVar(init$2, true, usingKind);
|
|
@@ -1162,14 +1257,15 @@ var init_acorn = __esm({
|
|
|
1162
1257
|
};
|
|
1163
1258
|
pp$8.parseForAfterInit = function(node, init, awaitAt) {
|
|
1164
1259
|
if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init.declarations.length === 1) {
|
|
1165
|
-
if (this.
|
|
1166
|
-
if (
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
node.await = awaitAt > -1;
|
|
1260
|
+
if (this.type === types$1._in) {
|
|
1261
|
+
if ((init.kind === "using" || init.kind === "await using") && !init.declarations[0].init) {
|
|
1262
|
+
this.raise(this.start, "Using declaration is not allowed in for-in loops");
|
|
1263
|
+
}
|
|
1264
|
+
if (this.options.ecmaVersion >= 9 && awaitAt > -1) {
|
|
1265
|
+
this.unexpected(awaitAt);
|
|
1172
1266
|
}
|
|
1267
|
+
} else if (this.options.ecmaVersion >= 9) {
|
|
1268
|
+
node.await = awaitAt > -1;
|
|
1173
1269
|
}
|
|
1174
1270
|
return this.parseForIn(node, init);
|
|
1175
1271
|
}
|
|
@@ -1190,7 +1286,7 @@ var init_acorn = __esm({
|
|
|
1190
1286
|
return this.finishNode(node, "IfStatement");
|
|
1191
1287
|
};
|
|
1192
1288
|
pp$8.parseReturnStatement = function(node) {
|
|
1193
|
-
if (!this.
|
|
1289
|
+
if (!this.allowReturn) {
|
|
1194
1290
|
this.raise(this.start, "'return' outside of function");
|
|
1195
1291
|
}
|
|
1196
1292
|
this.next();
|
|
@@ -1208,7 +1304,7 @@ var init_acorn = __esm({
|
|
|
1208
1304
|
node.cases = [];
|
|
1209
1305
|
this.expect(types$1.braceL);
|
|
1210
1306
|
this.labels.push(switchLabel);
|
|
1211
|
-
this.enterScope(
|
|
1307
|
+
this.enterScope(SCOPE_SWITCH);
|
|
1212
1308
|
var cur;
|
|
1213
1309
|
for (var sawDefault = false; this.type !== types$1.braceR; ) {
|
|
1214
1310
|
if (this.type === types$1._case || this.type === types$1._default) {
|
|
@@ -1316,15 +1412,15 @@ var init_acorn = __esm({
|
|
|
1316
1412
|
return this.finishNode(node, "EmptyStatement");
|
|
1317
1413
|
};
|
|
1318
1414
|
pp$8.parseLabeledStatement = function(node, maybeName, expr, context) {
|
|
1319
|
-
for (var i$1 = 0,
|
|
1320
|
-
var label =
|
|
1415
|
+
for (var i$1 = 0, list2 = this.labels; i$1 < list2.length; i$1 += 1) {
|
|
1416
|
+
var label = list2[i$1];
|
|
1321
1417
|
if (label.name === maybeName) {
|
|
1322
1418
|
this.raise(expr.start, "Label '" + maybeName + "' is already declared");
|
|
1323
1419
|
}
|
|
1324
1420
|
}
|
|
1325
1421
|
var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null;
|
|
1326
|
-
for (var
|
|
1327
|
-
var label$1 = this.labels[
|
|
1422
|
+
for (var i2 = this.labels.length - 1; i2 >= 0; i2--) {
|
|
1423
|
+
var label$1 = this.labels[i2];
|
|
1328
1424
|
if (label$1.statementStart === node.start) {
|
|
1329
1425
|
label$1.statementStart = this.start;
|
|
1330
1426
|
label$1.kind = kind;
|
|
@@ -1496,7 +1592,7 @@ var init_acorn = __esm({
|
|
|
1496
1592
|
if (this.eat(types$1.semi)) {
|
|
1497
1593
|
return null;
|
|
1498
1594
|
}
|
|
1499
|
-
var
|
|
1595
|
+
var ecmaVersion2 = this.options.ecmaVersion;
|
|
1500
1596
|
var node = this.startNode();
|
|
1501
1597
|
var keyName = "";
|
|
1502
1598
|
var isGenerator = false;
|
|
@@ -1504,7 +1600,7 @@ var init_acorn = __esm({
|
|
|
1504
1600
|
var kind = "method";
|
|
1505
1601
|
var isStatic = false;
|
|
1506
1602
|
if (this.eatContextual("static")) {
|
|
1507
|
-
if (
|
|
1603
|
+
if (ecmaVersion2 >= 13 && this.eat(types$1.braceL)) {
|
|
1508
1604
|
this.parseClassStaticBlock(node);
|
|
1509
1605
|
return node;
|
|
1510
1606
|
}
|
|
@@ -1515,14 +1611,14 @@ var init_acorn = __esm({
|
|
|
1515
1611
|
}
|
|
1516
1612
|
}
|
|
1517
1613
|
node.static = isStatic;
|
|
1518
|
-
if (!keyName &&
|
|
1614
|
+
if (!keyName && ecmaVersion2 >= 8 && this.eatContextual("async")) {
|
|
1519
1615
|
if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) {
|
|
1520
1616
|
isAsync = true;
|
|
1521
1617
|
} else {
|
|
1522
1618
|
keyName = "async";
|
|
1523
1619
|
}
|
|
1524
1620
|
}
|
|
1525
|
-
if (!keyName && (
|
|
1621
|
+
if (!keyName && (ecmaVersion2 >= 9 || !isAsync) && this.eat(types$1.star)) {
|
|
1526
1622
|
isGenerator = true;
|
|
1527
1623
|
}
|
|
1528
1624
|
if (!keyName && !isAsync && !isGenerator) {
|
|
@@ -1543,7 +1639,7 @@ var init_acorn = __esm({
|
|
|
1543
1639
|
} else {
|
|
1544
1640
|
this.parseClassElementName(node);
|
|
1545
1641
|
}
|
|
1546
|
-
if (
|
|
1642
|
+
if (ecmaVersion2 < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) {
|
|
1547
1643
|
var isConstructor = !node.static && checkKeyName(node, "constructor");
|
|
1548
1644
|
var allowsDirectSuper = isConstructor && constructorAllowsSuper;
|
|
1549
1645
|
if (isConstructor && kind !== "method") {
|
|
@@ -1654,8 +1750,8 @@ var init_acorn = __esm({
|
|
|
1654
1750
|
}
|
|
1655
1751
|
var len = this.privateNameStack.length;
|
|
1656
1752
|
var parent = len === 0 ? null : this.privateNameStack[len - 1];
|
|
1657
|
-
for (var
|
|
1658
|
-
var id = used[
|
|
1753
|
+
for (var i2 = 0; i2 < used.length; ++i2) {
|
|
1754
|
+
var id = used[i2];
|
|
1659
1755
|
if (!hasOwn(declared, id.name)) {
|
|
1660
1756
|
if (parent) {
|
|
1661
1757
|
parent.used.push(id);
|
|
@@ -1665,11 +1761,11 @@ var init_acorn = __esm({
|
|
|
1665
1761
|
}
|
|
1666
1762
|
}
|
|
1667
1763
|
};
|
|
1668
|
-
pp$8.parseExportAllDeclaration = function(node, exports) {
|
|
1764
|
+
pp$8.parseExportAllDeclaration = function(node, exports$1) {
|
|
1669
1765
|
if (this.options.ecmaVersion >= 11) {
|
|
1670
1766
|
if (this.eatContextual("as")) {
|
|
1671
1767
|
node.exported = this.parseModuleExportName();
|
|
1672
|
-
this.checkExport(exports, node.exported, this.lastTokStart);
|
|
1768
|
+
this.checkExport(exports$1, node.exported, this.lastTokStart);
|
|
1673
1769
|
} else {
|
|
1674
1770
|
node.exported = null;
|
|
1675
1771
|
}
|
|
@@ -1685,22 +1781,22 @@ var init_acorn = __esm({
|
|
|
1685
1781
|
this.semicolon();
|
|
1686
1782
|
return this.finishNode(node, "ExportAllDeclaration");
|
|
1687
1783
|
};
|
|
1688
|
-
pp$8.parseExport = function(node, exports) {
|
|
1784
|
+
pp$8.parseExport = function(node, exports$1) {
|
|
1689
1785
|
this.next();
|
|
1690
1786
|
if (this.eat(types$1.star)) {
|
|
1691
|
-
return this.parseExportAllDeclaration(node, exports);
|
|
1787
|
+
return this.parseExportAllDeclaration(node, exports$1);
|
|
1692
1788
|
}
|
|
1693
1789
|
if (this.eat(types$1._default)) {
|
|
1694
|
-
this.checkExport(exports, "default", this.lastTokStart);
|
|
1790
|
+
this.checkExport(exports$1, "default", this.lastTokStart);
|
|
1695
1791
|
node.declaration = this.parseExportDefaultDeclaration();
|
|
1696
1792
|
return this.finishNode(node, "ExportDefaultDeclaration");
|
|
1697
1793
|
}
|
|
1698
1794
|
if (this.shouldParseExportStatement()) {
|
|
1699
1795
|
node.declaration = this.parseExportDeclaration(node);
|
|
1700
1796
|
if (node.declaration.type === "VariableDeclaration") {
|
|
1701
|
-
this.checkVariableExport(exports, node.declaration.declarations);
|
|
1797
|
+
this.checkVariableExport(exports$1, node.declaration.declarations);
|
|
1702
1798
|
} else {
|
|
1703
|
-
this.checkExport(exports, node.declaration.id, node.declaration.id.start);
|
|
1799
|
+
this.checkExport(exports$1, node.declaration.id, node.declaration.id.start);
|
|
1704
1800
|
}
|
|
1705
1801
|
node.specifiers = [];
|
|
1706
1802
|
node.source = null;
|
|
@@ -1709,7 +1805,7 @@ var init_acorn = __esm({
|
|
|
1709
1805
|
}
|
|
1710
1806
|
} else {
|
|
1711
1807
|
node.declaration = null;
|
|
1712
|
-
node.specifiers = this.parseExportSpecifiers(exports);
|
|
1808
|
+
node.specifiers = this.parseExportSpecifiers(exports$1);
|
|
1713
1809
|
if (this.eatContextual("from")) {
|
|
1714
1810
|
if (this.type !== types$1.string) {
|
|
1715
1811
|
this.unexpected();
|
|
@@ -1719,8 +1815,8 @@ var init_acorn = __esm({
|
|
|
1719
1815
|
node.attributes = this.parseWithClause();
|
|
1720
1816
|
}
|
|
1721
1817
|
} else {
|
|
1722
|
-
for (var
|
|
1723
|
-
var spec =
|
|
1818
|
+
for (var i2 = 0, list2 = node.specifiers; i2 < list2.length; i2 += 1) {
|
|
1819
|
+
var spec = list2[i2];
|
|
1724
1820
|
this.checkUnreserved(spec.local);
|
|
1725
1821
|
this.checkLocalExport(spec.local);
|
|
1726
1822
|
if (spec.local.type === "Literal") {
|
|
@@ -1757,66 +1853,66 @@ var init_acorn = __esm({
|
|
|
1757
1853
|
return declaration;
|
|
1758
1854
|
}
|
|
1759
1855
|
};
|
|
1760
|
-
pp$8.checkExport = function(exports, name, pos) {
|
|
1761
|
-
if (!exports) {
|
|
1856
|
+
pp$8.checkExport = function(exports$1, name, pos) {
|
|
1857
|
+
if (!exports$1) {
|
|
1762
1858
|
return;
|
|
1763
1859
|
}
|
|
1764
1860
|
if (typeof name !== "string") {
|
|
1765
1861
|
name = name.type === "Identifier" ? name.name : name.value;
|
|
1766
1862
|
}
|
|
1767
|
-
if (hasOwn(exports, name)) {
|
|
1863
|
+
if (hasOwn(exports$1, name)) {
|
|
1768
1864
|
this.raiseRecoverable(pos, "Duplicate export '" + name + "'");
|
|
1769
1865
|
}
|
|
1770
|
-
exports[name] = true;
|
|
1866
|
+
exports$1[name] = true;
|
|
1771
1867
|
};
|
|
1772
|
-
pp$8.checkPatternExport = function(exports, pat) {
|
|
1868
|
+
pp$8.checkPatternExport = function(exports$1, pat) {
|
|
1773
1869
|
var type = pat.type;
|
|
1774
1870
|
if (type === "Identifier") {
|
|
1775
|
-
this.checkExport(exports, pat, pat.start);
|
|
1871
|
+
this.checkExport(exports$1, pat, pat.start);
|
|
1776
1872
|
} else if (type === "ObjectPattern") {
|
|
1777
|
-
for (var
|
|
1778
|
-
var prop =
|
|
1779
|
-
this.checkPatternExport(exports, prop);
|
|
1873
|
+
for (var i2 = 0, list2 = pat.properties; i2 < list2.length; i2 += 1) {
|
|
1874
|
+
var prop = list2[i2];
|
|
1875
|
+
this.checkPatternExport(exports$1, prop);
|
|
1780
1876
|
}
|
|
1781
1877
|
} else if (type === "ArrayPattern") {
|
|
1782
1878
|
for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
|
|
1783
1879
|
var elt = list$1[i$1];
|
|
1784
1880
|
if (elt) {
|
|
1785
|
-
this.checkPatternExport(exports, elt);
|
|
1881
|
+
this.checkPatternExport(exports$1, elt);
|
|
1786
1882
|
}
|
|
1787
1883
|
}
|
|
1788
1884
|
} else if (type === "Property") {
|
|
1789
|
-
this.checkPatternExport(exports, pat.value);
|
|
1885
|
+
this.checkPatternExport(exports$1, pat.value);
|
|
1790
1886
|
} else if (type === "AssignmentPattern") {
|
|
1791
|
-
this.checkPatternExport(exports, pat.left);
|
|
1887
|
+
this.checkPatternExport(exports$1, pat.left);
|
|
1792
1888
|
} else if (type === "RestElement") {
|
|
1793
|
-
this.checkPatternExport(exports, pat.argument);
|
|
1889
|
+
this.checkPatternExport(exports$1, pat.argument);
|
|
1794
1890
|
}
|
|
1795
1891
|
};
|
|
1796
|
-
pp$8.checkVariableExport = function(exports, decls) {
|
|
1797
|
-
if (!exports) {
|
|
1892
|
+
pp$8.checkVariableExport = function(exports$1, decls) {
|
|
1893
|
+
if (!exports$1) {
|
|
1798
1894
|
return;
|
|
1799
1895
|
}
|
|
1800
|
-
for (var
|
|
1801
|
-
var decl =
|
|
1802
|
-
this.checkPatternExport(exports, decl.id);
|
|
1896
|
+
for (var i2 = 0, list2 = decls; i2 < list2.length; i2 += 1) {
|
|
1897
|
+
var decl = list2[i2];
|
|
1898
|
+
this.checkPatternExport(exports$1, decl.id);
|
|
1803
1899
|
}
|
|
1804
1900
|
};
|
|
1805
1901
|
pp$8.shouldParseExportStatement = function() {
|
|
1806
1902
|
return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
|
|
1807
1903
|
};
|
|
1808
|
-
pp$8.parseExportSpecifier = function(exports) {
|
|
1904
|
+
pp$8.parseExportSpecifier = function(exports$1) {
|
|
1809
1905
|
var node = this.startNode();
|
|
1810
1906
|
node.local = this.parseModuleExportName();
|
|
1811
1907
|
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
1812
1908
|
this.checkExport(
|
|
1813
|
-
exports,
|
|
1909
|
+
exports$1,
|
|
1814
1910
|
node.exported,
|
|
1815
1911
|
node.exported.start
|
|
1816
1912
|
);
|
|
1817
1913
|
return this.finishNode(node, "ExportSpecifier");
|
|
1818
1914
|
};
|
|
1819
|
-
pp$8.parseExportSpecifiers = function(exports) {
|
|
1915
|
+
pp$8.parseExportSpecifiers = function(exports$1) {
|
|
1820
1916
|
var nodes = [], first = true;
|
|
1821
1917
|
this.expect(types$1.braceL);
|
|
1822
1918
|
while (!this.eat(types$1.braceR)) {
|
|
@@ -1828,7 +1924,7 @@ var init_acorn = __esm({
|
|
|
1828
1924
|
} else {
|
|
1829
1925
|
first = false;
|
|
1830
1926
|
}
|
|
1831
|
-
nodes.push(this.parseExportSpecifier(exports));
|
|
1927
|
+
nodes.push(this.parseExportSpecifier(exports$1));
|
|
1832
1928
|
}
|
|
1833
1929
|
return nodes;
|
|
1834
1930
|
};
|
|
@@ -1948,8 +2044,8 @@ var init_acorn = __esm({
|
|
|
1948
2044
|
return this.parseIdent(true);
|
|
1949
2045
|
};
|
|
1950
2046
|
pp$8.adaptDirectivePrologue = function(statements) {
|
|
1951
|
-
for (var
|
|
1952
|
-
statements[
|
|
2047
|
+
for (var i2 = 0; i2 < statements.length && this.isDirectiveCandidate(statements[i2]); ++i2) {
|
|
2048
|
+
statements[i2].directive = statements[i2].expression.raw.slice(1, -1);
|
|
1953
2049
|
}
|
|
1954
2050
|
};
|
|
1955
2051
|
pp$8.isDirectiveCandidate = function(statement) {
|
|
@@ -1975,8 +2071,8 @@ var init_acorn = __esm({
|
|
|
1975
2071
|
if (refDestructuringErrors) {
|
|
1976
2072
|
this.checkPatternErrors(refDestructuringErrors, true);
|
|
1977
2073
|
}
|
|
1978
|
-
for (var
|
|
1979
|
-
var prop =
|
|
2074
|
+
for (var i2 = 0, list2 = node.properties; i2 < list2.length; i2 += 1) {
|
|
2075
|
+
var prop = list2[i2];
|
|
1980
2076
|
this.toAssignable(prop, isBinding);
|
|
1981
2077
|
if (prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")) {
|
|
1982
2078
|
this.raise(prop.argument.start, "Unexpected token");
|
|
@@ -2031,8 +2127,8 @@ var init_acorn = __esm({
|
|
|
2031
2127
|
};
|
|
2032
2128
|
pp$7.toAssignableList = function(exprList, isBinding) {
|
|
2033
2129
|
var end = exprList.length;
|
|
2034
|
-
for (var
|
|
2035
|
-
var elt = exprList[
|
|
2130
|
+
for (var i2 = 0; i2 < end; i2++) {
|
|
2131
|
+
var elt = exprList[i2];
|
|
2036
2132
|
if (elt) {
|
|
2037
2133
|
this.toAssignable(elt, isBinding);
|
|
2038
2134
|
}
|
|
@@ -2163,8 +2259,8 @@ var init_acorn = __esm({
|
|
|
2163
2259
|
if (bindingType === void 0) bindingType = BIND_NONE;
|
|
2164
2260
|
switch (expr.type) {
|
|
2165
2261
|
case "ObjectPattern":
|
|
2166
|
-
for (var
|
|
2167
|
-
var prop =
|
|
2262
|
+
for (var i2 = 0, list2 = expr.properties; i2 < list2.length; i2 += 1) {
|
|
2263
|
+
var prop = list2[i2];
|
|
2168
2264
|
this.checkLValInnerPattern(prop, bindingType, checkClashes);
|
|
2169
2265
|
}
|
|
2170
2266
|
break;
|
|
@@ -2247,8 +2343,8 @@ var init_acorn = __esm({
|
|
|
2247
2343
|
return !this.exprAllowed;
|
|
2248
2344
|
};
|
|
2249
2345
|
pp$6.inGeneratorContext = function() {
|
|
2250
|
-
for (var
|
|
2251
|
-
var context = this.context[
|
|
2346
|
+
for (var i2 = this.context.length - 1; i2 >= 1; i2--) {
|
|
2347
|
+
var context = this.context[i2];
|
|
2252
2348
|
if (context.token === "function") {
|
|
2253
2349
|
return context.generator;
|
|
2254
2350
|
}
|
|
@@ -2396,17 +2492,20 @@ var init_acorn = __esm({
|
|
|
2396
2492
|
other[kind] = true;
|
|
2397
2493
|
};
|
|
2398
2494
|
pp$5.parseExpression = function(forInit, refDestructuringErrors) {
|
|
2399
|
-
var
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
var
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
node.expressions
|
|
2495
|
+
var this$1$1 = this;
|
|
2496
|
+
return this.catchStackOverflow(function() {
|
|
2497
|
+
var startPos = this$1$1.start, startLoc = this$1$1.startLoc;
|
|
2498
|
+
var expr = this$1$1.parseMaybeAssign(forInit, refDestructuringErrors);
|
|
2499
|
+
if (this$1$1.type === types$1.comma) {
|
|
2500
|
+
var node = this$1$1.startNodeAt(startPos, startLoc);
|
|
2501
|
+
node.expressions = [expr];
|
|
2502
|
+
while (this$1$1.eat(types$1.comma)) {
|
|
2503
|
+
node.expressions.push(this$1$1.parseMaybeAssign(forInit, refDestructuringErrors));
|
|
2504
|
+
}
|
|
2505
|
+
return this$1$1.finishNode(node, "SequenceExpression");
|
|
2406
2506
|
}
|
|
2407
|
-
return
|
|
2408
|
-
}
|
|
2409
|
-
return expr;
|
|
2507
|
+
return expr;
|
|
2508
|
+
});
|
|
2410
2509
|
};
|
|
2411
2510
|
pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {
|
|
2412
2511
|
if (this.isContextual("yield")) {
|
|
@@ -2442,10 +2541,13 @@ var init_acorn = __esm({
|
|
|
2442
2541
|
left = this.toAssignable(left, false, refDestructuringErrors);
|
|
2443
2542
|
}
|
|
2444
2543
|
if (!ownDestructuringErrors) {
|
|
2445
|
-
refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma =
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2544
|
+
refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
|
|
2545
|
+
if (refDestructuringErrors.shorthandAssign >= left.start) {
|
|
2546
|
+
refDestructuringErrors.shorthandAssign = -1;
|
|
2547
|
+
}
|
|
2548
|
+
if (refDestructuringErrors.doubleProto >= left.start) {
|
|
2549
|
+
refDestructuringErrors.doubleProto = -1;
|
|
2550
|
+
}
|
|
2449
2551
|
}
|
|
2450
2552
|
if (this.type === types$1.eq) {
|
|
2451
2553
|
this.checkLValPattern(left);
|
|
@@ -2478,7 +2580,7 @@ var init_acorn = __esm({
|
|
|
2478
2580
|
if (this.checkExpressionErrors(refDestructuringErrors)) {
|
|
2479
2581
|
return expr;
|
|
2480
2582
|
}
|
|
2481
|
-
if (this.eat(types$1.question)) {
|
|
2583
|
+
if (!(expr.type === "ArrowFunctionExpression" && expr.start === startPos) && this.eat(types$1.question)) {
|
|
2482
2584
|
var node = this.startNodeAt(startPos, startLoc);
|
|
2483
2585
|
node.test = expr;
|
|
2484
2586
|
node.consequent = this.parseMaybeAssign();
|
|
@@ -2573,7 +2675,7 @@ var init_acorn = __esm({
|
|
|
2573
2675
|
expr = this.finishNode(node$1, "UpdateExpression");
|
|
2574
2676
|
}
|
|
2575
2677
|
}
|
|
2576
|
-
if (!incDec && this.eat(types$1.starstar)) {
|
|
2678
|
+
if (!incDec && !(expr.type === "ArrowFunctionExpression" && expr.start === startPos) && this.eat(types$1.starstar)) {
|
|
2577
2679
|
if (sawUnary) {
|
|
2578
2680
|
this.unexpected(this.lastTokStart);
|
|
2579
2681
|
} else {
|
|
@@ -2585,20 +2687,35 @@ var init_acorn = __esm({
|
|
|
2585
2687
|
};
|
|
2586
2688
|
pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {
|
|
2587
2689
|
var startPos = this.start, startLoc = this.startLoc;
|
|
2690
|
+
var oldDoubleProto = -1, oldShorthandAssign = -1;
|
|
2691
|
+
if (refDestructuringErrors) {
|
|
2692
|
+
oldDoubleProto = refDestructuringErrors.doubleProto;
|
|
2693
|
+
oldShorthandAssign = refDestructuringErrors.shorthandAssign;
|
|
2694
|
+
refDestructuringErrors.doubleProto = refDestructuringErrors.shorthandAssign = -1;
|
|
2695
|
+
}
|
|
2588
2696
|
var expr = this.parseExprAtom(refDestructuringErrors, forInit);
|
|
2589
2697
|
if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") {
|
|
2590
2698
|
return expr;
|
|
2591
2699
|
}
|
|
2592
2700
|
var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit);
|
|
2593
|
-
if (refDestructuringErrors
|
|
2594
|
-
if (
|
|
2595
|
-
refDestructuringErrors
|
|
2701
|
+
if (refDestructuringErrors) {
|
|
2702
|
+
if (result.end > expr.end) {
|
|
2703
|
+
this.checkExpressionErrors(refDestructuringErrors, true);
|
|
2704
|
+
if (refDestructuringErrors.parenthesizedAssign >= result.start) {
|
|
2705
|
+
refDestructuringErrors.parenthesizedAssign = -1;
|
|
2706
|
+
}
|
|
2707
|
+
if (refDestructuringErrors.parenthesizedBind >= result.start) {
|
|
2708
|
+
refDestructuringErrors.parenthesizedBind = -1;
|
|
2709
|
+
}
|
|
2710
|
+
if (refDestructuringErrors.trailingComma >= result.start) {
|
|
2711
|
+
refDestructuringErrors.trailingComma = -1;
|
|
2712
|
+
}
|
|
2596
2713
|
}
|
|
2597
|
-
if (
|
|
2598
|
-
refDestructuringErrors.
|
|
2714
|
+
if (oldDoubleProto > -1) {
|
|
2715
|
+
refDestructuringErrors.doubleProto = oldDoubleProto;
|
|
2599
2716
|
}
|
|
2600
|
-
if (
|
|
2601
|
-
refDestructuringErrors.
|
|
2717
|
+
if (oldShorthandAssign > -1) {
|
|
2718
|
+
refDestructuringErrors.shorthandAssign = oldShorthandAssign;
|
|
2602
2719
|
}
|
|
2603
2720
|
}
|
|
2604
2721
|
return result;
|
|
@@ -2611,7 +2728,7 @@ var init_acorn = __esm({
|
|
|
2611
2728
|
if (element.optional) {
|
|
2612
2729
|
optionalChained = true;
|
|
2613
2730
|
}
|
|
2614
|
-
if (element === base2 || element.type === "ArrowFunctionExpression") {
|
|
2731
|
+
if (element.end === base2.end || element.type === "ArrowFunctionExpression") {
|
|
2615
2732
|
if (optionalChained) {
|
|
2616
2733
|
var chainNode = this.startNodeAt(startPos, startLoc);
|
|
2617
2734
|
chainNode.expression = element;
|
|
@@ -2620,6 +2737,7 @@ var init_acorn = __esm({
|
|
|
2620
2737
|
return element;
|
|
2621
2738
|
}
|
|
2622
2739
|
base2 = element;
|
|
2740
|
+
maybeAsyncArrow = false;
|
|
2623
2741
|
}
|
|
2624
2742
|
};
|
|
2625
2743
|
pp$5.shouldParseAsyncArrow = function() {
|
|
@@ -2971,6 +3089,9 @@ var init_acorn = __esm({
|
|
|
2971
3089
|
}
|
|
2972
3090
|
var startPos = this.start, startLoc = this.startLoc;
|
|
2973
3091
|
node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
|
|
3092
|
+
if (node.callee.type === "Super") {
|
|
3093
|
+
this.raiseRecoverable(startPos, "Invalid use of 'super'");
|
|
3094
|
+
}
|
|
2974
3095
|
if (this.eat(types$1.parenL)) {
|
|
2975
3096
|
node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false);
|
|
2976
3097
|
} else {
|
|
@@ -3238,8 +3359,8 @@ var init_acorn = __esm({
|
|
|
3238
3359
|
this.exitScope();
|
|
3239
3360
|
};
|
|
3240
3361
|
pp$5.isSimpleParamList = function(params) {
|
|
3241
|
-
for (var
|
|
3242
|
-
var param =
|
|
3362
|
+
for (var i2 = 0, list2 = params; i2 < list2.length; i2 += 1) {
|
|
3363
|
+
var param = list2[i2];
|
|
3243
3364
|
if (param.type !== "Identifier") {
|
|
3244
3365
|
return false;
|
|
3245
3366
|
}
|
|
@@ -3248,8 +3369,8 @@ var init_acorn = __esm({
|
|
|
3248
3369
|
};
|
|
3249
3370
|
pp$5.checkParams = function(node, allowDuplicates) {
|
|
3250
3371
|
var nameHash = /* @__PURE__ */ Object.create(null);
|
|
3251
|
-
for (var
|
|
3252
|
-
var param =
|
|
3372
|
+
for (var i2 = 0, list2 = node.params; i2 < list2.length; i2 += 1) {
|
|
3373
|
+
var param = list2[i2];
|
|
3253
3374
|
this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);
|
|
3254
3375
|
}
|
|
3255
3376
|
};
|
|
@@ -3434,8 +3555,8 @@ var init_acorn = __esm({
|
|
|
3434
3555
|
}
|
|
3435
3556
|
scope$2.functions.push(name);
|
|
3436
3557
|
} else {
|
|
3437
|
-
for (var
|
|
3438
|
-
var scope$3 = this.scopeStack[
|
|
3558
|
+
for (var i2 = this.scopeStack.length - 1; i2 >= 0; --i2) {
|
|
3559
|
+
var scope$3 = this.scopeStack[i2];
|
|
3439
3560
|
if (scope$3.lexical.indexOf(name) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH && scope$3.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {
|
|
3440
3561
|
redeclared = true;
|
|
3441
3562
|
break;
|
|
@@ -3462,16 +3583,16 @@ var init_acorn = __esm({
|
|
|
3462
3583
|
return this.scopeStack[this.scopeStack.length - 1];
|
|
3463
3584
|
};
|
|
3464
3585
|
pp$3.currentVarScope = function() {
|
|
3465
|
-
for (var
|
|
3466
|
-
var scope = this.scopeStack[
|
|
3586
|
+
for (var i2 = this.scopeStack.length - 1; ; i2--) {
|
|
3587
|
+
var scope = this.scopeStack[i2];
|
|
3467
3588
|
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK)) {
|
|
3468
3589
|
return scope;
|
|
3469
3590
|
}
|
|
3470
3591
|
}
|
|
3471
3592
|
};
|
|
3472
3593
|
pp$3.currentThisScope = function() {
|
|
3473
|
-
for (var
|
|
3474
|
-
var scope = this.scopeStack[
|
|
3594
|
+
for (var i2 = this.scopeStack.length - 1; ; i2--) {
|
|
3595
|
+
var scope = this.scopeStack[i2];
|
|
3475
3596
|
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK) && !(scope.flags & SCOPE_ARROW)) {
|
|
3476
3597
|
return scope;
|
|
3477
3598
|
}
|
|
@@ -3511,7 +3632,7 @@ var init_acorn = __esm({
|
|
|
3511
3632
|
}
|
|
3512
3633
|
return newNode;
|
|
3513
3634
|
};
|
|
3514
|
-
scriptValuesAddedInUnicode = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz";
|
|
3635
|
+
scriptValuesAddedInUnicode = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz";
|
|
3515
3636
|
ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
|
|
3516
3637
|
ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
|
|
3517
3638
|
ecma11BinaryProperties = ecma10BinaryProperties;
|
|
@@ -3612,32 +3733,32 @@ var init_acorn = __esm({
|
|
|
3612
3733
|
RegExpValidationState.prototype.raise = function raise(message) {
|
|
3613
3734
|
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + message);
|
|
3614
3735
|
};
|
|
3615
|
-
RegExpValidationState.prototype.at = function at(
|
|
3736
|
+
RegExpValidationState.prototype.at = function at(i2, forceU) {
|
|
3616
3737
|
if (forceU === void 0) forceU = false;
|
|
3617
3738
|
var s = this.source;
|
|
3618
3739
|
var l = s.length;
|
|
3619
|
-
if (
|
|
3740
|
+
if (i2 >= l) {
|
|
3620
3741
|
return -1;
|
|
3621
3742
|
}
|
|
3622
|
-
var c = s.charCodeAt(
|
|
3623
|
-
if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 ||
|
|
3743
|
+
var c = s.charCodeAt(i2);
|
|
3744
|
+
if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i2 + 1 >= l) {
|
|
3624
3745
|
return c;
|
|
3625
3746
|
}
|
|
3626
|
-
var next2 = s.charCodeAt(
|
|
3747
|
+
var next2 = s.charCodeAt(i2 + 1);
|
|
3627
3748
|
return next2 >= 56320 && next2 <= 57343 ? (c << 10) + next2 - 56613888 : c;
|
|
3628
3749
|
};
|
|
3629
|
-
RegExpValidationState.prototype.nextIndex = function nextIndex(
|
|
3750
|
+
RegExpValidationState.prototype.nextIndex = function nextIndex(i2, forceU) {
|
|
3630
3751
|
if (forceU === void 0) forceU = false;
|
|
3631
3752
|
var s = this.source;
|
|
3632
3753
|
var l = s.length;
|
|
3633
|
-
if (
|
|
3754
|
+
if (i2 >= l) {
|
|
3634
3755
|
return l;
|
|
3635
3756
|
}
|
|
3636
|
-
var c = s.charCodeAt(
|
|
3637
|
-
if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 ||
|
|
3638
|
-
return
|
|
3757
|
+
var c = s.charCodeAt(i2), next2;
|
|
3758
|
+
if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i2 + 1 >= l || (next2 = s.charCodeAt(i2 + 1)) < 56320 || next2 > 57343) {
|
|
3759
|
+
return i2 + 1;
|
|
3639
3760
|
}
|
|
3640
|
-
return
|
|
3761
|
+
return i2 + 2;
|
|
3641
3762
|
};
|
|
3642
3763
|
RegExpValidationState.prototype.current = function current(forceU) {
|
|
3643
3764
|
if (forceU === void 0) forceU = false;
|
|
@@ -3662,8 +3783,8 @@ var init_acorn = __esm({
|
|
|
3662
3783
|
RegExpValidationState.prototype.eatChars = function eatChars(chs, forceU) {
|
|
3663
3784
|
if (forceU === void 0) forceU = false;
|
|
3664
3785
|
var pos = this.pos;
|
|
3665
|
-
for (var
|
|
3666
|
-
var ch =
|
|
3786
|
+
for (var i2 = 0, list2 = chs; i2 < list2.length; i2 += 1) {
|
|
3787
|
+
var ch = list2[i2];
|
|
3667
3788
|
var current2 = this.at(pos, forceU);
|
|
3668
3789
|
if (current2 === -1 || current2 !== ch) {
|
|
3669
3790
|
return false;
|
|
@@ -3678,12 +3799,12 @@ var init_acorn = __esm({
|
|
|
3678
3799
|
var flags = state2.flags;
|
|
3679
3800
|
var u = false;
|
|
3680
3801
|
var v = false;
|
|
3681
|
-
for (var
|
|
3682
|
-
var flag = flags.charAt(
|
|
3802
|
+
for (var i2 = 0; i2 < flags.length; i2++) {
|
|
3803
|
+
var flag = flags.charAt(i2);
|
|
3683
3804
|
if (validFlags.indexOf(flag) === -1) {
|
|
3684
3805
|
this.raise(state2.start, "Invalid regular expression flag");
|
|
3685
3806
|
}
|
|
3686
|
-
if (flags.indexOf(flag,
|
|
3807
|
+
if (flags.indexOf(flag, i2 + 1) > -1) {
|
|
3687
3808
|
this.raise(state2.start, "Duplicate regular expression flag");
|
|
3688
3809
|
}
|
|
3689
3810
|
if (flag === "u") {
|
|
@@ -3735,8 +3856,8 @@ var init_acorn = __esm({
|
|
|
3735
3856
|
if (state2.maxBackReference > state2.numCapturingParens) {
|
|
3736
3857
|
state2.raise("Invalid escape");
|
|
3737
3858
|
}
|
|
3738
|
-
for (var
|
|
3739
|
-
var name =
|
|
3859
|
+
for (var i2 = 0, list2 = state2.backReferenceNames; i2 < list2.length; i2 += 1) {
|
|
3860
|
+
var name = list2[i2];
|
|
3740
3861
|
if (!state2.groupNames[name]) {
|
|
3741
3862
|
state2.raise("Invalid named capture referenced");
|
|
3742
3863
|
}
|
|
@@ -3942,9 +4063,9 @@ var init_acorn = __esm({
|
|
|
3942
4063
|
/* - */
|
|
3943
4064
|
);
|
|
3944
4065
|
if (addModifiers || hasHyphen) {
|
|
3945
|
-
for (var
|
|
3946
|
-
var modifier = addModifiers.charAt(
|
|
3947
|
-
if (addModifiers.indexOf(modifier,
|
|
4066
|
+
for (var i2 = 0; i2 < addModifiers.length; i2++) {
|
|
4067
|
+
var modifier = addModifiers.charAt(i2);
|
|
4068
|
+
if (addModifiers.indexOf(modifier, i2 + 1) > -1) {
|
|
3948
4069
|
state2.raise("Duplicate regular expression modifiers");
|
|
3949
4070
|
}
|
|
3950
4071
|
}
|
|
@@ -4060,8 +4181,8 @@ var init_acorn = __esm({
|
|
|
4060
4181
|
var known = state2.groupNames[state2.lastStringValue];
|
|
4061
4182
|
if (known) {
|
|
4062
4183
|
if (trackDisjunction) {
|
|
4063
|
-
for (var
|
|
4064
|
-
var altID =
|
|
4184
|
+
for (var i2 = 0, list2 = known; i2 < list2.length; i2 += 1) {
|
|
4185
|
+
var altID = list2[i2];
|
|
4065
4186
|
if (!altID.separatedFrom(state2.branchID)) {
|
|
4066
4187
|
state2.raise("Duplicate capture group name");
|
|
4067
4188
|
}
|
|
@@ -4776,7 +4897,7 @@ var init_acorn = __esm({
|
|
|
4776
4897
|
pp$1.regexp_eatFixedHexDigits = function(state2, length) {
|
|
4777
4898
|
var start = state2.pos;
|
|
4778
4899
|
state2.lastIntValue = 0;
|
|
4779
|
-
for (var
|
|
4900
|
+
for (var i2 = 0; i2 < length; ++i2) {
|
|
4780
4901
|
var ch = state2.current();
|
|
4781
4902
|
if (!isHexDigit(ch)) {
|
|
4782
4903
|
state2.pos = start;
|
|
@@ -4855,14 +4976,17 @@ var init_acorn = __esm({
|
|
|
4855
4976
|
}
|
|
4856
4977
|
return this.getTokenFromCode(code);
|
|
4857
4978
|
};
|
|
4858
|
-
pp.
|
|
4859
|
-
var code = this.input.charCodeAt(
|
|
4979
|
+
pp.fullCharCodeAt = function(pos) {
|
|
4980
|
+
var code = this.input.charCodeAt(pos);
|
|
4860
4981
|
if (code <= 55295 || code >= 56320) {
|
|
4861
4982
|
return code;
|
|
4862
4983
|
}
|
|
4863
|
-
var next2 = this.input.charCodeAt(
|
|
4984
|
+
var next2 = this.input.charCodeAt(pos + 1);
|
|
4864
4985
|
return next2 <= 56319 || next2 >= 57344 ? code : (code << 10) + next2 - 56613888;
|
|
4865
4986
|
};
|
|
4987
|
+
pp.fullCharCodeAtPos = function() {
|
|
4988
|
+
return this.fullCharCodeAt(this.pos);
|
|
4989
|
+
};
|
|
4866
4990
|
pp.skipBlockComment = function() {
|
|
4867
4991
|
var startLoc = this.options.onComment && this.curPosition();
|
|
4868
4992
|
var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
|
|
@@ -5066,8 +5190,8 @@ var init_acorn = __esm({
|
|
|
5066
5190
|
return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1);
|
|
5067
5191
|
};
|
|
5068
5192
|
pp.readToken_question = function() {
|
|
5069
|
-
var
|
|
5070
|
-
if (
|
|
5193
|
+
var ecmaVersion2 = this.options.ecmaVersion;
|
|
5194
|
+
if (ecmaVersion2 >= 11) {
|
|
5071
5195
|
var next2 = this.input.charCodeAt(this.pos + 1);
|
|
5072
5196
|
if (next2 === 46) {
|
|
5073
5197
|
var next22 = this.input.charCodeAt(this.pos + 2);
|
|
@@ -5076,7 +5200,7 @@ var init_acorn = __esm({
|
|
|
5076
5200
|
}
|
|
5077
5201
|
}
|
|
5078
5202
|
if (next2 === 63) {
|
|
5079
|
-
if (
|
|
5203
|
+
if (ecmaVersion2 >= 12) {
|
|
5080
5204
|
var next2$1 = this.input.charCodeAt(this.pos + 2);
|
|
5081
5205
|
if (next2$1 === 61) {
|
|
5082
5206
|
return this.finishOp(types$1.assign, 3);
|
|
@@ -5088,9 +5212,9 @@ var init_acorn = __esm({
|
|
|
5088
5212
|
return this.finishOp(types$1.question, 1);
|
|
5089
5213
|
};
|
|
5090
5214
|
pp.readToken_numberSign = function() {
|
|
5091
|
-
var
|
|
5215
|
+
var ecmaVersion2 = this.options.ecmaVersion;
|
|
5092
5216
|
var code = 35;
|
|
5093
|
-
if (
|
|
5217
|
+
if (ecmaVersion2 >= 13) {
|
|
5094
5218
|
++this.pos;
|
|
5095
5219
|
code = this.fullCharCodeAtPos();
|
|
5096
5220
|
if (isIdentifierStart(code, true) || code === 92) {
|
|
@@ -5251,7 +5375,7 @@ var init_acorn = __esm({
|
|
|
5251
5375
|
var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0;
|
|
5252
5376
|
var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48;
|
|
5253
5377
|
var start = this.pos, total = 0, lastCode = 0;
|
|
5254
|
-
for (var
|
|
5378
|
+
for (var i2 = 0, e = len == null ? Infinity : len; i2 < e; ++i2, ++this.pos) {
|
|
5255
5379
|
var code = this.input.charCodeAt(this.pos), val = void 0;
|
|
5256
5380
|
if (allowSeparators && code === 95) {
|
|
5257
5381
|
if (isLegacyOctalNumericLiteral) {
|
|
@@ -5260,7 +5384,7 @@ var init_acorn = __esm({
|
|
|
5260
5384
|
if (lastCode === 95) {
|
|
5261
5385
|
this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore");
|
|
5262
5386
|
}
|
|
5263
|
-
if (
|
|
5387
|
+
if (i2 === 0) {
|
|
5264
5388
|
this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits");
|
|
5265
5389
|
}
|
|
5266
5390
|
lastCode = code;
|
|
@@ -5620,7 +5744,7 @@ var init_acorn = __esm({
|
|
|
5620
5744
|
}
|
|
5621
5745
|
return this.finishToken(type, word);
|
|
5622
5746
|
};
|
|
5623
|
-
version = "8.
|
|
5747
|
+
version = "8.19.0";
|
|
5624
5748
|
Parser.acorn = {
|
|
5625
5749
|
Parser,
|
|
5626
5750
|
version,
|
|
@@ -5659,7 +5783,7 @@ function full(node, callback, baseVisitor, state2, override) {
|
|
|
5659
5783
|
var last;
|
|
5660
5784
|
(function c(node2, st, override2) {
|
|
5661
5785
|
var type = override2 || node2.type;
|
|
5662
|
-
baseVisitor
|
|
5786
|
+
visitNode(baseVisitor, type, node2, st, c);
|
|
5663
5787
|
if (last !== node2) {
|
|
5664
5788
|
callback(node2, st, type);
|
|
5665
5789
|
last = node2;
|
|
@@ -5678,13 +5802,19 @@ function skipThrough(node, st, c) {
|
|
|
5678
5802
|
}
|
|
5679
5803
|
function ignore(_node, _st, _c) {
|
|
5680
5804
|
}
|
|
5805
|
+
function visitNode(baseVisitor, type, node, st, c) {
|
|
5806
|
+
if (baseVisitor[type] == null) {
|
|
5807
|
+
throw new Error("No walker function defined for node type " + type);
|
|
5808
|
+
}
|
|
5809
|
+
baseVisitor[type](node, st, c);
|
|
5810
|
+
}
|
|
5681
5811
|
var base;
|
|
5682
5812
|
var init_walk = __esm({
|
|
5683
5813
|
"node_modules/acorn-walk/dist/walk.mjs"() {
|
|
5684
5814
|
base = {};
|
|
5685
5815
|
base.Program = base.BlockStatement = base.StaticBlock = function(node, st, c) {
|
|
5686
|
-
for (var
|
|
5687
|
-
var stmt =
|
|
5816
|
+
for (var i2 = 0, list2 = node.body; i2 < list2.length; i2 += 1) {
|
|
5817
|
+
var stmt = list2[i2];
|
|
5688
5818
|
c(stmt, st, "Statement");
|
|
5689
5819
|
}
|
|
5690
5820
|
};
|
|
@@ -5710,8 +5840,8 @@ var init_walk = __esm({
|
|
|
5710
5840
|
};
|
|
5711
5841
|
base.SwitchStatement = function(node, st, c) {
|
|
5712
5842
|
c(node.discriminant, st, "Expression");
|
|
5713
|
-
for (var
|
|
5714
|
-
var cs =
|
|
5843
|
+
for (var i2 = 0, list2 = node.cases; i2 < list2.length; i2 += 1) {
|
|
5844
|
+
var cs = list2[i2];
|
|
5715
5845
|
c(cs, st);
|
|
5716
5846
|
}
|
|
5717
5847
|
};
|
|
@@ -5719,8 +5849,8 @@ var init_walk = __esm({
|
|
|
5719
5849
|
if (node.test) {
|
|
5720
5850
|
c(node.test, st, "Expression");
|
|
5721
5851
|
}
|
|
5722
|
-
for (var
|
|
5723
|
-
var cons =
|
|
5852
|
+
for (var i2 = 0, list2 = node.consequent; i2 < list2.length; i2 += 1) {
|
|
5853
|
+
var cons = list2[i2];
|
|
5724
5854
|
c(cons, st, "Statement");
|
|
5725
5855
|
}
|
|
5726
5856
|
};
|
|
@@ -5780,8 +5910,8 @@ var init_walk = __esm({
|
|
|
5780
5910
|
return c(node, st, "Function");
|
|
5781
5911
|
};
|
|
5782
5912
|
base.VariableDeclaration = function(node, st, c) {
|
|
5783
|
-
for (var
|
|
5784
|
-
var decl =
|
|
5913
|
+
for (var i2 = 0, list2 = node.declarations; i2 < list2.length; i2 += 1) {
|
|
5914
|
+
var decl = list2[i2];
|
|
5785
5915
|
c(decl, st);
|
|
5786
5916
|
}
|
|
5787
5917
|
};
|
|
@@ -5795,8 +5925,8 @@ var init_walk = __esm({
|
|
|
5795
5925
|
if (node.id) {
|
|
5796
5926
|
c(node.id, st, "Pattern");
|
|
5797
5927
|
}
|
|
5798
|
-
for (var
|
|
5799
|
-
var param =
|
|
5928
|
+
for (var i2 = 0, list2 = node.params; i2 < list2.length; i2 += 1) {
|
|
5929
|
+
var param = list2[i2];
|
|
5800
5930
|
c(param, st, "Pattern");
|
|
5801
5931
|
}
|
|
5802
5932
|
c(node.body, st, node.expression ? "Expression" : "Statement");
|
|
@@ -5816,16 +5946,16 @@ var init_walk = __esm({
|
|
|
5816
5946
|
return c(node.argument, st, "Pattern");
|
|
5817
5947
|
};
|
|
5818
5948
|
base.ArrayPattern = function(node, st, c) {
|
|
5819
|
-
for (var
|
|
5820
|
-
var elt =
|
|
5949
|
+
for (var i2 = 0, list2 = node.elements; i2 < list2.length; i2 += 1) {
|
|
5950
|
+
var elt = list2[i2];
|
|
5821
5951
|
if (elt) {
|
|
5822
5952
|
c(elt, st, "Pattern");
|
|
5823
5953
|
}
|
|
5824
5954
|
}
|
|
5825
5955
|
};
|
|
5826
5956
|
base.ObjectPattern = function(node, st, c) {
|
|
5827
|
-
for (var
|
|
5828
|
-
var prop =
|
|
5957
|
+
for (var i2 = 0, list2 = node.properties; i2 < list2.length; i2 += 1) {
|
|
5958
|
+
var prop = list2[i2];
|
|
5829
5959
|
if (prop.type === "Property") {
|
|
5830
5960
|
if (prop.computed) {
|
|
5831
5961
|
c(prop.key, st, "Expression");
|
|
@@ -5839,29 +5969,29 @@ var init_walk = __esm({
|
|
|
5839
5969
|
base.Expression = skipThrough;
|
|
5840
5970
|
base.ThisExpression = base.Super = base.MetaProperty = ignore;
|
|
5841
5971
|
base.ArrayExpression = function(node, st, c) {
|
|
5842
|
-
for (var
|
|
5843
|
-
var elt =
|
|
5972
|
+
for (var i2 = 0, list2 = node.elements; i2 < list2.length; i2 += 1) {
|
|
5973
|
+
var elt = list2[i2];
|
|
5844
5974
|
if (elt) {
|
|
5845
5975
|
c(elt, st, "Expression");
|
|
5846
5976
|
}
|
|
5847
5977
|
}
|
|
5848
5978
|
};
|
|
5849
5979
|
base.ObjectExpression = function(node, st, c) {
|
|
5850
|
-
for (var
|
|
5851
|
-
var prop =
|
|
5980
|
+
for (var i2 = 0, list2 = node.properties; i2 < list2.length; i2 += 1) {
|
|
5981
|
+
var prop = list2[i2];
|
|
5852
5982
|
c(prop, st);
|
|
5853
5983
|
}
|
|
5854
5984
|
};
|
|
5855
5985
|
base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;
|
|
5856
5986
|
base.SequenceExpression = function(node, st, c) {
|
|
5857
|
-
for (var
|
|
5858
|
-
var expr =
|
|
5987
|
+
for (var i2 = 0, list2 = node.expressions; i2 < list2.length; i2 += 1) {
|
|
5988
|
+
var expr = list2[i2];
|
|
5859
5989
|
c(expr, st, "Expression");
|
|
5860
5990
|
}
|
|
5861
5991
|
};
|
|
5862
5992
|
base.TemplateLiteral = function(node, st, c) {
|
|
5863
|
-
for (var
|
|
5864
|
-
var quasi =
|
|
5993
|
+
for (var i2 = 0, list2 = node.quasis; i2 < list2.length; i2 += 1) {
|
|
5994
|
+
var quasi = list2[i2];
|
|
5865
5995
|
c(quasi, st);
|
|
5866
5996
|
}
|
|
5867
5997
|
for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1) {
|
|
@@ -5889,8 +6019,8 @@ var init_walk = __esm({
|
|
|
5889
6019
|
base.NewExpression = base.CallExpression = function(node, st, c) {
|
|
5890
6020
|
c(node.callee, st, "Expression");
|
|
5891
6021
|
if (node.arguments) {
|
|
5892
|
-
for (var
|
|
5893
|
-
var arg =
|
|
6022
|
+
for (var i2 = 0, list2 = node.arguments; i2 < list2.length; i2 += 1) {
|
|
6023
|
+
var arg = list2[i2];
|
|
5894
6024
|
c(arg, st, "Expression");
|
|
5895
6025
|
}
|
|
5896
6026
|
}
|
|
@@ -5908,22 +6038,46 @@ var init_walk = __esm({
|
|
|
5908
6038
|
if (node.source) {
|
|
5909
6039
|
c(node.source, st, "Expression");
|
|
5910
6040
|
}
|
|
6041
|
+
if (node.attributes) {
|
|
6042
|
+
for (var i2 = 0, list2 = node.attributes; i2 < list2.length; i2 += 1) {
|
|
6043
|
+
var attr = list2[i2];
|
|
6044
|
+
c(attr, st);
|
|
6045
|
+
}
|
|
6046
|
+
}
|
|
5911
6047
|
};
|
|
5912
6048
|
base.ExportAllDeclaration = function(node, st, c) {
|
|
5913
6049
|
if (node.exported) {
|
|
5914
6050
|
c(node.exported, st);
|
|
5915
6051
|
}
|
|
5916
6052
|
c(node.source, st, "Expression");
|
|
6053
|
+
if (node.attributes) {
|
|
6054
|
+
for (var i2 = 0, list2 = node.attributes; i2 < list2.length; i2 += 1) {
|
|
6055
|
+
var attr = list2[i2];
|
|
6056
|
+
c(attr, st);
|
|
6057
|
+
}
|
|
6058
|
+
}
|
|
6059
|
+
};
|
|
6060
|
+
base.ImportAttribute = function(node, st, c) {
|
|
6061
|
+
c(node.value, st, "Expression");
|
|
5917
6062
|
};
|
|
5918
6063
|
base.ImportDeclaration = function(node, st, c) {
|
|
5919
|
-
for (var
|
|
5920
|
-
var spec =
|
|
6064
|
+
for (var i2 = 0, list2 = node.specifiers; i2 < list2.length; i2 += 1) {
|
|
6065
|
+
var spec = list2[i2];
|
|
5921
6066
|
c(spec, st);
|
|
5922
6067
|
}
|
|
5923
6068
|
c(node.source, st, "Expression");
|
|
6069
|
+
if (node.attributes) {
|
|
6070
|
+
for (var i$1 = 0, list$1 = node.attributes; i$1 < list$1.length; i$1 += 1) {
|
|
6071
|
+
var attr = list$1[i$1];
|
|
6072
|
+
c(attr, st);
|
|
6073
|
+
}
|
|
6074
|
+
}
|
|
5924
6075
|
};
|
|
5925
6076
|
base.ImportExpression = function(node, st, c) {
|
|
5926
6077
|
c(node.source, st, "Expression");
|
|
6078
|
+
if (node.options) {
|
|
6079
|
+
c(node.options, st, "Expression");
|
|
6080
|
+
}
|
|
5927
6081
|
};
|
|
5928
6082
|
base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.PrivateIdentifier = base.Literal = ignore;
|
|
5929
6083
|
base.TaggedTemplateExpression = function(node, st, c) {
|
|
@@ -5943,8 +6097,8 @@ var init_walk = __esm({
|
|
|
5943
6097
|
c(node.body, st);
|
|
5944
6098
|
};
|
|
5945
6099
|
base.ClassBody = function(node, st, c) {
|
|
5946
|
-
for (var
|
|
5947
|
-
var elt =
|
|
6100
|
+
for (var i2 = 0, list2 = node.body; i2 < list2.length; i2 += 1) {
|
|
6101
|
+
var elt = list2[i2];
|
|
5948
6102
|
c(elt, st);
|
|
5949
6103
|
}
|
|
5950
6104
|
};
|
|
@@ -6000,7 +6154,7 @@ var init_sourcemap = __esm({
|
|
|
6000
6154
|
"src/sourcemap.ts"() {
|
|
6001
6155
|
"use strict";
|
|
6002
6156
|
BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
6003
|
-
DIGIT = new Map([...BASE64].map((c,
|
|
6157
|
+
DIGIT = new Map([...BASE64].map((c, i2) => [c, i2]));
|
|
6004
6158
|
LineMap = class {
|
|
6005
6159
|
#toOriginal;
|
|
6006
6160
|
#toGenerated = /* @__PURE__ */ new Map();
|
|
@@ -6983,8 +7137,8 @@ function augmentError(error) {
|
|
|
6983
7137
|
function locationForIndex(pos) {
|
|
6984
7138
|
let line = 1;
|
|
6985
7139
|
let column = 1;
|
|
6986
|
-
for (let
|
|
6987
|
-
if (input.charCodeAt(
|
|
7140
|
+
for (let i2 = 0; i2 < pos; i2++) {
|
|
7141
|
+
if (input.charCodeAt(i2) === charCodes.lineFeed) {
|
|
6988
7142
|
line++;
|
|
6989
7143
|
column = 1;
|
|
6990
7144
|
} else {
|
|
@@ -7037,8 +7191,8 @@ function canInsertSemicolon() {
|
|
|
7037
7191
|
function hasPrecedingLineBreak() {
|
|
7038
7192
|
const prevToken = state.tokens[state.tokens.length - 1];
|
|
7039
7193
|
const lastTokEnd = prevToken ? prevToken.end : 0;
|
|
7040
|
-
for (let
|
|
7041
|
-
const code = input.charCodeAt(
|
|
7194
|
+
for (let i2 = lastTokEnd; i2 < state.start; i2++) {
|
|
7195
|
+
const code = input.charCodeAt(i2);
|
|
7042
7196
|
if (code === charCodes.lineFeed || code === charCodes.carriageReturn || code === 8232 || code === 8233) {
|
|
7043
7197
|
return true;
|
|
7044
7198
|
}
|
|
@@ -7047,8 +7201,8 @@ function hasPrecedingLineBreak() {
|
|
|
7047
7201
|
}
|
|
7048
7202
|
function hasFollowingLineBreak() {
|
|
7049
7203
|
const nextStart = nextTokenStart();
|
|
7050
|
-
for (let
|
|
7051
|
-
const code = input.charCodeAt(
|
|
7204
|
+
for (let i2 = state.end; i2 < nextStart; i2++) {
|
|
7205
|
+
const code = input.charCodeAt(i2);
|
|
7052
7206
|
if (code === charCodes.lineFeed || code === charCodes.carriageReturn || code === 8232 || code === 8233) {
|
|
7053
7207
|
return true;
|
|
7054
7208
|
}
|
|
@@ -7156,11 +7310,11 @@ var init_identifier = __esm({
|
|
|
7156
7310
|
init_charcodes();
|
|
7157
7311
|
init_whitespace();
|
|
7158
7312
|
IS_IDENTIFIER_CHAR = new Uint8Array(65536);
|
|
7159
|
-
for (let
|
|
7160
|
-
IS_IDENTIFIER_CHAR[
|
|
7313
|
+
for (let i2 = 0; i2 < 128; i2++) {
|
|
7314
|
+
IS_IDENTIFIER_CHAR[i2] = computeIsIdentifierChar(i2) ? 1 : 0;
|
|
7161
7315
|
}
|
|
7162
|
-
for (let
|
|
7163
|
-
IS_IDENTIFIER_CHAR[
|
|
7316
|
+
for (let i2 = 128; i2 < 65536; i2++) {
|
|
7317
|
+
IS_IDENTIFIER_CHAR[i2] = 1;
|
|
7164
7318
|
}
|
|
7165
7319
|
for (const whitespaceChar of WHITESPACE_CHARS) {
|
|
7166
7320
|
IS_IDENTIFIER_CHAR[whitespaceChar] = 0;
|
|
@@ -16581,8 +16735,8 @@ function retokenizeSlashAsRegex() {
|
|
|
16581
16735
|
readRegexp();
|
|
16582
16736
|
}
|
|
16583
16737
|
function pushTypeContext(existingTokensInType) {
|
|
16584
|
-
for (let
|
|
16585
|
-
state.tokens[
|
|
16738
|
+
for (let i2 = state.tokens.length - existingTokensInType; i2 < state.tokens.length; i2++) {
|
|
16739
|
+
state.tokens[i2].isType = true;
|
|
16586
16740
|
}
|
|
16587
16741
|
const oldIsType = state.isType;
|
|
16588
16742
|
state.isType = true;
|
|
@@ -17620,8 +17774,8 @@ function formatJSXTextLiteral(text) {
|
|
|
17620
17774
|
let whitespace = "";
|
|
17621
17775
|
let isInInitialLineWhitespace = false;
|
|
17622
17776
|
let seenNonWhitespace = false;
|
|
17623
|
-
for (let
|
|
17624
|
-
const c = text[
|
|
17777
|
+
for (let i2 = 0; i2 < text.length; i2++) {
|
|
17778
|
+
const c = text[i2];
|
|
17625
17779
|
if (c === " " || c === " " || c === "\r") {
|
|
17626
17780
|
if (!isInInitialLineWhitespace) {
|
|
17627
17781
|
whitespace += c;
|
|
@@ -17636,8 +17790,8 @@ function formatJSXTextLiteral(text) {
|
|
|
17636
17790
|
result += whitespace;
|
|
17637
17791
|
whitespace = "";
|
|
17638
17792
|
if (c === "&") {
|
|
17639
|
-
const { entity, newI } = processEntity(text,
|
|
17640
|
-
|
|
17793
|
+
const { entity, newI } = processEntity(text, i2 + 1);
|
|
17794
|
+
i2 = newI - 1;
|
|
17641
17795
|
result += entity;
|
|
17642
17796
|
} else {
|
|
17643
17797
|
result += c;
|
|
@@ -17666,21 +17820,21 @@ function formatJSXTextReplacement(text) {
|
|
|
17666
17820
|
}
|
|
17667
17821
|
function formatJSXStringValueLiteral(text) {
|
|
17668
17822
|
let result = "";
|
|
17669
|
-
for (let
|
|
17670
|
-
const c = text[
|
|
17823
|
+
for (let i2 = 0; i2 < text.length; i2++) {
|
|
17824
|
+
const c = text[i2];
|
|
17671
17825
|
if (c === "\n") {
|
|
17672
|
-
if (/\s/.test(text[
|
|
17826
|
+
if (/\s/.test(text[i2 + 1])) {
|
|
17673
17827
|
result += " ";
|
|
17674
|
-
while (
|
|
17675
|
-
|
|
17828
|
+
while (i2 < text.length && /\s/.test(text[i2 + 1])) {
|
|
17829
|
+
i2++;
|
|
17676
17830
|
}
|
|
17677
17831
|
} else {
|
|
17678
17832
|
result += "\n";
|
|
17679
17833
|
}
|
|
17680
17834
|
} else if (c === "&") {
|
|
17681
|
-
const { entity, newI } = processEntity(text,
|
|
17835
|
+
const { entity, newI } = processEntity(text, i2 + 1);
|
|
17682
17836
|
result += entity;
|
|
17683
|
-
|
|
17837
|
+
i2 = newI - 1;
|
|
17684
17838
|
} else {
|
|
17685
17839
|
result += c;
|
|
17686
17840
|
}
|
|
@@ -17691,35 +17845,35 @@ function processEntity(text, indexAfterAmpersand) {
|
|
|
17691
17845
|
let str = "";
|
|
17692
17846
|
let count = 0;
|
|
17693
17847
|
let entity;
|
|
17694
|
-
let
|
|
17695
|
-
if (text[
|
|
17848
|
+
let i2 = indexAfterAmpersand;
|
|
17849
|
+
if (text[i2] === "#") {
|
|
17696
17850
|
let radix = 10;
|
|
17697
|
-
|
|
17851
|
+
i2++;
|
|
17698
17852
|
let numStart;
|
|
17699
|
-
if (text[
|
|
17853
|
+
if (text[i2] === "x") {
|
|
17700
17854
|
radix = 16;
|
|
17701
|
-
|
|
17702
|
-
numStart =
|
|
17703
|
-
while (
|
|
17704
|
-
|
|
17855
|
+
i2++;
|
|
17856
|
+
numStart = i2;
|
|
17857
|
+
while (i2 < text.length && isHexDigit2(text.charCodeAt(i2))) {
|
|
17858
|
+
i2++;
|
|
17705
17859
|
}
|
|
17706
17860
|
} else {
|
|
17707
|
-
numStart =
|
|
17708
|
-
while (
|
|
17709
|
-
|
|
17861
|
+
numStart = i2;
|
|
17862
|
+
while (i2 < text.length && isDecimalDigit2(text.charCodeAt(i2))) {
|
|
17863
|
+
i2++;
|
|
17710
17864
|
}
|
|
17711
17865
|
}
|
|
17712
|
-
if (text[
|
|
17713
|
-
const numStr = text.slice(numStart,
|
|
17866
|
+
if (text[i2] === ";") {
|
|
17867
|
+
const numStr = text.slice(numStart, i2);
|
|
17714
17868
|
if (numStr) {
|
|
17715
|
-
|
|
17869
|
+
i2++;
|
|
17716
17870
|
entity = String.fromCodePoint(parseInt(numStr, radix));
|
|
17717
17871
|
}
|
|
17718
17872
|
}
|
|
17719
17873
|
} else {
|
|
17720
|
-
while (
|
|
17721
|
-
const ch = text[
|
|
17722
|
-
|
|
17874
|
+
while (i2 < text.length && count++ < 10) {
|
|
17875
|
+
const ch = text[i2];
|
|
17876
|
+
i2++;
|
|
17723
17877
|
if (ch === ";") {
|
|
17724
17878
|
entity = xhtml_default.get(str);
|
|
17725
17879
|
break;
|
|
@@ -17730,7 +17884,7 @@ function processEntity(text, indexAfterAmpersand) {
|
|
|
17730
17884
|
if (!entity) {
|
|
17731
17885
|
return { entity: "&", newI: indexAfterAmpersand };
|
|
17732
17886
|
}
|
|
17733
|
-
return { entity, newI:
|
|
17887
|
+
return { entity, newI: i2 };
|
|
17734
17888
|
}
|
|
17735
17889
|
function isDecimalDigit2(code) {
|
|
17736
17890
|
return code >= charCodes.digit0 && code <= charCodes.digit9;
|
|
@@ -18206,21 +18360,21 @@ var init_JSXTransformer = __esm({
|
|
|
18206
18360
|
function getNonTypeIdentifiers(tokens, options) {
|
|
18207
18361
|
const jsxPragmaInfo = getJSXPragmaInfo(options);
|
|
18208
18362
|
const nonTypeIdentifiers = /* @__PURE__ */ new Set();
|
|
18209
|
-
for (let
|
|
18210
|
-
const token = tokens.tokens[
|
|
18363
|
+
for (let i2 = 0; i2 < tokens.tokens.length; i2++) {
|
|
18364
|
+
const token = tokens.tokens[i2];
|
|
18211
18365
|
if (token.type === TokenType3.name && !token.isType && (token.identifierRole === IdentifierRole.Access || token.identifierRole === IdentifierRole.ObjectShorthand || token.identifierRole === IdentifierRole.ExportAccess) && !token.shadowsGlobal) {
|
|
18212
18366
|
nonTypeIdentifiers.add(tokens.identifierNameForToken(token));
|
|
18213
18367
|
}
|
|
18214
18368
|
if (token.type === TokenType3.jsxTagStart) {
|
|
18215
18369
|
nonTypeIdentifiers.add(jsxPragmaInfo.base);
|
|
18216
18370
|
}
|
|
18217
|
-
if (token.type === TokenType3.jsxTagStart &&
|
|
18371
|
+
if (token.type === TokenType3.jsxTagStart && i2 + 1 < tokens.tokens.length && tokens.tokens[i2 + 1].type === TokenType3.jsxTagEnd) {
|
|
18218
18372
|
nonTypeIdentifiers.add(jsxPragmaInfo.base);
|
|
18219
18373
|
nonTypeIdentifiers.add(jsxPragmaInfo.fragmentBase);
|
|
18220
18374
|
}
|
|
18221
18375
|
if (token.type === TokenType3.jsxName && token.identifierRole === IdentifierRole.Access) {
|
|
18222
18376
|
const identifierName = tokens.identifierNameForToken(token);
|
|
18223
|
-
if (!startsWithLowerCase(identifierName) || tokens.tokens[
|
|
18377
|
+
if (!startsWithLowerCase(identifierName) || tokens.tokens[i2 + 1].type === TokenType3.dot) {
|
|
18224
18378
|
nonTypeIdentifiers.add(tokens.identifierNameForToken(token));
|
|
18225
18379
|
}
|
|
18226
18380
|
}
|
|
@@ -18277,12 +18431,12 @@ var init_CJSImportProcessor = __esm({
|
|
|
18277
18431
|
_CJSImportProcessor.prototype.__init5.call(this);
|
|
18278
18432
|
}
|
|
18279
18433
|
preprocessTokens() {
|
|
18280
|
-
for (let
|
|
18281
|
-
if (this.tokens.matches1AtIndex(
|
|
18282
|
-
this.preprocessImportAtIndex(
|
|
18434
|
+
for (let i2 = 0; i2 < this.tokens.tokens.length; i2++) {
|
|
18435
|
+
if (this.tokens.matches1AtIndex(i2, TokenType3._import) && !this.tokens.matches3AtIndex(i2, TokenType3._import, TokenType3.name, TokenType3.eq)) {
|
|
18436
|
+
this.preprocessImportAtIndex(i2);
|
|
18283
18437
|
}
|
|
18284
|
-
if (this.tokens.matches1AtIndex(
|
|
18285
|
-
this.preprocessExportAtIndex(
|
|
18438
|
+
if (this.tokens.matches1AtIndex(i2, TokenType3._export) && !this.tokens.matches2AtIndex(i2, TokenType3._export, TokenType3.eq)) {
|
|
18439
|
+
this.preprocessExportAtIndex(i2);
|
|
18286
18440
|
}
|
|
18287
18441
|
}
|
|
18288
18442
|
this.generateImportReplacements();
|
|
@@ -18440,23 +18594,23 @@ var init_CJSImportProcessor = __esm({
|
|
|
18440
18594
|
}
|
|
18441
18595
|
preprocessVarExportAtIndex(index) {
|
|
18442
18596
|
let depth = 0;
|
|
18443
|
-
for (let
|
|
18444
|
-
if (this.tokens.matches1AtIndex(
|
|
18597
|
+
for (let i2 = index + 2; ; i2++) {
|
|
18598
|
+
if (this.tokens.matches1AtIndex(i2, TokenType3.braceL) || this.tokens.matches1AtIndex(i2, TokenType3.dollarBraceL) || this.tokens.matches1AtIndex(i2, TokenType3.bracketL)) {
|
|
18445
18599
|
depth++;
|
|
18446
|
-
} else if (this.tokens.matches1AtIndex(
|
|
18600
|
+
} else if (this.tokens.matches1AtIndex(i2, TokenType3.braceR) || this.tokens.matches1AtIndex(i2, TokenType3.bracketR)) {
|
|
18447
18601
|
depth--;
|
|
18448
|
-
} else if (depth === 0 && !this.tokens.matches1AtIndex(
|
|
18602
|
+
} else if (depth === 0 && !this.tokens.matches1AtIndex(i2, TokenType3.name)) {
|
|
18449
18603
|
break;
|
|
18450
18604
|
} else if (this.tokens.matches1AtIndex(1, TokenType3.eq)) {
|
|
18451
18605
|
const endIndex = this.tokens.currentToken().rhsEndIndex;
|
|
18452
18606
|
if (endIndex == null) {
|
|
18453
18607
|
throw new Error("Expected = token with an end index.");
|
|
18454
18608
|
}
|
|
18455
|
-
|
|
18609
|
+
i2 = endIndex - 1;
|
|
18456
18610
|
} else {
|
|
18457
|
-
const token = this.tokens.tokens[
|
|
18611
|
+
const token = this.tokens.tokens[i2];
|
|
18458
18612
|
if (isDeclaration(token)) {
|
|
18459
|
-
const exportName = this.tokens.identifierNameAtIndex(
|
|
18613
|
+
const exportName = this.tokens.identifierNameAtIndex(i2);
|
|
18460
18614
|
this.identifierReplacements.set(exportName, `exports.${exportName}`);
|
|
18461
18615
|
}
|
|
18462
18616
|
}
|
|
@@ -18616,9 +18770,9 @@ function encode(decoded) {
|
|
|
18616
18770
|
let sourceLine = 0;
|
|
18617
18771
|
let sourceColumn = 0;
|
|
18618
18772
|
let namesIndex = 0;
|
|
18619
|
-
for (let
|
|
18620
|
-
const line = decoded[
|
|
18621
|
-
if (
|
|
18773
|
+
for (let i2 = 0; i2 < decoded.length; i2++) {
|
|
18774
|
+
const line = decoded[i2];
|
|
18775
|
+
if (i2 > 0) writer.write(semicolon2);
|
|
18622
18776
|
if (line.length === 0) continue;
|
|
18623
18777
|
let genColumn = 0;
|
|
18624
18778
|
for (let j = 0; j < line.length; j++) {
|
|
@@ -18648,10 +18802,10 @@ var init_sourcemap_codec = __esm({
|
|
|
18648
18802
|
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
18649
18803
|
intToChar = new Uint8Array(64);
|
|
18650
18804
|
charToInt = new Uint8Array(128);
|
|
18651
|
-
for (let
|
|
18652
|
-
const c = chars.charCodeAt(
|
|
18653
|
-
intToChar[
|
|
18654
|
-
charToInt[c] =
|
|
18805
|
+
for (let i2 = 0; i2 < chars.length; i2++) {
|
|
18806
|
+
const c = chars.charCodeAt(i2);
|
|
18807
|
+
intToChar[i2] = c;
|
|
18808
|
+
charToInt[c] = i2;
|
|
18655
18809
|
}
|
|
18656
18810
|
bufLength = 1024 * 16;
|
|
18657
18811
|
td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
|
|
@@ -18662,8 +18816,8 @@ var init_sourcemap_codec = __esm({
|
|
|
18662
18816
|
} : {
|
|
18663
18817
|
decode(buf) {
|
|
18664
18818
|
let out = "";
|
|
18665
|
-
for (let
|
|
18666
|
-
out += String.fromCharCode(buf[
|
|
18819
|
+
for (let i2 = 0; i2 < buf.length; i2++) {
|
|
18820
|
+
out += String.fromCharCode(buf[i2]);
|
|
18667
18821
|
}
|
|
18668
18822
|
return out;
|
|
18669
18823
|
}
|
|
@@ -18780,8 +18934,8 @@ var require_resolve_uri_umd = __commonJS({
|
|
|
18780
18934
|
let pointer = 1;
|
|
18781
18935
|
let positive = 0;
|
|
18782
18936
|
let addTrailingSlash = false;
|
|
18783
|
-
for (let
|
|
18784
|
-
const piece = pieces[
|
|
18937
|
+
for (let i2 = 1; i2 < pieces.length; i2++) {
|
|
18938
|
+
const piece = pieces[i2];
|
|
18785
18939
|
if (!piece) {
|
|
18786
18940
|
addTrailingSlash = true;
|
|
18787
18941
|
continue;
|
|
@@ -18803,8 +18957,8 @@ var require_resolve_uri_umd = __commonJS({
|
|
|
18803
18957
|
positive++;
|
|
18804
18958
|
}
|
|
18805
18959
|
let path = "";
|
|
18806
|
-
for (let
|
|
18807
|
-
path += "/" + pieces[
|
|
18960
|
+
for (let i2 = 1; i2 < pointer; i2++) {
|
|
18961
|
+
path += "/" + pieces[i2];
|
|
18808
18962
|
}
|
|
18809
18963
|
if (!path || addTrailingSlash && !path.endsWith("/..")) {
|
|
18810
18964
|
path += "/";
|
|
@@ -18958,30 +19112,30 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
|
|
|
18958
19112
|
function assert(_val) {
|
|
18959
19113
|
}
|
|
18960
19114
|
function getIndex(arr, index) {
|
|
18961
|
-
for (let
|
|
18962
|
-
arr[
|
|
19115
|
+
for (let i2 = arr.length; i2 <= index; i2++) {
|
|
19116
|
+
arr[i2] = [];
|
|
18963
19117
|
}
|
|
18964
19118
|
return arr[index];
|
|
18965
19119
|
}
|
|
18966
19120
|
function getColumnIndex(line, genColumn) {
|
|
18967
19121
|
let index = line.length;
|
|
18968
|
-
for (let
|
|
18969
|
-
const current2 = line[
|
|
19122
|
+
for (let i2 = index - 1; i2 >= 0; index = i2--) {
|
|
19123
|
+
const current2 = line[i2];
|
|
18970
19124
|
if (genColumn >= current2[COLUMN]) break;
|
|
18971
19125
|
}
|
|
18972
19126
|
return index;
|
|
18973
19127
|
}
|
|
18974
19128
|
function insert(array2, index, value) {
|
|
18975
|
-
for (let
|
|
18976
|
-
array2[
|
|
19129
|
+
for (let i2 = array2.length; i2 > index; i2--) {
|
|
19130
|
+
array2[i2] = array2[i2 - 1];
|
|
18977
19131
|
}
|
|
18978
19132
|
array2[index] = value;
|
|
18979
19133
|
}
|
|
18980
19134
|
function removeEmptyFinalLines(mappings) {
|
|
18981
19135
|
const { length } = mappings;
|
|
18982
19136
|
let len = length;
|
|
18983
|
-
for (let
|
|
18984
|
-
if (mappings[
|
|
19137
|
+
for (let i2 = len - 1; i2 >= 0; len = i2, i2--) {
|
|
19138
|
+
if (mappings[i2].length > 0) break;
|
|
18985
19139
|
}
|
|
18986
19140
|
if (len < length) mappings.length = len;
|
|
18987
19141
|
}
|
|
@@ -19055,19 +19209,19 @@ function computeSourceMap({ code: generatedCode, mappings: rawMappings }, filePa
|
|
|
19055
19209
|
if (currentMapping !== lineStart) {
|
|
19056
19210
|
maybeAddSegment(map, line, 0, filePath, line, 0);
|
|
19057
19211
|
}
|
|
19058
|
-
for (let
|
|
19059
|
-
if (
|
|
19212
|
+
for (let i2 = 0; i2 < generatedCode.length; i2++) {
|
|
19213
|
+
if (i2 === currentMapping) {
|
|
19060
19214
|
const genColumn = currentMapping - lineStart;
|
|
19061
19215
|
const sourceColumn = sourceColumns[tokenIndex];
|
|
19062
19216
|
maybeAddSegment(map, line, genColumn, filePath, line, sourceColumn);
|
|
19063
|
-
while ((currentMapping ===
|
|
19217
|
+
while ((currentMapping === i2 || currentMapping === void 0) && tokenIndex < rawMappings.length - 1) {
|
|
19064
19218
|
tokenIndex++;
|
|
19065
19219
|
currentMapping = rawMappings[tokenIndex];
|
|
19066
19220
|
}
|
|
19067
19221
|
}
|
|
19068
|
-
if (generatedCode.charCodeAt(
|
|
19222
|
+
if (generatedCode.charCodeAt(i2) === charCodes.lineFeed) {
|
|
19069
19223
|
line++;
|
|
19070
|
-
lineStart =
|
|
19224
|
+
lineStart = i2 + 1;
|
|
19071
19225
|
if (currentMapping !== lineStart) {
|
|
19072
19226
|
maybeAddSegment(map, line, 0, filePath, line, 0);
|
|
19073
19227
|
}
|
|
@@ -19081,14 +19235,14 @@ function computeSourceColumns(code, tokens) {
|
|
|
19081
19235
|
let tokenIndex = 0;
|
|
19082
19236
|
let currentMapping = tokens[tokenIndex].start;
|
|
19083
19237
|
let lineStart = 0;
|
|
19084
|
-
for (let
|
|
19085
|
-
if (
|
|
19238
|
+
for (let i2 = 0; i2 < code.length; i2++) {
|
|
19239
|
+
if (i2 === currentMapping) {
|
|
19086
19240
|
sourceColumns[tokenIndex] = currentMapping - lineStart;
|
|
19087
19241
|
tokenIndex++;
|
|
19088
19242
|
currentMapping = tokens[tokenIndex].start;
|
|
19089
19243
|
}
|
|
19090
|
-
if (code.charCodeAt(
|
|
19091
|
-
lineStart =
|
|
19244
|
+
if (code.charCodeAt(i2) === charCodes.lineFeed) {
|
|
19245
|
+
lineStart = i2 + 1;
|
|
19092
19246
|
}
|
|
19093
19247
|
}
|
|
19094
19248
|
return sourceColumns;
|
|
@@ -19305,18 +19459,18 @@ function hasShadowedGlobals(tokens, globalNames) {
|
|
|
19305
19459
|
function markShadowedGlobals(tokens, scopes, globalNames) {
|
|
19306
19460
|
const scopeStack = [];
|
|
19307
19461
|
let scopeIndex = scopes.length - 1;
|
|
19308
|
-
for (let
|
|
19309
|
-
while (scopeStack.length > 0 && scopeStack[scopeStack.length - 1].startTokenIndex ===
|
|
19462
|
+
for (let i2 = tokens.tokens.length - 1; ; i2--) {
|
|
19463
|
+
while (scopeStack.length > 0 && scopeStack[scopeStack.length - 1].startTokenIndex === i2 + 1) {
|
|
19310
19464
|
scopeStack.pop();
|
|
19311
19465
|
}
|
|
19312
|
-
while (scopeIndex >= 0 && scopes[scopeIndex].endTokenIndex ===
|
|
19466
|
+
while (scopeIndex >= 0 && scopes[scopeIndex].endTokenIndex === i2 + 1) {
|
|
19313
19467
|
scopeStack.push(scopes[scopeIndex]);
|
|
19314
19468
|
scopeIndex--;
|
|
19315
19469
|
}
|
|
19316
|
-
if (
|
|
19470
|
+
if (i2 < 0) {
|
|
19317
19471
|
break;
|
|
19318
19472
|
}
|
|
19319
|
-
const token = tokens.tokens[
|
|
19473
|
+
const token = tokens.tokens[i2];
|
|
19320
19474
|
const name = tokens.identifierNameForToken(token);
|
|
19321
19475
|
if (scopeStack.length > 1 && !token.isType && token.type === TokenType3.name && globalNames.has(name)) {
|
|
19322
19476
|
if (isBlockScopedDeclaration(token)) {
|
|
@@ -19338,8 +19492,8 @@ function markShadowedGlobals(tokens, scopes, globalNames) {
|
|
|
19338
19492
|
}
|
|
19339
19493
|
}
|
|
19340
19494
|
function markShadowedForScope(scope, tokens, name) {
|
|
19341
|
-
for (let
|
|
19342
|
-
const token = tokens.tokens[
|
|
19495
|
+
for (let i2 = scope.startTokenIndex; i2 < scope.endTokenIndex; i2++) {
|
|
19496
|
+
const token = tokens.tokens[i2];
|
|
19343
19497
|
if ((token.type === TokenType3.name || token.type === TokenType3.jsxName) && tokens.identifierNameForToken(token) === name) {
|
|
19344
19498
|
token.shadowsGlobal = true;
|
|
19345
19499
|
}
|
|
@@ -19492,10 +19646,10 @@ var require_util = __commonJS({
|
|
|
19492
19646
|
};
|
|
19493
19647
|
DetailContext2.prototype.getError = function(path) {
|
|
19494
19648
|
var msgParts = [];
|
|
19495
|
-
for (var
|
|
19496
|
-
var p = this._propNames[
|
|
19649
|
+
for (var i2 = this._propNames.length - 1; i2 >= 0; i2--) {
|
|
19650
|
+
var p = this._propNames[i2];
|
|
19497
19651
|
path += typeof p === "number" ? "[" + p + "]" : p ? "." + p : "";
|
|
19498
|
-
var m = this._messages[
|
|
19652
|
+
var m = this._messages[i2];
|
|
19499
19653
|
if (m) {
|
|
19500
19654
|
msgParts.push(path + " " + m);
|
|
19501
19655
|
}
|
|
@@ -19504,20 +19658,20 @@ var require_util = __commonJS({
|
|
|
19504
19658
|
};
|
|
19505
19659
|
DetailContext2.prototype.getErrorDetail = function(path) {
|
|
19506
19660
|
var details = [];
|
|
19507
|
-
for (var
|
|
19508
|
-
var p = this._propNames[
|
|
19661
|
+
for (var i2 = this._propNames.length - 1; i2 >= 0; i2--) {
|
|
19662
|
+
var p = this._propNames[i2];
|
|
19509
19663
|
path += typeof p === "number" ? "[" + p + "]" : p ? "." + p : "";
|
|
19510
|
-
var message = this._messages[
|
|
19664
|
+
var message = this._messages[i2];
|
|
19511
19665
|
if (message) {
|
|
19512
19666
|
details.push({ path, message });
|
|
19513
19667
|
}
|
|
19514
19668
|
}
|
|
19515
19669
|
var detail = null;
|
|
19516
|
-
for (var
|
|
19670
|
+
for (var i2 = details.length - 1; i2 >= 0; i2--) {
|
|
19517
19671
|
if (detail) {
|
|
19518
|
-
details[
|
|
19672
|
+
details[i2].nested = [detail];
|
|
19519
19673
|
}
|
|
19520
|
-
detail = details[
|
|
19674
|
+
detail = details[i2];
|
|
19521
19675
|
}
|
|
19522
19676
|
return detail;
|
|
19523
19677
|
};
|
|
@@ -19658,10 +19812,10 @@ var require_types = __commonJS({
|
|
|
19658
19812
|
if (!Array.isArray(value)) {
|
|
19659
19813
|
return ctx.fail(null, "is not an array", 0);
|
|
19660
19814
|
}
|
|
19661
|
-
for (var
|
|
19662
|
-
var ok = itemChecker(value[
|
|
19815
|
+
for (var i2 = 0; i2 < value.length; i2++) {
|
|
19816
|
+
var ok = itemChecker(value[i2], ctx);
|
|
19663
19817
|
if (!ok) {
|
|
19664
|
-
return ctx.fail(
|
|
19818
|
+
return ctx.fail(i2, null, 1);
|
|
19665
19819
|
}
|
|
19666
19820
|
}
|
|
19667
19821
|
return true;
|
|
@@ -19698,10 +19852,10 @@ var require_types = __commonJS({
|
|
|
19698
19852
|
if (!Array.isArray(value)) {
|
|
19699
19853
|
return ctx.fail(null, "is not an array", 0);
|
|
19700
19854
|
}
|
|
19701
|
-
for (var
|
|
19702
|
-
var ok = itemCheckers[
|
|
19855
|
+
for (var i2 = 0; i2 < itemCheckers.length; i2++) {
|
|
19856
|
+
var ok = itemCheckers[i2](value[i2], ctx);
|
|
19703
19857
|
if (!ok) {
|
|
19704
|
-
return ctx.fail(
|
|
19858
|
+
return ctx.fail(i2, null, 1);
|
|
19705
19859
|
}
|
|
19706
19860
|
}
|
|
19707
19861
|
return true;
|
|
@@ -19760,8 +19914,8 @@ var require_types = __commonJS({
|
|
|
19760
19914
|
});
|
|
19761
19915
|
return function(value, ctx) {
|
|
19762
19916
|
var ur = ctx.unionResolver();
|
|
19763
|
-
for (var
|
|
19764
|
-
var ok = itemCheckers[
|
|
19917
|
+
for (var i2 = 0; i2 < itemCheckers.length; i2++) {
|
|
19918
|
+
var ok = itemCheckers[i2](value, ur.createContext());
|
|
19765
19919
|
if (ok) {
|
|
19766
19920
|
return true;
|
|
19767
19921
|
}
|
|
@@ -19907,27 +20061,27 @@ var require_types = __commonJS({
|
|
|
19907
20061
|
return prop.ttype.getChecker(suite, strict);
|
|
19908
20062
|
});
|
|
19909
20063
|
var testCtx = new util_1.NoopContext();
|
|
19910
|
-
var isPropRequired = this.props.map(function(prop,
|
|
19911
|
-
return !prop.isOpt && !propCheckers[
|
|
20064
|
+
var isPropRequired = this.props.map(function(prop, i2) {
|
|
20065
|
+
return !prop.isOpt && !propCheckers[i2](void 0, testCtx);
|
|
19912
20066
|
});
|
|
19913
20067
|
var checker = function(value, ctx) {
|
|
19914
20068
|
if (typeof value !== "object" || value === null) {
|
|
19915
20069
|
return ctx.fail(null, "is not an object", 0);
|
|
19916
20070
|
}
|
|
19917
|
-
for (var
|
|
19918
|
-
if (!baseCheckers[
|
|
20071
|
+
for (var i2 = 0; i2 < baseCheckers.length; i2++) {
|
|
20072
|
+
if (!baseCheckers[i2](value, ctx)) {
|
|
19919
20073
|
return false;
|
|
19920
20074
|
}
|
|
19921
20075
|
}
|
|
19922
|
-
for (var
|
|
19923
|
-
var name_1 = _this.props[
|
|
20076
|
+
for (var i2 = 0; i2 < propCheckers.length; i2++) {
|
|
20077
|
+
var name_1 = _this.props[i2].name;
|
|
19924
20078
|
var v = value[name_1];
|
|
19925
20079
|
if (v === void 0) {
|
|
19926
|
-
if (isPropRequired[
|
|
20080
|
+
if (isPropRequired[i2]) {
|
|
19927
20081
|
return ctx.fail(name_1, "is missing", 1);
|
|
19928
20082
|
}
|
|
19929
20083
|
} else {
|
|
19930
|
-
var ok = propCheckers[
|
|
20084
|
+
var ok = propCheckers[i2](v, ctx);
|
|
19931
20085
|
if (!ok) {
|
|
19932
20086
|
return ctx.fail(name_1, null, 1);
|
|
19933
20087
|
}
|
|
@@ -20054,21 +20208,21 @@ var require_types = __commonJS({
|
|
|
20054
20208
|
return t2.ttype.getChecker(suite, strict);
|
|
20055
20209
|
});
|
|
20056
20210
|
var testCtx = new util_1.NoopContext();
|
|
20057
|
-
var isParamRequired = this.params.map(function(param2,
|
|
20058
|
-
return !param2.isOpt && !itemCheckers[
|
|
20211
|
+
var isParamRequired = this.params.map(function(param2, i2) {
|
|
20212
|
+
return !param2.isOpt && !itemCheckers[i2](void 0, testCtx);
|
|
20059
20213
|
});
|
|
20060
20214
|
var checker = function(value, ctx) {
|
|
20061
20215
|
if (!Array.isArray(value)) {
|
|
20062
20216
|
return ctx.fail(null, "is not an array", 0);
|
|
20063
20217
|
}
|
|
20064
|
-
for (var
|
|
20065
|
-
var p = _this.params[
|
|
20066
|
-
if (value[
|
|
20067
|
-
if (isParamRequired[
|
|
20218
|
+
for (var i2 = 0; i2 < itemCheckers.length; i2++) {
|
|
20219
|
+
var p = _this.params[i2];
|
|
20220
|
+
if (value[i2] === void 0) {
|
|
20221
|
+
if (isParamRequired[i2]) {
|
|
20068
20222
|
return ctx.fail(p.name, "is missing", 1);
|
|
20069
20223
|
}
|
|
20070
20224
|
} else {
|
|
20071
|
-
var ok = itemCheckers[
|
|
20225
|
+
var ok = itemCheckers[i2](value[i2], ctx);
|
|
20072
20226
|
if (!ok) {
|
|
20073
20227
|
return ctx.fail(p.name, null, 1);
|
|
20074
20228
|
}
|
|
@@ -20186,9 +20340,9 @@ var require_dist = __commonJS({
|
|
|
20186
20340
|
"node_modules/ts-interface-checker/dist/index.js"(exports) {
|
|
20187
20341
|
"use strict";
|
|
20188
20342
|
var __spreadArrays = exports && exports.__spreadArrays || function() {
|
|
20189
|
-
for (var s = 0,
|
|
20190
|
-
for (var r = Array(s), k = 0,
|
|
20191
|
-
for (var a = arguments[
|
|
20343
|
+
for (var s = 0, i2 = 0, il = arguments.length; i2 < il; i2++) s += arguments[i2].length;
|
|
20344
|
+
for (var r = Array(s), k = 0, i2 = 0; i2 < il; i2++)
|
|
20345
|
+
for (var a = arguments[i2], j = 0, jl = a.length; j < jl; j++, k++)
|
|
20192
20346
|
r[k] = a[j];
|
|
20193
20347
|
return r;
|
|
20194
20348
|
};
|
|
@@ -21542,10 +21696,10 @@ function tsParseFunctionBodyAndFinish(functionStart, funcContextId) {
|
|
|
21542
21696
|
tsParseTypeOrTypePredicateAnnotation(TokenType3.colon);
|
|
21543
21697
|
}
|
|
21544
21698
|
if (!match(TokenType3.braceL) && isLineTerminator()) {
|
|
21545
|
-
let
|
|
21546
|
-
while (
|
|
21547
|
-
state.tokens[
|
|
21548
|
-
|
|
21699
|
+
let i2 = state.tokens.length - 1;
|
|
21700
|
+
while (i2 >= 0 && (state.tokens[i2].start >= functionStart || state.tokens[i2].type === TokenType3._default || state.tokens[i2].type === TokenType3._export)) {
|
|
21701
|
+
state.tokens[i2].isType = true;
|
|
21702
|
+
i2--;
|
|
21549
21703
|
}
|
|
21550
21704
|
return;
|
|
21551
21705
|
}
|
|
@@ -21714,8 +21868,8 @@ function tsTryParseClassMemberWithIsStatic(isStatic) {
|
|
|
21714
21868
|
const found = tsTryParseIndexSignature();
|
|
21715
21869
|
if (found) {
|
|
21716
21870
|
const memberStartIndex = isStatic ? memberStartIndexAfterStatic - 1 : memberStartIndexAfterStatic;
|
|
21717
|
-
for (let
|
|
21718
|
-
state.tokens[
|
|
21871
|
+
for (let i2 = memberStartIndex; i2 < modifiersEndIndex; i2++) {
|
|
21872
|
+
state.tokens[i2].isType = true;
|
|
21719
21873
|
}
|
|
21720
21874
|
return true;
|
|
21721
21875
|
}
|
|
@@ -24992,7 +25146,7 @@ var init_TokenProcessor = __esm({
|
|
|
24992
25146
|
return;
|
|
24993
25147
|
}
|
|
24994
25148
|
if (token.numNullishCoalesceStarts) {
|
|
24995
|
-
for (let
|
|
25149
|
+
for (let i2 = 0; i2 < token.numNullishCoalesceStarts; i2++) {
|
|
24996
25150
|
if (token.isAsyncOperation) {
|
|
24997
25151
|
this.resultCode += "await ";
|
|
24998
25152
|
this.resultCode += this.helperManager.getHelperName("asyncNullishCoalesce");
|
|
@@ -25026,7 +25180,7 @@ var init_TokenProcessor = __esm({
|
|
|
25026
25180
|
this.resultCode += "])";
|
|
25027
25181
|
}
|
|
25028
25182
|
if (token.numNullishCoalesceEnds && !this.disableESTransforms) {
|
|
25029
|
-
for (let
|
|
25183
|
+
for (let i2 = 0; i2 < token.numNullishCoalesceEnds; i2++) {
|
|
25030
25184
|
this.resultCode += "))";
|
|
25031
25185
|
}
|
|
25032
25186
|
}
|
|
@@ -25340,8 +25494,8 @@ var init_elideImportEquals = __esm({
|
|
|
25340
25494
|
function getDeclarationInfo(tokens) {
|
|
25341
25495
|
const typeDeclarations = /* @__PURE__ */ new Set();
|
|
25342
25496
|
const valueDeclarations = /* @__PURE__ */ new Set();
|
|
25343
|
-
for (let
|
|
25344
|
-
const token = tokens.tokens[
|
|
25497
|
+
for (let i2 = 0; i2 < tokens.tokens.length; i2++) {
|
|
25498
|
+
const token = tokens.tokens[i2];
|
|
25345
25499
|
if (token.type === TokenType3.name && isTopLevelDeclaration(token)) {
|
|
25346
25500
|
if (token.isType) {
|
|
25347
25501
|
typeDeclarations.add(tokens.identifierNameForToken(token));
|
|
@@ -26199,7 +26353,7 @@ var init_ESMImportTransformer = __esm({
|
|
|
26199
26353
|
}
|
|
26200
26354
|
if (this.tokens.matches4(TokenType3._import, TokenType3.name, TokenType3.name, TokenType3.eq) && this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, ContextualKeyword._type)) {
|
|
26201
26355
|
this.tokens.removeInitialToken();
|
|
26202
|
-
for (let
|
|
26356
|
+
for (let i2 = 0; i2 < 7; i2++) {
|
|
26203
26357
|
this.tokens.removeToken();
|
|
26204
26358
|
}
|
|
26205
26359
|
return true;
|
|
@@ -26210,7 +26364,7 @@ var init_ESMImportTransformer = __esm({
|
|
|
26210
26364
|
}
|
|
26211
26365
|
if (this.tokens.matches5(TokenType3._export, TokenType3._import, TokenType3.name, TokenType3.name, TokenType3.eq) && this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 2, ContextualKeyword._type)) {
|
|
26212
26366
|
this.tokens.removeInitialToken();
|
|
26213
|
-
for (let
|
|
26367
|
+
for (let i2 = 0; i2 < 8; i2++) {
|
|
26214
26368
|
this.tokens.removeToken();
|
|
26215
26369
|
}
|
|
26216
26370
|
return true;
|
|
@@ -26622,11 +26776,11 @@ var init_FlowTransformer = __esm({
|
|
|
26622
26776
|
function _optionalChain(ops) {
|
|
26623
26777
|
let lastAccessLHS = void 0;
|
|
26624
26778
|
let value = ops[0];
|
|
26625
|
-
let
|
|
26626
|
-
while (
|
|
26627
|
-
const op = ops[
|
|
26628
|
-
const fn = ops[
|
|
26629
|
-
|
|
26779
|
+
let i2 = 1;
|
|
26780
|
+
while (i2 < ops.length) {
|
|
26781
|
+
const op = ops[i2];
|
|
26782
|
+
const fn = ops[i2 + 1];
|
|
26783
|
+
i2 += 2;
|
|
26630
26784
|
if ((op === "optionalAccess" || op === "optionalCall") && value == null) {
|
|
26631
26785
|
return void 0;
|
|
26632
26786
|
}
|
|
@@ -26850,19 +27004,19 @@ var init_OptionalChainingNullishTransformer = __esm({
|
|
|
26850
27004
|
*/
|
|
26851
27005
|
isLastSubscriptInChain() {
|
|
26852
27006
|
let depth = 0;
|
|
26853
|
-
for (let
|
|
26854
|
-
if (
|
|
27007
|
+
for (let i2 = this.tokens.currentIndex() + 1; ; i2++) {
|
|
27008
|
+
if (i2 >= this.tokens.tokens.length) {
|
|
26855
27009
|
throw new Error("Reached the end of the code while finding the end of the access chain.");
|
|
26856
27010
|
}
|
|
26857
|
-
if (this.tokens.tokens[
|
|
27011
|
+
if (this.tokens.tokens[i2].isOptionalChainStart) {
|
|
26858
27012
|
depth++;
|
|
26859
|
-
} else if (this.tokens.tokens[
|
|
27013
|
+
} else if (this.tokens.tokens[i2].isOptionalChainEnd) {
|
|
26860
27014
|
depth--;
|
|
26861
27015
|
}
|
|
26862
27016
|
if (depth < 0) {
|
|
26863
27017
|
return true;
|
|
26864
27018
|
}
|
|
26865
|
-
if (depth === 0 && this.tokens.tokens[
|
|
27019
|
+
if (depth === 0 && this.tokens.tokens[i2].subscriptStartIndex != null) {
|
|
26866
27020
|
return false;
|
|
26867
27021
|
}
|
|
26868
27022
|
}
|
|
@@ -27097,8 +27251,8 @@ function isIdentifier(name) {
|
|
|
27097
27251
|
if (!IS_IDENTIFIER_START[name.charCodeAt(0)]) {
|
|
27098
27252
|
return false;
|
|
27099
27253
|
}
|
|
27100
|
-
for (let
|
|
27101
|
-
if (!IS_IDENTIFIER_CHAR[name.charCodeAt(
|
|
27254
|
+
for (let i2 = 1; i2 < name.length; i2++) {
|
|
27255
|
+
if (!IS_IDENTIFIER_CHAR[name.charCodeAt(i2)]) {
|
|
27102
27256
|
return false;
|
|
27103
27257
|
}
|
|
27104
27258
|
}
|
|
@@ -27784,10 +27938,10 @@ var init_RootTransformer = __esm({
|
|
|
27784
27938
|
return false;
|
|
27785
27939
|
}
|
|
27786
27940
|
shiftMappings(mappings, prefixLength) {
|
|
27787
|
-
for (let
|
|
27788
|
-
const mapping = mappings[
|
|
27941
|
+
for (let i2 = 0; i2 < mappings.length; i2++) {
|
|
27942
|
+
const mapping = mappings[i2];
|
|
27789
27943
|
if (mapping !== void 0) {
|
|
27790
|
-
mappings[
|
|
27944
|
+
mappings[i2] = mapping + prefixLength;
|
|
27791
27945
|
}
|
|
27792
27946
|
}
|
|
27793
27947
|
return mappings;
|
|
@@ -27877,9 +28031,9 @@ var init_formatTokens = __esm({
|
|
|
27877
28031
|
// node_modules/sucrase/dist/esm/util/getTSImportedNames.js
|
|
27878
28032
|
function getTSImportedNames(tokens) {
|
|
27879
28033
|
const importedNames = /* @__PURE__ */ new Set();
|
|
27880
|
-
for (let
|
|
27881
|
-
if (tokens.matches1AtIndex(
|
|
27882
|
-
collectNamesForImport(tokens,
|
|
28034
|
+
for (let i2 = 0; i2 < tokens.tokens.length; i2++) {
|
|
28035
|
+
if (tokens.matches1AtIndex(i2, TokenType3._import) && !tokens.matches3AtIndex(i2, TokenType3._import, TokenType3.name, TokenType3.eq)) {
|
|
28036
|
+
collectNamesForImport(tokens, i2, importedNames);
|
|
27883
28037
|
}
|
|
27884
28038
|
}
|
|
27885
28039
|
return importedNames;
|
|
@@ -28199,7 +28353,7 @@ function rewriteImport(code, node, index) {
|
|
|
28199
28353
|
if (spec.type === "ImportNamespaceSpecifier") return `${local} = ${ns}`;
|
|
28200
28354
|
return `${local} = ${ns}[${JSON.stringify(importedName(spec))}]`;
|
|
28201
28355
|
});
|
|
28202
|
-
return `var ${ns} = ${load};
|
|
28356
|
+
return `var ${ns} = ${load}; let ${bindings.join(", ")};`;
|
|
28203
28357
|
}
|
|
28204
28358
|
function parseCell(js) {
|
|
28205
28359
|
try {
|
|
@@ -28216,6 +28370,12 @@ function parseCell(js) {
|
|
|
28216
28370
|
function rewriteModuleSyntax(js) {
|
|
28217
28371
|
const program = parseCell(js);
|
|
28218
28372
|
const edits = [];
|
|
28373
|
+
for (const statement of program.body) {
|
|
28374
|
+
const decl = statement.type === "ExportNamedDeclaration" ? statement.declaration : statement;
|
|
28375
|
+
if (decl?.type === "VariableDeclaration" && decl.kind === "const") {
|
|
28376
|
+
edits.push({ start: decl.start, end: decl.start + "const".length, text: "let " });
|
|
28377
|
+
}
|
|
28378
|
+
}
|
|
28219
28379
|
let importIndex = 0;
|
|
28220
28380
|
full(program, (node) => {
|
|
28221
28381
|
switch (node.type) {
|
|
@@ -28334,7 +28494,7 @@ function hoistForEval(js) {
|
|
|
28334
28494
|
walk(loop.body, state2);
|
|
28335
28495
|
}
|
|
28336
28496
|
});
|
|
28337
|
-
program.body.forEach((stmt,
|
|
28497
|
+
program.body.forEach((stmt, i2) => {
|
|
28338
28498
|
if (stmt.type === "VariableDeclaration" && (stmt.kind === "var" || stmt.kind === "let" || stmt.kind === "const")) {
|
|
28339
28499
|
statement(stmt);
|
|
28340
28500
|
} else if (stmt.type === "FunctionDeclaration") {
|
|
@@ -28344,7 +28504,7 @@ function hoistForEval(js) {
|
|
|
28344
28504
|
names.add(stmt.id.name);
|
|
28345
28505
|
edits.push({ start: stmt.start, end: stmt.start, text: `${stmt.id.name} = ` });
|
|
28346
28506
|
edits.push({ start: stmt.end, end: stmt.end, text: ";" });
|
|
28347
|
-
} else if (stmt.type === "ExpressionStatement" &&
|
|
28507
|
+
} else if (stmt.type === "ExpressionStatement" && i2 === program.body.length - 1) {
|
|
28348
28508
|
replace(stmt, `return [(${src(stmt.expression)})];`);
|
|
28349
28509
|
} else {
|
|
28350
28510
|
nestedVars(stmt);
|
|
@@ -28441,8 +28601,8 @@ var REGEX_AFTER_WORD = /* @__PURE__ */ new Set([
|
|
|
28441
28601
|
"yield",
|
|
28442
28602
|
"await"
|
|
28443
28603
|
]);
|
|
28444
|
-
function startsRegex(code,
|
|
28445
|
-
let j =
|
|
28604
|
+
function startsRegex(code, i2) {
|
|
28605
|
+
let j = i2 - 1;
|
|
28446
28606
|
while (j >= 0 && /\s/.test(code[j])) j--;
|
|
28447
28607
|
if (j < 0) return true;
|
|
28448
28608
|
const prev = code[j];
|
|
@@ -28452,9 +28612,9 @@ function startsRegex(code, i) {
|
|
|
28452
28612
|
}
|
|
28453
28613
|
return !/[)\]}'"`]/.test(prev);
|
|
28454
28614
|
}
|
|
28455
|
-
function regexEnd(code,
|
|
28615
|
+
function regexEnd(code, i2) {
|
|
28456
28616
|
let inClass = false;
|
|
28457
|
-
for (let j =
|
|
28617
|
+
for (let j = i2 + 1; j < code.length; j++) {
|
|
28458
28618
|
const c = code[j];
|
|
28459
28619
|
if (c === "\n") return -1;
|
|
28460
28620
|
if (c === "\\") j++;
|
|
@@ -28467,35 +28627,35 @@ function regexEnd(code, i) {
|
|
|
28467
28627
|
function checkIsComplete(code) {
|
|
28468
28628
|
const stack = [];
|
|
28469
28629
|
const closers = { ")": "(", "]": "[", "}": "{" };
|
|
28470
|
-
let
|
|
28471
|
-
while (
|
|
28472
|
-
const ch = code[
|
|
28473
|
-
if (ch === "/" && code[
|
|
28474
|
-
while (
|
|
28630
|
+
let i2 = 0;
|
|
28631
|
+
while (i2 < code.length) {
|
|
28632
|
+
const ch = code[i2];
|
|
28633
|
+
if (ch === "/" && code[i2 + 1] === "/") {
|
|
28634
|
+
while (i2 < code.length && code[i2] !== "\n") i2++;
|
|
28475
28635
|
continue;
|
|
28476
28636
|
}
|
|
28477
|
-
if (ch === "/" && code[
|
|
28478
|
-
const end = code.indexOf("*/",
|
|
28637
|
+
if (ch === "/" && code[i2 + 1] === "*") {
|
|
28638
|
+
const end = code.indexOf("*/", i2 + 2);
|
|
28479
28639
|
if (end === -1) return { status: "incomplete", indent: "" };
|
|
28480
|
-
|
|
28640
|
+
i2 = end + 2;
|
|
28481
28641
|
continue;
|
|
28482
28642
|
}
|
|
28483
|
-
if (ch === "/" && startsRegex(code,
|
|
28484
|
-
const end = regexEnd(code,
|
|
28643
|
+
if (ch === "/" && startsRegex(code, i2)) {
|
|
28644
|
+
const end = regexEnd(code, i2);
|
|
28485
28645
|
if (end !== -1) {
|
|
28486
|
-
|
|
28646
|
+
i2 = end;
|
|
28487
28647
|
continue;
|
|
28488
28648
|
}
|
|
28489
28649
|
}
|
|
28490
28650
|
if (ch === "'" || ch === '"' || ch === "`") {
|
|
28491
|
-
|
|
28651
|
+
i2++;
|
|
28492
28652
|
let closed = false;
|
|
28493
|
-
while (
|
|
28494
|
-
if (code[
|
|
28495
|
-
|
|
28653
|
+
while (i2 < code.length) {
|
|
28654
|
+
if (code[i2] === "\\") {
|
|
28655
|
+
i2 += 2;
|
|
28496
28656
|
continue;
|
|
28497
28657
|
}
|
|
28498
|
-
if (code[
|
|
28658
|
+
if (code[i2++] === ch) {
|
|
28499
28659
|
closed = true;
|
|
28500
28660
|
break;
|
|
28501
28661
|
}
|
|
@@ -28505,7 +28665,7 @@ function checkIsComplete(code) {
|
|
|
28505
28665
|
}
|
|
28506
28666
|
if (ch === "(" || ch === "[" || ch === "{") stack.push(ch);
|
|
28507
28667
|
else if (ch in closers && stack.pop() !== closers[ch]) return { status: "invalid" };
|
|
28508
|
-
|
|
28668
|
+
i2++;
|
|
28509
28669
|
}
|
|
28510
28670
|
return stack.length === 0 ? { status: "complete" } : { status: "incomplete", indent: " " };
|
|
28511
28671
|
}
|
|
@@ -28581,20 +28741,20 @@ function murmur2(str, seed) {
|
|
|
28581
28741
|
const data2 = ENCODER.encode(str);
|
|
28582
28742
|
let len = data2.length;
|
|
28583
28743
|
let h = seed ^ len;
|
|
28584
|
-
let
|
|
28744
|
+
let i2 = 0;
|
|
28585
28745
|
while (len >= 4) {
|
|
28586
|
-
let k = data2[
|
|
28746
|
+
let k = data2[i2] | data2[i2 + 1] << 8 | data2[i2 + 2] << 16 | data2[i2 + 3] << 24;
|
|
28587
28747
|
k = mul(k);
|
|
28588
28748
|
k ^= k >>> 24;
|
|
28589
28749
|
k = mul(k);
|
|
28590
28750
|
h = mul(h) ^ k;
|
|
28591
28751
|
len -= 4;
|
|
28592
|
-
|
|
28752
|
+
i2 += 4;
|
|
28593
28753
|
}
|
|
28594
|
-
if (len === 3) h ^= data2[
|
|
28595
|
-
if (len >= 2) h ^= data2[
|
|
28754
|
+
if (len === 3) h ^= data2[i2 + 2] << 16;
|
|
28755
|
+
if (len >= 2) h ^= data2[i2 + 1] << 8;
|
|
28596
28756
|
if (len >= 1) {
|
|
28597
|
-
h ^= data2[
|
|
28757
|
+
h ^= data2[i2];
|
|
28598
28758
|
h = mul(h);
|
|
28599
28759
|
}
|
|
28600
28760
|
h ^= h >>> 13;
|
|
@@ -28675,7 +28835,7 @@ function buildTraceback(error, sources, execution) {
|
|
|
28675
28835
|
let file = parsed.file;
|
|
28676
28836
|
if (parsed.line !== null) {
|
|
28677
28837
|
const at2 = callFrames.findIndex(
|
|
28678
|
-
(frame2,
|
|
28838
|
+
(frame2, i2) => i2 >= next2 && frame2.lineNumber + 1 === parsed.line && frame2.columnNumber + 1 === parsed.column
|
|
28679
28839
|
);
|
|
28680
28840
|
if (at2 !== -1) {
|
|
28681
28841
|
next2 = at2 + 1;
|
|
@@ -28879,6 +29039,7 @@ var KernelCore = class {
|
|
|
28879
29039
|
async run() {
|
|
28880
29040
|
this.#ensureTarget().catch((err) => this.#log(`target failed to start: ${err}`));
|
|
28881
29041
|
if (typeof this.#typeStrip === "string") await loadTypeStripper(this.#typeStrip);
|
|
29042
|
+
await this.#channels.ready;
|
|
28882
29043
|
await Promise.all([
|
|
28883
29044
|
this.#readShell(),
|
|
28884
29045
|
this.#runShell(this.#mainShell),
|
|
@@ -29018,6 +29179,10 @@ var KernelCore = class {
|
|
|
29018
29179
|
this.#types?.reset();
|
|
29019
29180
|
this.#input = null;
|
|
29020
29181
|
void this.#debugger?.attachTarget(null);
|
|
29182
|
+
if (!this.#shuttingDown) {
|
|
29183
|
+
for (const commId of this.#comms.keys()) this.#publish("comm_close", { comm_id: commId, data: {} });
|
|
29184
|
+
}
|
|
29185
|
+
this.#comms.clear();
|
|
29021
29186
|
if (!this.#shuttingDown) {
|
|
29022
29187
|
const text = note ?? `[cdp-kernel] ${this.#runtime} exited (${code}); restarting on next cell`;
|
|
29023
29188
|
this.#publish("stream", { name: "stderr", text: `
|
|
@@ -29583,7 +29748,7 @@ ${expression}
|
|
|
29583
29748
|
};
|
|
29584
29749
|
|
|
29585
29750
|
// stub:package
|
|
29586
|
-
var VERSION = "0.
|
|
29751
|
+
var VERSION = "0.10.0";
|
|
29587
29752
|
|
|
29588
29753
|
// src/browser/channels.ts
|
|
29589
29754
|
var PEER = "page";
|
|
@@ -29723,7 +29888,8 @@ var BrowserTarget = class _BrowserTarget {
|
|
|
29723
29888
|
const target = new _BrowserTarget(options.createWorker(), events, options.host);
|
|
29724
29889
|
const base2 = options.base ?? globalThis.location?.href ?? "file:///";
|
|
29725
29890
|
try {
|
|
29726
|
-
const
|
|
29891
|
+
const params = options.params === void 0 ? void 0 : JSON.stringify(options.params);
|
|
29892
|
+
const { userAgent } = await target.#request("info", { base: base2, cdn: options.cdn, preload: options.preload ?? [], params });
|
|
29727
29893
|
if (typeof userAgent === "string") target.versions.runtime = browserName(userAgent);
|
|
29728
29894
|
target.versions.engine = engineName(typeof userAgent === "string" ? userAgent : "");
|
|
29729
29895
|
} catch (err) {
|
|
@@ -29919,7 +30085,7 @@ function describeHostError(err) {
|
|
|
29919
30085
|
}
|
|
29920
30086
|
function toBase64(bytes2) {
|
|
29921
30087
|
let binary = "";
|
|
29922
|
-
for (let
|
|
30088
|
+
for (let i2 = 0; i2 < bytes2.length; i2 += 32768) binary += String.fromCharCode(...bytes2.subarray(i2, i2 + 32768));
|
|
29923
30089
|
return btoa(binary);
|
|
29924
30090
|
}
|
|
29925
30091
|
function browserName(userAgent) {
|