@datapos/datapos-development 0.3.412 → 0.3.414
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { promises as at, existsSync as Qi } from "node:fs";
|
|
2
2
|
import { nanoid as Ji } from "nanoid";
|
|
3
3
|
import { contextConfigSchema as Yi, connectorConfigSchema as Zi, CONNECTOR_SOURCE_OPERATIONS as ts, CONNECTOR_DESTINATION_OPERATIONS as es, presenterConfigSchema as is } from "@datapos/datapos-shared";
|
|
4
|
-
import
|
|
4
|
+
import qt from "node:path";
|
|
5
5
|
import { promisify as ss } from "node:util";
|
|
6
6
|
import { exec as rs, spawn as as } from "node:child_process";
|
|
7
7
|
import { fileURLToPath as ri, URL as ns } from "node:url";
|
|
@@ -161,13 +161,13 @@ function It(t) {
|
|
|
161
161
|
function hi(t, e, s) {
|
|
162
162
|
s === void 0 && (s = t.length);
|
|
163
163
|
for (var a = e; a < s; a++) {
|
|
164
|
-
var
|
|
165
|
-
if (It(
|
|
166
|
-
return a < s - 1 &&
|
|
164
|
+
var h = t.charCodeAt(a);
|
|
165
|
+
if (It(h))
|
|
166
|
+
return a < s - 1 && h === 13 && t.charCodeAt(a + 1) === 10 ? a + 2 : a + 1;
|
|
167
167
|
}
|
|
168
168
|
return -1;
|
|
169
169
|
}
|
|
170
|
-
var Ie = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,
|
|
170
|
+
var Ie = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, K = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, ui = Object.prototype, ds = ui.hasOwnProperty, ms = ui.toString, Mt = Object.hasOwn || (function(t, e) {
|
|
171
171
|
return ds.call(t, e);
|
|
172
172
|
}), $e = Array.isArray || (function(t) {
|
|
173
173
|
return ms.call(t) === "[object Array]";
|
|
@@ -189,10 +189,10 @@ var Kt = function(e, s, a) {
|
|
|
189
189
|
};
|
|
190
190
|
function _e(t, e) {
|
|
191
191
|
for (var s = 1, a = 0; ; ) {
|
|
192
|
-
var
|
|
193
|
-
if (
|
|
192
|
+
var h = hi(t, a, e);
|
|
193
|
+
if (h < 0)
|
|
194
194
|
return new Rt(s, e - a);
|
|
195
|
-
++s, a =
|
|
195
|
+
++s, a = h;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
var ee = {
|
|
@@ -291,42 +291,42 @@ var ee = {
|
|
|
291
291
|
// When enabled, parenthesized expressions are represented by
|
|
292
292
|
// (non-standard) ParenthesizedExpression nodes
|
|
293
293
|
preserveParens: !1
|
|
294
|
-
},
|
|
294
|
+
}, We = !1;
|
|
295
295
|
function xs(t) {
|
|
296
296
|
var e = {};
|
|
297
297
|
for (var s in ee)
|
|
298
298
|
e[s] = t && Mt(t, s) ? t[s] : ee[s];
|
|
299
|
-
if (e.ecmaVersion === "latest" ? e.ecmaVersion = 1e8 : e.ecmaVersion == null ? (!
|
|
299
|
+
if (e.ecmaVersion === "latest" ? e.ecmaVersion = 1e8 : e.ecmaVersion == null ? (!We && typeof console == "object" && console.warn && (We = !0, console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
300
300
|
Defaulting to 2020, but this will stop working in the future.`)), e.ecmaVersion = 11) : e.ecmaVersion >= 2015 && (e.ecmaVersion -= 2009), e.allowReserved == null && (e.allowReserved = e.ecmaVersion < 5), (!t || t.allowHashBang == null) && (e.allowHashBang = e.ecmaVersion >= 14), $e(e.onToken)) {
|
|
301
301
|
var a = e.onToken;
|
|
302
|
-
e.onToken = function(
|
|
303
|
-
return a.push(
|
|
302
|
+
e.onToken = function(h) {
|
|
303
|
+
return a.push(h);
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
306
|
return $e(e.onComment) && (e.onComment = vs(e, e.onComment)), e;
|
|
307
307
|
}
|
|
308
308
|
function vs(t, e) {
|
|
309
|
-
return function(s, a,
|
|
309
|
+
return function(s, a, h, l, d, v) {
|
|
310
310
|
var g = {
|
|
311
311
|
type: s ? "Block" : "Line",
|
|
312
312
|
value: a,
|
|
313
|
-
start:
|
|
313
|
+
start: h,
|
|
314
314
|
end: l
|
|
315
315
|
};
|
|
316
|
-
t.locations && (g.loc = new Kt(this, d, v)), t.ranges && (g.range = [
|
|
316
|
+
t.locations && (g.loc = new Kt(this, d, v)), t.ranges && (g.range = [h, l]), e.push(g);
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
|
-
var
|
|
319
|
+
var Gt = 1, Dt = 2, Ne = 4, ci = 8, Le = 16, pi = 32, he = 64, li = 128, _t = 256, zt = 512, ue = Gt | Dt | _t;
|
|
320
320
|
function Oe(t, e) {
|
|
321
321
|
return Dt | (t ? Ne : 0) | (e ? ci : 0);
|
|
322
322
|
}
|
|
323
323
|
var ie = 0, Re = 1, St = 2, fi = 3, di = 4, mi = 5, H = function(e, s, a) {
|
|
324
324
|
this.options = e = xs(e), this.sourceFile = e.sourceFile, this.keywords = kt(cs[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
|
|
325
|
-
var
|
|
326
|
-
e.allowReserved !== !0 && (
|
|
327
|
-
var l = (
|
|
325
|
+
var h = "";
|
|
326
|
+
e.allowReserved !== !0 && (h = ve[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (h += " await")), this.reservedWords = kt(h);
|
|
327
|
+
var l = (h ? h + " " : "") + ve.strict;
|
|
328
328
|
this.reservedWordsStrict = kt(l), this.reservedWordsStrictBind = kt(l + " " + ve.strictBind), this.input = String(s), this.containsEsc = !1, a ? (this.pos = a, this.lineStart = this.input.lastIndexOf(`
|
|
329
|
-
`, a - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(J).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = u.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = e.sourceType === "module", this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(
|
|
329
|
+
`, a - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(J).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = u.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = e.sourceType === "module", this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(Gt), this.regexpState = null, this.privateNameStack = [];
|
|
330
330
|
}, yt = { inFunction: { configurable: !0 }, inGenerator: { configurable: !0 }, inAsync: { configurable: !0 }, canAwait: { configurable: !0 }, allowSuper: { configurable: !0 }, allowDirectSuper: { configurable: !0 }, treatFunctionsAsVar: { configurable: !0 }, allowNewDotTarget: { configurable: !0 }, inClassStaticBlock: { configurable: !0 } };
|
|
331
331
|
H.prototype.parse = function() {
|
|
332
332
|
var e = this.options.program || this.startNode();
|
|
@@ -344,7 +344,7 @@ yt.inAsync.get = function() {
|
|
|
344
344
|
yt.canAwait.get = function() {
|
|
345
345
|
for (var t = this.scopeStack.length - 1; t >= 0; t--) {
|
|
346
346
|
var e = this.scopeStack[t], s = e.flags;
|
|
347
|
-
if (s & (_t |
|
|
347
|
+
if (s & (_t | zt))
|
|
348
348
|
return !1;
|
|
349
349
|
if (s & Dt)
|
|
350
350
|
return (s & Ne) > 0;
|
|
@@ -364,7 +364,7 @@ yt.treatFunctionsAsVar.get = function() {
|
|
|
364
364
|
yt.allowNewDotTarget.get = function() {
|
|
365
365
|
for (var t = this.scopeStack.length - 1; t >= 0; t--) {
|
|
366
366
|
var e = this.scopeStack[t], s = e.flags;
|
|
367
|
-
if (s & (_t |
|
|
367
|
+
if (s & (_t | zt) || s & Dt && !(s & Le))
|
|
368
368
|
return !0;
|
|
369
369
|
}
|
|
370
370
|
return !1;
|
|
@@ -374,16 +374,16 @@ yt.inClassStaticBlock.get = function() {
|
|
|
374
374
|
};
|
|
375
375
|
H.extend = function() {
|
|
376
376
|
for (var e = [], s = arguments.length; s--; ) e[s] = arguments[s];
|
|
377
|
-
for (var a = this,
|
|
378
|
-
a = e[
|
|
377
|
+
for (var a = this, h = 0; h < e.length; h++)
|
|
378
|
+
a = e[h](a);
|
|
379
379
|
return a;
|
|
380
380
|
};
|
|
381
381
|
H.parse = function(e, s) {
|
|
382
382
|
return new this(s, e).parse();
|
|
383
383
|
};
|
|
384
384
|
H.parseExpressionAt = function(e, s, a) {
|
|
385
|
-
var
|
|
386
|
-
return
|
|
385
|
+
var h = new this(a, e, s);
|
|
386
|
+
return h.nextToken(), h.parseExpression();
|
|
387
387
|
};
|
|
388
388
|
H.tokenizer = function(e, s) {
|
|
389
389
|
return new this(s, e);
|
|
@@ -394,16 +394,16 @@ Y.strictDirective = function(t) {
|
|
|
394
394
|
if (this.options.ecmaVersion < 5)
|
|
395
395
|
return !1;
|
|
396
396
|
for (; ; ) {
|
|
397
|
-
|
|
397
|
+
K.lastIndex = t, t += K.exec(this.input)[0].length;
|
|
398
398
|
var e = gs.exec(this.input.slice(t));
|
|
399
399
|
if (!e)
|
|
400
400
|
return !1;
|
|
401
401
|
if ((e[1] || e[2]) === "use strict") {
|
|
402
|
-
|
|
403
|
-
var s =
|
|
404
|
-
return
|
|
402
|
+
K.lastIndex = t + e[0].length;
|
|
403
|
+
var s = K.exec(this.input), a = s.index + s[0].length, h = this.input.charAt(a);
|
|
404
|
+
return h === ";" || h === "}" || J.test(s[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(h) || h === "!" && this.input.charAt(a + 1) === "=");
|
|
405
405
|
}
|
|
406
|
-
t += e[0].length,
|
|
406
|
+
t += e[0].length, K.lastIndex = t, t += K.exec(this.input)[0].length, this.input[t] === ";" && t++;
|
|
407
407
|
}
|
|
408
408
|
};
|
|
409
409
|
Y.eat = function(t) {
|
|
@@ -470,8 +470,8 @@ k.parseTopLevel = function(t) {
|
|
|
470
470
|
t.body.push(s);
|
|
471
471
|
}
|
|
472
472
|
if (this.inModule)
|
|
473
|
-
for (var a = 0,
|
|
474
|
-
var l =
|
|
473
|
+
for (var a = 0, h = Object.keys(this.undefinedExports); a < h.length; a += 1) {
|
|
474
|
+
var l = h[a];
|
|
475
475
|
this.raiseRecoverable(this.undefinedExports[l].start, "Export '" + l + "' is not defined");
|
|
476
476
|
}
|
|
477
477
|
return this.adaptDirectivePrologue(t.body), this.next(), t.sourceType = this.options.sourceType, this.finishNode(t, "Program");
|
|
@@ -480,8 +480,8 @@ var Me = { kind: "loop" }, bs = { kind: "switch" };
|
|
|
480
480
|
k.isLet = function(t) {
|
|
481
481
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let"))
|
|
482
482
|
return !1;
|
|
483
|
-
|
|
484
|
-
var e =
|
|
483
|
+
K.lastIndex = this.pos;
|
|
484
|
+
var e = K.exec(this.input), s = this.pos + e[0].length, a = this.input.charCodeAt(s);
|
|
485
485
|
if (a === 91 || a === 92)
|
|
486
486
|
return !0;
|
|
487
487
|
if (t)
|
|
@@ -489,11 +489,11 @@ k.isLet = function(t) {
|
|
|
489
489
|
if (a === 123 || a > 55295 && a < 56320)
|
|
490
490
|
return !0;
|
|
491
491
|
if (ft(a, !0)) {
|
|
492
|
-
for (var
|
|
493
|
-
++
|
|
492
|
+
for (var h = s + 1; gt(a = this.input.charCodeAt(h), !0); )
|
|
493
|
+
++h;
|
|
494
494
|
if (a === 92 || a > 55295 && a < 56320)
|
|
495
495
|
return !0;
|
|
496
|
-
var l = this.input.slice(s,
|
|
496
|
+
var l = this.input.slice(s, h);
|
|
497
497
|
if (!ps.test(l))
|
|
498
498
|
return !0;
|
|
499
499
|
}
|
|
@@ -502,24 +502,24 @@ k.isLet = function(t) {
|
|
|
502
502
|
k.isAsyncFunction = function() {
|
|
503
503
|
if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
|
|
504
504
|
return !1;
|
|
505
|
-
|
|
506
|
-
var t =
|
|
505
|
+
K.lastIndex = this.pos;
|
|
506
|
+
var t = K.exec(this.input), e = this.pos + t[0].length, s;
|
|
507
507
|
return !J.test(this.input.slice(this.pos, e)) && this.input.slice(e, e + 8) === "function" && (e + 8 === this.input.length || !(gt(s = this.input.charCodeAt(e + 8)) || s > 55295 && s < 56320));
|
|
508
508
|
};
|
|
509
509
|
k.isUsingKeyword = function(t, e) {
|
|
510
510
|
if (this.options.ecmaVersion < 17 || !this.isContextual(t ? "await" : "using"))
|
|
511
511
|
return !1;
|
|
512
|
-
|
|
513
|
-
var s =
|
|
512
|
+
K.lastIndex = this.pos;
|
|
513
|
+
var s = K.exec(this.input), a = this.pos + s[0].length;
|
|
514
514
|
if (J.test(this.input.slice(this.pos, a)))
|
|
515
515
|
return !1;
|
|
516
516
|
if (t) {
|
|
517
|
-
var
|
|
518
|
-
if (this.input.slice(a,
|
|
517
|
+
var h = a + 5, l;
|
|
518
|
+
if (this.input.slice(a, h) !== "using" || h === this.input.length || gt(l = this.input.charCodeAt(h)) || l > 55295 && l < 56320)
|
|
519
519
|
return !1;
|
|
520
|
-
|
|
521
|
-
var d =
|
|
522
|
-
if (d && J.test(this.input.slice(
|
|
520
|
+
K.lastIndex = h;
|
|
521
|
+
var d = K.exec(this.input);
|
|
522
|
+
if (d && J.test(this.input.slice(h, h + d[0].length)))
|
|
523
523
|
return !1;
|
|
524
524
|
}
|
|
525
525
|
if (e) {
|
|
@@ -527,8 +527,8 @@ k.isUsingKeyword = function(t, e) {
|
|
|
527
527
|
if (this.input.slice(a, v) === "of" && (v === this.input.length || !gt(g = this.input.charCodeAt(v)) && !(g > 55295 && g < 56320)))
|
|
528
528
|
return !1;
|
|
529
529
|
}
|
|
530
|
-
var
|
|
531
|
-
return ft(
|
|
530
|
+
var o = this.input.charCodeAt(a);
|
|
531
|
+
return ft(o, !0) || o === 92;
|
|
532
532
|
};
|
|
533
533
|
k.isAwaitUsing = function(t) {
|
|
534
534
|
return this.isUsingKeyword(!0, t);
|
|
@@ -537,51 +537,51 @@ k.isUsing = function(t) {
|
|
|
537
537
|
return this.isUsingKeyword(!1, t);
|
|
538
538
|
};
|
|
539
539
|
k.parseStatement = function(t, e, s) {
|
|
540
|
-
var a = this.type,
|
|
540
|
+
var a = this.type, h = this.startNode(), l;
|
|
541
541
|
switch (this.isLet(t) && (a = u._var, l = "let"), a) {
|
|
542
542
|
case u._break:
|
|
543
543
|
case u._continue:
|
|
544
|
-
return this.parseBreakContinueStatement(
|
|
544
|
+
return this.parseBreakContinueStatement(h, a.keyword);
|
|
545
545
|
case u._debugger:
|
|
546
|
-
return this.parseDebuggerStatement(
|
|
546
|
+
return this.parseDebuggerStatement(h);
|
|
547
547
|
case u._do:
|
|
548
|
-
return this.parseDoStatement(
|
|
548
|
+
return this.parseDoStatement(h);
|
|
549
549
|
case u._for:
|
|
550
|
-
return this.parseForStatement(
|
|
550
|
+
return this.parseForStatement(h);
|
|
551
551
|
case u._function:
|
|
552
|
-
return t && (this.strict || t !== "if" && t !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(
|
|
552
|
+
return t && (this.strict || t !== "if" && t !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(h, !1, !t);
|
|
553
553
|
case u._class:
|
|
554
|
-
return t && this.unexpected(), this.parseClass(
|
|
554
|
+
return t && this.unexpected(), this.parseClass(h, !0);
|
|
555
555
|
case u._if:
|
|
556
|
-
return this.parseIfStatement(
|
|
556
|
+
return this.parseIfStatement(h);
|
|
557
557
|
case u._return:
|
|
558
|
-
return this.parseReturnStatement(
|
|
558
|
+
return this.parseReturnStatement(h);
|
|
559
559
|
case u._switch:
|
|
560
|
-
return this.parseSwitchStatement(
|
|
560
|
+
return this.parseSwitchStatement(h);
|
|
561
561
|
case u._throw:
|
|
562
|
-
return this.parseThrowStatement(
|
|
562
|
+
return this.parseThrowStatement(h);
|
|
563
563
|
case u._try:
|
|
564
|
-
return this.parseTryStatement(
|
|
564
|
+
return this.parseTryStatement(h);
|
|
565
565
|
case u._const:
|
|
566
566
|
case u._var:
|
|
567
|
-
return l = l || this.value, t && l !== "var" && this.unexpected(), this.parseVarStatement(
|
|
567
|
+
return l = l || this.value, t && l !== "var" && this.unexpected(), this.parseVarStatement(h, l);
|
|
568
568
|
case u._while:
|
|
569
|
-
return this.parseWhileStatement(
|
|
569
|
+
return this.parseWhileStatement(h);
|
|
570
570
|
case u._with:
|
|
571
|
-
return this.parseWithStatement(
|
|
571
|
+
return this.parseWithStatement(h);
|
|
572
572
|
case u.braceL:
|
|
573
|
-
return this.parseBlock(!0,
|
|
573
|
+
return this.parseBlock(!0, h);
|
|
574
574
|
case u.semi:
|
|
575
|
-
return this.parseEmptyStatement(
|
|
575
|
+
return this.parseEmptyStatement(h);
|
|
576
576
|
case u._export:
|
|
577
577
|
case u._import:
|
|
578
578
|
if (this.options.ecmaVersion > 10 && a === u._import) {
|
|
579
|
-
|
|
580
|
-
var d =
|
|
579
|
+
K.lastIndex = this.pos;
|
|
580
|
+
var d = K.exec(this.input), v = this.pos + d[0].length, g = this.input.charCodeAt(v);
|
|
581
581
|
if (g === 40 || g === 46)
|
|
582
|
-
return this.parseExpressionStatement(
|
|
582
|
+
return this.parseExpressionStatement(h, this.parseExpression());
|
|
583
583
|
}
|
|
584
|
-
return this.options.allowImportExportEverywhere || (e || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), a === u._import ? this.parseImport(
|
|
584
|
+
return this.options.allowImportExportEverywhere || (e || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), a === u._import ? this.parseImport(h) : this.parseExport(h, s);
|
|
585
585
|
// If the statement does not start with a statement keyword or a
|
|
586
586
|
// brace, it's an ExpressionStatement or LabeledStatement. We
|
|
587
587
|
// simply start parsing an expression, and afterwards, if the
|
|
@@ -589,20 +589,20 @@ k.parseStatement = function(t, e, s) {
|
|
|
589
589
|
// Identifier node, we switch to interpreting it as a label.
|
|
590
590
|
default:
|
|
591
591
|
if (this.isAsyncFunction())
|
|
592
|
-
return t && this.unexpected(), this.next(), this.parseFunctionStatement(
|
|
593
|
-
var
|
|
594
|
-
if (
|
|
595
|
-
return e && this.options.sourceType === "script" && this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script`"),
|
|
592
|
+
return t && this.unexpected(), this.next(), this.parseFunctionStatement(h, !0, !t);
|
|
593
|
+
var o = this.isAwaitUsing(!1) ? "await using" : this.isUsing(!1) ? "using" : null;
|
|
594
|
+
if (o)
|
|
595
|
+
return e && this.options.sourceType === "script" && this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script`"), o === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.next(), this.parseVar(h, !1, o), this.semicolon(), this.finishNode(h, "VariableDeclaration");
|
|
596
596
|
var P = this.value, N = this.parseExpression();
|
|
597
|
-
return a === u.name && N.type === "Identifier" && this.eat(u.colon) ? this.parseLabeledStatement(
|
|
597
|
+
return a === u.name && N.type === "Identifier" && this.eat(u.colon) ? this.parseLabeledStatement(h, P, N, t) : this.parseExpressionStatement(h, N);
|
|
598
598
|
}
|
|
599
599
|
};
|
|
600
600
|
k.parseBreakContinueStatement = function(t, e) {
|
|
601
601
|
var s = e === "break";
|
|
602
602
|
this.next(), this.eat(u.semi) || this.insertSemicolon() ? t.label = null : this.type !== u.name ? this.unexpected() : (t.label = this.parseIdent(), this.semicolon());
|
|
603
603
|
for (var a = 0; a < this.labels.length; ++a) {
|
|
604
|
-
var
|
|
605
|
-
if ((t.label == null ||
|
|
604
|
+
var h = this.labels[a];
|
|
605
|
+
if ((t.label == null || h.name === t.label.name) && (h.kind != null && (s || h.kind === "loop") || t.label && s))
|
|
606
606
|
break;
|
|
607
607
|
}
|
|
608
608
|
return a === this.labels.length && this.raise(t.start, "Unsyntactic " + e), this.finishNode(t, s ? "BreakStatement" : "ContinueStatement");
|
|
@@ -620,22 +620,22 @@ k.parseForStatement = function(t) {
|
|
|
620
620
|
return e > -1 && this.unexpected(e), this.parseFor(t, null);
|
|
621
621
|
var s = this.isLet();
|
|
622
622
|
if (this.type === u._var || this.type === u._const || s) {
|
|
623
|
-
var a = this.startNode(),
|
|
624
|
-
return this.next(), this.parseVar(a, !0,
|
|
623
|
+
var a = this.startNode(), h = s ? "let" : this.value;
|
|
624
|
+
return this.next(), this.parseVar(a, !0, h), this.finishNode(a, "VariableDeclaration"), this.parseForAfterInit(t, a, e);
|
|
625
625
|
}
|
|
626
626
|
var l = this.isContextual("let"), d = !1, v = this.isUsing(!0) ? "using" : this.isAwaitUsing(!0) ? "await using" : null;
|
|
627
627
|
if (v) {
|
|
628
628
|
var g = this.startNode();
|
|
629
629
|
return this.next(), v === "await using" && this.next(), this.parseVar(g, !0, v), this.finishNode(g, "VariableDeclaration"), this.parseForAfterInit(t, g, e);
|
|
630
630
|
}
|
|
631
|
-
var
|
|
632
|
-
return this.type === u._in || (d = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (e > -1 ? (this.type === u._in && this.unexpected(e), t.await = !0) : d && this.options.ecmaVersion >= 8 && (j.start === N && !
|
|
631
|
+
var o = this.containsEsc, P = new ce(), N = this.start, j = e > -1 ? this.parseExprSubscripts(P, "await") : this.parseExpression(!0, P);
|
|
632
|
+
return this.type === u._in || (d = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (e > -1 ? (this.type === u._in && this.unexpected(e), t.await = !0) : d && this.options.ecmaVersion >= 8 && (j.start === N && !o && j.type === "Identifier" && j.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (t.await = !1)), l && d && this.raise(j.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(j, !1, P), this.checkLValPattern(j), this.parseForIn(t, j)) : (this.checkExpressionErrors(P, !0), e > -1 && this.unexpected(e), this.parseFor(t, j));
|
|
633
633
|
};
|
|
634
634
|
k.parseForAfterInit = function(t, e, s) {
|
|
635
635
|
return (this.type === u._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && e.declarations.length === 1 ? (this.options.ecmaVersion >= 9 && (this.type === u._in ? s > -1 && this.unexpected(s) : t.await = s > -1), this.parseForIn(t, e)) : (s > -1 && this.unexpected(s), this.parseFor(t, e));
|
|
636
636
|
};
|
|
637
637
|
k.parseFunctionStatement = function(t, e, s) {
|
|
638
|
-
return this.next(), this.parseFunction(t,
|
|
638
|
+
return this.next(), this.parseFunction(t, Ht | (s ? 0 : Ce), !1, e);
|
|
639
639
|
};
|
|
640
640
|
k.parseIfStatement = function(t) {
|
|
641
641
|
return this.next(), t.test = this.parseParenExpression(), t.consequent = this.parseStatement("if"), t.alternate = this.eat(u._else) ? this.parseStatement("if") : null, this.finishNode(t, "IfStatement");
|
|
@@ -681,14 +681,14 @@ k.parseEmptyStatement = function(t) {
|
|
|
681
681
|
return this.next(), this.finishNode(t, "EmptyStatement");
|
|
682
682
|
};
|
|
683
683
|
k.parseLabeledStatement = function(t, e, s, a) {
|
|
684
|
-
for (var
|
|
685
|
-
var d = l[
|
|
684
|
+
for (var h = 0, l = this.labels; h < l.length; h += 1) {
|
|
685
|
+
var d = l[h];
|
|
686
686
|
d.name === e && this.raise(s.start, "Label '" + e + "' is already declared");
|
|
687
687
|
}
|
|
688
688
|
for (var v = this.type.isLoop ? "loop" : this.type === u._switch ? "switch" : null, g = this.labels.length - 1; g >= 0; g--) {
|
|
689
|
-
var
|
|
690
|
-
if (
|
|
691
|
-
|
|
689
|
+
var o = this.labels[g];
|
|
690
|
+
if (o.statementStart === t.start)
|
|
691
|
+
o.statementStart = this.start, o.kind = v;
|
|
692
692
|
else
|
|
693
693
|
break;
|
|
694
694
|
}
|
|
@@ -716,8 +716,8 @@ k.parseForIn = function(t, e) {
|
|
|
716
716
|
};
|
|
717
717
|
k.parseVar = function(t, e, s, a) {
|
|
718
718
|
for (t.declarations = [], t.kind = s; ; ) {
|
|
719
|
-
var
|
|
720
|
-
if (this.parseVarId(
|
|
719
|
+
var h = this.startNode();
|
|
720
|
+
if (this.parseVarId(h, s), this.eat(u.eq) ? h.init = this.parseMaybeAssign(e) : !a && s === "const" && !(this.type === u._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !a && (s === "using" || s === "await using") && this.options.ecmaVersion >= 17 && this.type !== u._in && !this.isContextual("of") ? this.raise(this.lastTokEnd, "Missing initializer in " + s + " declaration") : !a && h.id.type !== "Identifier" && !(e && (this.type === u._in || this.isContextual("of"))) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : h.init = null, t.declarations.push(this.finishNode(h, "VariableDeclarator")), !this.eat(u.comma))
|
|
721
721
|
break;
|
|
722
722
|
}
|
|
723
723
|
return t;
|
|
@@ -725,11 +725,11 @@ k.parseVar = function(t, e, s, a) {
|
|
|
725
725
|
k.parseVarId = function(t, e) {
|
|
726
726
|
t.id = e === "using" || e === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(t.id, e === "var" ? Re : St, !1);
|
|
727
727
|
};
|
|
728
|
-
var
|
|
729
|
-
k.parseFunction = function(t, e, s, a,
|
|
730
|
-
this.initFunction(t), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !a) && (this.type === u.star && e & Ce && this.unexpected(), t.generator = this.eat(u.star)), this.options.ecmaVersion >= 8 && (t.async = !!a), e &
|
|
728
|
+
var Ht = 1, Ce = 2, yi = 4;
|
|
729
|
+
k.parseFunction = function(t, e, s, a, h) {
|
|
730
|
+
this.initFunction(t), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !a) && (this.type === u.star && e & Ce && this.unexpected(), t.generator = this.eat(u.star)), this.options.ecmaVersion >= 8 && (t.async = !!a), e & Ht && (t.id = e & yi && this.type !== u.name ? null : this.parseIdent(), t.id && !(e & Ce) && this.checkLValSimple(t.id, this.strict || t.generator || t.async ? this.treatFunctionsAsVar ? Re : St : fi));
|
|
731
731
|
var l = this.yieldPos, d = this.awaitPos, v = this.awaitIdentPos;
|
|
732
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Oe(t.async, t.generator)), e &
|
|
732
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Oe(t.async, t.generator)), e & Ht || (t.id = this.type === u.name ? this.parseIdent() : null), this.parseFunctionParams(t), this.parseFunctionBody(t, s, !1, h), this.yieldPos = l, this.awaitPos = d, this.awaitIdentPos = v, this.finishNode(t, e & Ht ? "FunctionDeclaration" : "FunctionExpression");
|
|
733
733
|
};
|
|
734
734
|
k.parseFunctionParams = function(t) {
|
|
735
735
|
this.expect(u.parenL), t.params = this.parseBindingList(u.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
@@ -738,29 +738,29 @@ k.parseClass = function(t, e) {
|
|
|
738
738
|
this.next();
|
|
739
739
|
var s = this.strict;
|
|
740
740
|
this.strict = !0, this.parseClassId(t, e), this.parseClassSuper(t);
|
|
741
|
-
var a = this.enterClassBody(),
|
|
742
|
-
for (
|
|
741
|
+
var a = this.enterClassBody(), h = this.startNode(), l = !1;
|
|
742
|
+
for (h.body = [], this.expect(u.braceL); this.type !== u.braceR; ) {
|
|
743
743
|
var d = this.parseClassElement(t.superClass !== null);
|
|
744
|
-
d && (
|
|
744
|
+
d && (h.body.push(d), d.type === "MethodDefinition" && d.kind === "constructor" ? (l && this.raiseRecoverable(d.start, "Duplicate constructor in the same class"), l = !0) : d.key && d.key.type === "PrivateIdentifier" && Ss(a, d) && this.raiseRecoverable(d.key.start, "Identifier '#" + d.key.name + "' has already been declared"));
|
|
745
745
|
}
|
|
746
|
-
return this.strict = s, this.next(), t.body = this.finishNode(
|
|
746
|
+
return this.strict = s, this.next(), t.body = this.finishNode(h, "ClassBody"), this.exitClassBody(), this.finishNode(t, e ? "ClassDeclaration" : "ClassExpression");
|
|
747
747
|
};
|
|
748
748
|
k.parseClassElement = function(t) {
|
|
749
749
|
if (this.eat(u.semi))
|
|
750
750
|
return null;
|
|
751
|
-
var e = this.options.ecmaVersion, s = this.startNode(), a = "",
|
|
751
|
+
var e = this.options.ecmaVersion, s = this.startNode(), a = "", h = !1, l = !1, d = "method", v = !1;
|
|
752
752
|
if (this.eatContextual("static")) {
|
|
753
753
|
if (e >= 13 && this.eat(u.braceL))
|
|
754
754
|
return this.parseClassStaticBlock(s), s;
|
|
755
755
|
this.isClassElementNameStart() || this.type === u.star ? v = !0 : a = "static";
|
|
756
756
|
}
|
|
757
|
-
if (s.static = v, !a && e >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === u.star) && !this.canInsertSemicolon() ? l = !0 : a = "async"), !a && (e >= 9 || !l) && this.eat(u.star) && (
|
|
757
|
+
if (s.static = v, !a && e >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === u.star) && !this.canInsertSemicolon() ? l = !0 : a = "async"), !a && (e >= 9 || !l) && this.eat(u.star) && (h = !0), !a && !l && !h) {
|
|
758
758
|
var g = this.value;
|
|
759
759
|
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? d = g : a = g);
|
|
760
760
|
}
|
|
761
|
-
if (a ? (s.computed = !1, s.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), s.key.name = a, this.finishNode(s.key, "Identifier")) : this.parseClassElementName(s), e < 13 || this.type === u.parenL || d !== "method" ||
|
|
762
|
-
var
|
|
763
|
-
|
|
761
|
+
if (a ? (s.computed = !1, s.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), s.key.name = a, this.finishNode(s.key, "Identifier")) : this.parseClassElementName(s), e < 13 || this.type === u.parenL || d !== "method" || h || l) {
|
|
762
|
+
var o = !s.static && se(s, "constructor"), P = o && t;
|
|
763
|
+
o && d !== "method" && this.raise(s.key.start, "Constructor can't have get/set modifier"), s.kind = o ? "constructor" : d, this.parseClassMethod(s, h, l, P);
|
|
764
764
|
} else
|
|
765
765
|
this.parseClassField(s);
|
|
766
766
|
return s;
|
|
@@ -772,13 +772,13 @@ k.parseClassElementName = function(t) {
|
|
|
772
772
|
this.type === u.privateId ? (this.value === "constructor" && this.raise(this.start, "Classes can't have an element named '#constructor'"), t.computed = !1, t.key = this.parsePrivateIdent()) : this.parsePropertyName(t);
|
|
773
773
|
};
|
|
774
774
|
k.parseClassMethod = function(t, e, s, a) {
|
|
775
|
-
var
|
|
776
|
-
t.kind === "constructor" ? (e && this.raise(
|
|
775
|
+
var h = t.key;
|
|
776
|
+
t.kind === "constructor" ? (e && this.raise(h.start, "Constructor can't be a generator"), s && this.raise(h.start, "Constructor can't be an async method")) : t.static && se(t, "prototype") && this.raise(h.start, "Classes may not have a static property named prototype");
|
|
777
777
|
var l = t.value = this.parseMethod(e, s, a);
|
|
778
778
|
return t.kind === "get" && l.params.length !== 0 && this.raiseRecoverable(l.start, "getter should have no params"), t.kind === "set" && l.params.length !== 1 && this.raiseRecoverable(l.start, "setter should have exactly one param"), t.kind === "set" && l.params[0].type === "RestElement" && this.raiseRecoverable(l.params[0].start, "Setter cannot use rest params"), this.finishNode(t, "MethodDefinition");
|
|
779
779
|
};
|
|
780
780
|
k.parseClassField = function(t) {
|
|
781
|
-
return se(t, "constructor") ? this.raise(t.key.start, "Classes can't have a field named 'constructor'") : t.static && se(t, "prototype") && this.raise(t.key.start, "Classes can't have a static field named 'prototype'"), this.eat(u.eq) ? (this.enterScope(
|
|
781
|
+
return se(t, "constructor") ? this.raise(t.key.start, "Classes can't have a field named 'constructor'") : t.static && se(t, "prototype") && this.raise(t.key.start, "Classes can't have a static field named 'prototype'"), this.eat(u.eq) ? (this.enterScope(zt | he), t.value = this.parseMaybeAssign(), this.exitScope()) : t.value = null, this.semicolon(), this.finishNode(t, "PropertyDefinition");
|
|
782
782
|
};
|
|
783
783
|
k.parseClassStaticBlock = function(t) {
|
|
784
784
|
t.body = [];
|
|
@@ -802,14 +802,14 @@ k.enterClassBody = function() {
|
|
|
802
802
|
k.exitClassBody = function() {
|
|
803
803
|
var t = this.privateNameStack.pop(), e = t.declared, s = t.used;
|
|
804
804
|
if (this.options.checkPrivateFields)
|
|
805
|
-
for (var a = this.privateNameStack.length,
|
|
805
|
+
for (var a = this.privateNameStack.length, h = a === 0 ? null : this.privateNameStack[a - 1], l = 0; l < s.length; ++l) {
|
|
806
806
|
var d = s[l];
|
|
807
|
-
Mt(e, d.name) || (
|
|
807
|
+
Mt(e, d.name) || (h ? h.used.push(d) : this.raiseRecoverable(d.start, "Private field '#" + d.name + "' must be declared in an enclosing class"));
|
|
808
808
|
}
|
|
809
809
|
};
|
|
810
810
|
function Ss(t, e) {
|
|
811
|
-
var s = e.key.name, a = t[s],
|
|
812
|
-
return e.type === "MethodDefinition" && (e.kind === "get" || e.kind === "set") && (
|
|
811
|
+
var s = e.key.name, a = t[s], h = "true";
|
|
812
|
+
return e.type === "MethodDefinition" && (e.kind === "get" || e.kind === "set") && (h = (e.static ? "s" : "i") + e.kind), a === "iget" && h === "iset" || a === "iset" && h === "iget" || a === "sget" && h === "sset" || a === "sset" && h === "sget" ? (t[s] = "true", !1) : a ? !0 : (t[s] = h, !1);
|
|
813
813
|
}
|
|
814
814
|
function se(t, e) {
|
|
815
815
|
var s = t.computed, a = t.key;
|
|
@@ -830,8 +830,8 @@ k.parseExport = function(t, e) {
|
|
|
830
830
|
this.type !== u.string && this.unexpected(), t.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (t.attributes = this.parseWithClause());
|
|
831
831
|
else {
|
|
832
832
|
for (var s = 0, a = t.specifiers; s < a.length; s += 1) {
|
|
833
|
-
var
|
|
834
|
-
this.checkUnreserved(
|
|
833
|
+
var h = a[s];
|
|
834
|
+
this.checkUnreserved(h.local), this.checkLocalExport(h.local), h.local.type === "Literal" && this.raise(h.local.start, "A string literal cannot be used as an exported binding without `from`.");
|
|
835
835
|
}
|
|
836
836
|
t.source = null, this.options.ecmaVersion >= 16 && (t.attributes = []);
|
|
837
837
|
}
|
|
@@ -846,7 +846,7 @@ k.parseExportDefaultDeclaration = function() {
|
|
|
846
846
|
var t;
|
|
847
847
|
if (this.type === u._function || (t = this.isAsyncFunction())) {
|
|
848
848
|
var e = this.startNode();
|
|
849
|
-
return this.next(), t && this.next(), this.parseFunction(e,
|
|
849
|
+
return this.next(), t && this.next(), this.parseFunction(e, Ht | yi, !1, t);
|
|
850
850
|
} else if (this.type === u._class) {
|
|
851
851
|
var s = this.startNode();
|
|
852
852
|
return this.parseClass(s, "nullableID");
|
|
@@ -863,8 +863,8 @@ k.checkPatternExport = function(t, e) {
|
|
|
863
863
|
if (s === "Identifier")
|
|
864
864
|
this.checkExport(t, e, e.start);
|
|
865
865
|
else if (s === "ObjectPattern")
|
|
866
|
-
for (var a = 0,
|
|
867
|
-
var l =
|
|
866
|
+
for (var a = 0, h = e.properties; a < h.length; a += 1) {
|
|
867
|
+
var l = h[a];
|
|
868
868
|
this.checkPatternExport(t, l);
|
|
869
869
|
}
|
|
870
870
|
else if (s === "ArrayPattern")
|
|
@@ -877,8 +877,8 @@ k.checkPatternExport = function(t, e) {
|
|
|
877
877
|
k.checkVariableExport = function(t, e) {
|
|
878
878
|
if (t)
|
|
879
879
|
for (var s = 0, a = e; s < a.length; s += 1) {
|
|
880
|
-
var
|
|
881
|
-
this.checkPatternExport(t,
|
|
880
|
+
var h = a[s];
|
|
881
|
+
this.checkPatternExport(t, h.id);
|
|
882
882
|
}
|
|
883
883
|
};
|
|
884
884
|
k.shouldParseExportStatement = function() {
|
|
@@ -943,8 +943,8 @@ k.parseWithClause = function() {
|
|
|
943
943
|
s = !1;
|
|
944
944
|
else if (this.expect(u.comma), this.afterTrailingComma(u.braceR))
|
|
945
945
|
break;
|
|
946
|
-
var a = this.parseImportAttribute(),
|
|
947
|
-
Mt(e,
|
|
946
|
+
var a = this.parseImportAttribute(), h = a.key.type === "Identifier" ? a.key.name : a.key.value;
|
|
947
|
+
Mt(e, h) && this.raiseRecoverable(a.key.start, "Duplicate attribute key '" + h + "'"), e[h] = !0, t.push(a);
|
|
948
948
|
}
|
|
949
949
|
return t;
|
|
950
950
|
};
|
|
@@ -981,8 +981,8 @@ pt.toAssignable = function(t, e, s) {
|
|
|
981
981
|
break;
|
|
982
982
|
case "ObjectExpression":
|
|
983
983
|
t.type = "ObjectPattern", s && this.checkPatternErrors(s, !0);
|
|
984
|
-
for (var a = 0,
|
|
985
|
-
var l =
|
|
984
|
+
for (var a = 0, h = t.properties; a < h.length; a += 1) {
|
|
985
|
+
var l = h[a];
|
|
986
986
|
this.toAssignable(l, e), l.type === "RestElement" && (l.argument.type === "ArrayPattern" || l.argument.type === "ObjectPattern") && this.raise(l.argument.start, "Unexpected token");
|
|
987
987
|
}
|
|
988
988
|
break;
|
|
@@ -1015,8 +1015,8 @@ pt.toAssignable = function(t, e, s) {
|
|
|
1015
1015
|
};
|
|
1016
1016
|
pt.toAssignableList = function(t, e) {
|
|
1017
1017
|
for (var s = t.length, a = 0; a < s; a++) {
|
|
1018
|
-
var
|
|
1019
|
-
|
|
1018
|
+
var h = t[a];
|
|
1019
|
+
h && this.toAssignable(h, e);
|
|
1020
1020
|
}
|
|
1021
1021
|
if (s) {
|
|
1022
1022
|
var l = t[s - 1];
|
|
@@ -1044,20 +1044,20 @@ pt.parseBindingAtom = function() {
|
|
|
1044
1044
|
return this.parseIdent();
|
|
1045
1045
|
};
|
|
1046
1046
|
pt.parseBindingList = function(t, e, s, a) {
|
|
1047
|
-
for (var
|
|
1047
|
+
for (var h = [], l = !0; !this.eat(t); )
|
|
1048
1048
|
if (l ? l = !1 : this.expect(u.comma), e && this.type === u.comma)
|
|
1049
|
-
|
|
1049
|
+
h.push(null);
|
|
1050
1050
|
else {
|
|
1051
1051
|
if (s && this.afterTrailingComma(t))
|
|
1052
1052
|
break;
|
|
1053
1053
|
if (this.type === u.ellipsis) {
|
|
1054
1054
|
var d = this.parseRestBinding();
|
|
1055
|
-
this.parseBindingListItem(d),
|
|
1055
|
+
this.parseBindingListItem(d), h.push(d), this.type === u.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.expect(t);
|
|
1056
1056
|
break;
|
|
1057
1057
|
} else
|
|
1058
|
-
|
|
1058
|
+
h.push(this.parseAssignableListItem(a));
|
|
1059
1059
|
}
|
|
1060
|
-
return
|
|
1060
|
+
return h;
|
|
1061
1061
|
};
|
|
1062
1062
|
pt.parseAssignableListItem = function(t) {
|
|
1063
1063
|
var e = this.parseMaybeDefault(this.start, this.startLoc);
|
|
@@ -1094,8 +1094,8 @@ pt.checkLValSimple = function(t, e, s) {
|
|
|
1094
1094
|
pt.checkLValPattern = function(t, e, s) {
|
|
1095
1095
|
switch (e === void 0 && (e = ie), t.type) {
|
|
1096
1096
|
case "ObjectPattern":
|
|
1097
|
-
for (var a = 0,
|
|
1098
|
-
var l =
|
|
1097
|
+
for (var a = 0, h = t.properties; a < h.length; a += 1) {
|
|
1098
|
+
var l = h[a];
|
|
1099
1099
|
this.checkLValInnerPattern(l, e, s);
|
|
1100
1100
|
}
|
|
1101
1101
|
break;
|
|
@@ -1124,8 +1124,8 @@ pt.checkLValInnerPattern = function(t, e, s) {
|
|
|
1124
1124
|
this.checkLValPattern(t, e, s);
|
|
1125
1125
|
}
|
|
1126
1126
|
};
|
|
1127
|
-
var X = function(e, s, a,
|
|
1128
|
-
this.token = e, this.isExpr = !!s, this.preserveSpace = !!a, this.override =
|
|
1127
|
+
var X = function(e, s, a, h, l) {
|
|
1128
|
+
this.token = e, this.isExpr = !!s, this.preserveSpace = !!a, this.override = h, this.generator = !!l;
|
|
1129
1129
|
}, F = {
|
|
1130
1130
|
b_stat: new X("{", !1),
|
|
1131
1131
|
b_expr: new X("{", !0),
|
|
@@ -1208,29 +1208,29 @@ u.name.updateContext = function(t) {
|
|
|
1208
1208
|
var _ = H.prototype;
|
|
1209
1209
|
_.checkPropClash = function(t, e, s) {
|
|
1210
1210
|
if (!(this.options.ecmaVersion >= 9 && t.type === "SpreadElement") && !(this.options.ecmaVersion >= 6 && (t.computed || t.method || t.shorthand))) {
|
|
1211
|
-
var a = t.key,
|
|
1211
|
+
var a = t.key, h;
|
|
1212
1212
|
switch (a.type) {
|
|
1213
1213
|
case "Identifier":
|
|
1214
|
-
|
|
1214
|
+
h = a.name;
|
|
1215
1215
|
break;
|
|
1216
1216
|
case "Literal":
|
|
1217
|
-
|
|
1217
|
+
h = String(a.value);
|
|
1218
1218
|
break;
|
|
1219
1219
|
default:
|
|
1220
1220
|
return;
|
|
1221
1221
|
}
|
|
1222
1222
|
var l = t.kind;
|
|
1223
1223
|
if (this.options.ecmaVersion >= 6) {
|
|
1224
|
-
|
|
1224
|
+
h === "__proto__" && l === "init" && (e.proto && (s ? s.doubleProto < 0 && (s.doubleProto = a.start) : this.raiseRecoverable(a.start, "Redefinition of __proto__ property")), e.proto = !0);
|
|
1225
1225
|
return;
|
|
1226
1226
|
}
|
|
1227
|
-
|
|
1228
|
-
var d = e[
|
|
1227
|
+
h = "$" + h;
|
|
1228
|
+
var d = e[h];
|
|
1229
1229
|
if (d) {
|
|
1230
1230
|
var v;
|
|
1231
1231
|
l === "init" ? v = this.strict && d.init || d.get || d.set : v = d.init || d[l], v && this.raiseRecoverable(a.start, "Redefinition of property");
|
|
1232
1232
|
} else
|
|
1233
|
-
d = e[
|
|
1233
|
+
d = e[h] = {
|
|
1234
1234
|
init: !1,
|
|
1235
1235
|
get: !1,
|
|
1236
1236
|
set: !1
|
|
@@ -1239,14 +1239,14 @@ _.checkPropClash = function(t, e, s) {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
};
|
|
1241
1241
|
_.parseExpression = function(t, e) {
|
|
1242
|
-
var s = this.start, a = this.startLoc,
|
|
1242
|
+
var s = this.start, a = this.startLoc, h = this.parseMaybeAssign(t, e);
|
|
1243
1243
|
if (this.type === u.comma) {
|
|
1244
1244
|
var l = this.startNodeAt(s, a);
|
|
1245
|
-
for (l.expressions = [
|
|
1245
|
+
for (l.expressions = [h]; this.eat(u.comma); )
|
|
1246
1246
|
l.expressions.push(this.parseMaybeAssign(t, e));
|
|
1247
1247
|
return this.finishNode(l, "SequenceExpression");
|
|
1248
1248
|
}
|
|
1249
|
-
return
|
|
1249
|
+
return h;
|
|
1250
1250
|
};
|
|
1251
1251
|
_.parseMaybeAssign = function(t, e, s) {
|
|
1252
1252
|
if (this.isContextual("yield")) {
|
|
@@ -1254,51 +1254,51 @@ _.parseMaybeAssign = function(t, e, s) {
|
|
|
1254
1254
|
return this.parseYield(t);
|
|
1255
1255
|
this.exprAllowed = !1;
|
|
1256
1256
|
}
|
|
1257
|
-
var a = !1,
|
|
1258
|
-
e ? (
|
|
1257
|
+
var a = !1, h = -1, l = -1, d = -1;
|
|
1258
|
+
e ? (h = e.parenthesizedAssign, l = e.trailingComma, d = e.doubleProto, e.parenthesizedAssign = e.trailingComma = -1) : (e = new ce(), a = !0);
|
|
1259
1259
|
var v = this.start, g = this.startLoc;
|
|
1260
1260
|
(this.type === u.parenL || this.type === u.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = t === "await");
|
|
1261
|
-
var
|
|
1262
|
-
if (s && (
|
|
1261
|
+
var o = this.parseMaybeConditional(t, e);
|
|
1262
|
+
if (s && (o = s.call(this, o, v, g)), this.type.isAssign) {
|
|
1263
1263
|
var P = this.startNodeAt(v, g);
|
|
1264
|
-
return P.operator = this.value, this.type === u.eq && (
|
|
1264
|
+
return P.operator = this.value, this.type === u.eq && (o = this.toAssignable(o, !1, e)), a || (e.parenthesizedAssign = e.trailingComma = e.doubleProto = -1), e.shorthandAssign >= o.start && (e.shorthandAssign = -1), this.type === u.eq ? this.checkLValPattern(o) : this.checkLValSimple(o), P.left = o, this.next(), P.right = this.parseMaybeAssign(t), d > -1 && (e.doubleProto = d), this.finishNode(P, "AssignmentExpression");
|
|
1265
1265
|
} else
|
|
1266
1266
|
a && this.checkExpressionErrors(e, !0);
|
|
1267
|
-
return
|
|
1267
|
+
return h > -1 && (e.parenthesizedAssign = h), l > -1 && (e.trailingComma = l), o;
|
|
1268
1268
|
};
|
|
1269
1269
|
_.parseMaybeConditional = function(t, e) {
|
|
1270
|
-
var s = this.start, a = this.startLoc,
|
|
1270
|
+
var s = this.start, a = this.startLoc, h = this.parseExprOps(t, e);
|
|
1271
1271
|
if (this.checkExpressionErrors(e))
|
|
1272
|
-
return
|
|
1272
|
+
return h;
|
|
1273
1273
|
if (this.eat(u.question)) {
|
|
1274
1274
|
var l = this.startNodeAt(s, a);
|
|
1275
|
-
return l.test =
|
|
1275
|
+
return l.test = h, l.consequent = this.parseMaybeAssign(), this.expect(u.colon), l.alternate = this.parseMaybeAssign(t), this.finishNode(l, "ConditionalExpression");
|
|
1276
1276
|
}
|
|
1277
|
-
return
|
|
1277
|
+
return h;
|
|
1278
1278
|
};
|
|
1279
1279
|
_.parseExprOps = function(t, e) {
|
|
1280
|
-
var s = this.start, a = this.startLoc,
|
|
1281
|
-
return this.checkExpressionErrors(e) ||
|
|
1280
|
+
var s = this.start, a = this.startLoc, h = this.parseMaybeUnary(e, !1, !1, t);
|
|
1281
|
+
return this.checkExpressionErrors(e) || h.start === s && h.type === "ArrowFunctionExpression" ? h : this.parseExprOp(h, s, a, -1, t);
|
|
1282
1282
|
};
|
|
1283
|
-
_.parseExprOp = function(t, e, s, a,
|
|
1283
|
+
_.parseExprOp = function(t, e, s, a, h) {
|
|
1284
1284
|
var l = this.type.binop;
|
|
1285
|
-
if (l != null && (!
|
|
1285
|
+
if (l != null && (!h || this.type !== u._in) && l > a) {
|
|
1286
1286
|
var d = this.type === u.logicalOR || this.type === u.logicalAND, v = this.type === u.coalesce;
|
|
1287
1287
|
v && (l = u.logicalAND.binop);
|
|
1288
1288
|
var g = this.value;
|
|
1289
1289
|
this.next();
|
|
1290
|
-
var
|
|
1291
|
-
return (d && this.type === u.coalesce || v && (this.type === u.logicalOR || this.type === u.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(j, e, s, a,
|
|
1290
|
+
var o = this.start, P = this.startLoc, N = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, h), o, P, l, h), j = this.buildBinary(e, s, t, N, g, d || v);
|
|
1291
|
+
return (d && this.type === u.coalesce || v && (this.type === u.logicalOR || this.type === u.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(j, e, s, a, h);
|
|
1292
1292
|
}
|
|
1293
1293
|
return t;
|
|
1294
1294
|
};
|
|
1295
|
-
_.buildBinary = function(t, e, s, a,
|
|
1295
|
+
_.buildBinary = function(t, e, s, a, h, l) {
|
|
1296
1296
|
a.type === "PrivateIdentifier" && this.raise(a.start, "Private identifier can only be left side of binary expression");
|
|
1297
1297
|
var d = this.startNodeAt(t, e);
|
|
1298
|
-
return d.left = s, d.operator =
|
|
1298
|
+
return d.left = s, d.operator = h, d.right = a, this.finishNode(d, l ? "LogicalExpression" : "BinaryExpression");
|
|
1299
1299
|
};
|
|
1300
1300
|
_.parseMaybeUnary = function(t, e, s, a) {
|
|
1301
|
-
var
|
|
1301
|
+
var h = this.start, l = this.startLoc, d;
|
|
1302
1302
|
if (this.isContextual("await") && this.canAwait)
|
|
1303
1303
|
d = this.parseAwait(a), e = !0;
|
|
1304
1304
|
else if (this.type.prefix) {
|
|
@@ -1310,15 +1310,15 @@ _.parseMaybeUnary = function(t, e, s, a) {
|
|
|
1310
1310
|
if (d = this.parseExprSubscripts(t, a), this.checkExpressionErrors(t))
|
|
1311
1311
|
return d;
|
|
1312
1312
|
for (; this.type.postfix && !this.canInsertSemicolon(); ) {
|
|
1313
|
-
var
|
|
1314
|
-
|
|
1313
|
+
var o = this.startNodeAt(h, l);
|
|
1314
|
+
o.operator = this.value, o.prefix = !1, o.argument = d, this.checkLValSimple(d), this.next(), d = this.finishNode(o, "UpdateExpression");
|
|
1315
1315
|
}
|
|
1316
1316
|
}
|
|
1317
1317
|
if (!s && this.eat(u.starstar))
|
|
1318
1318
|
if (e)
|
|
1319
1319
|
this.unexpected(this.lastTokStart);
|
|
1320
1320
|
else
|
|
1321
|
-
return this.buildBinary(
|
|
1321
|
+
return this.buildBinary(h, l, d, this.parseMaybeUnary(null, !1, !1, a), "**", !1);
|
|
1322
1322
|
else
|
|
1323
1323
|
return d;
|
|
1324
1324
|
};
|
|
@@ -1329,15 +1329,15 @@ function we(t) {
|
|
|
1329
1329
|
return t.type === "MemberExpression" && t.property.type === "PrivateIdentifier" || t.type === "ChainExpression" && we(t.expression) || t.type === "ParenthesizedExpression" && we(t.expression);
|
|
1330
1330
|
}
|
|
1331
1331
|
_.parseExprSubscripts = function(t, e) {
|
|
1332
|
-
var s = this.start, a = this.startLoc,
|
|
1333
|
-
if (
|
|
1334
|
-
return
|
|
1335
|
-
var l = this.parseSubscripts(
|
|
1332
|
+
var s = this.start, a = this.startLoc, h = this.parseExprAtom(t, e);
|
|
1333
|
+
if (h.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
|
|
1334
|
+
return h;
|
|
1335
|
+
var l = this.parseSubscripts(h, s, a, !1, e);
|
|
1336
1336
|
return t && l.type === "MemberExpression" && (t.parenthesizedAssign >= l.start && (t.parenthesizedAssign = -1), t.parenthesizedBind >= l.start && (t.parenthesizedBind = -1), t.trailingComma >= l.start && (t.trailingComma = -1)), l;
|
|
1337
1337
|
};
|
|
1338
|
-
_.parseSubscripts = function(t, e, s, a,
|
|
1338
|
+
_.parseSubscripts = function(t, e, s, a, h) {
|
|
1339
1339
|
for (var l = this.options.ecmaVersion >= 8 && t.type === "Identifier" && t.name === "async" && this.lastTokEnd === t.end && !this.canInsertSemicolon() && t.end - t.start === 5 && this.potentialArrowAt === t.start, d = !1; ; ) {
|
|
1340
|
-
var v = this.parseSubscript(t, e, s, a, l, d,
|
|
1340
|
+
var v = this.parseSubscript(t, e, s, a, l, d, h);
|
|
1341
1341
|
if (v.optional && (d = !0), v === t || v.type === "ArrowFunctionExpression") {
|
|
1342
1342
|
if (d) {
|
|
1343
1343
|
var g = this.startNodeAt(e, s);
|
|
@@ -1354,18 +1354,18 @@ _.shouldParseAsyncArrow = function() {
|
|
|
1354
1354
|
_.parseSubscriptAsyncArrow = function(t, e, s, a) {
|
|
1355
1355
|
return this.parseArrowExpression(this.startNodeAt(t, e), s, !0, a);
|
|
1356
1356
|
};
|
|
1357
|
-
_.parseSubscript = function(t, e, s, a,
|
|
1357
|
+
_.parseSubscript = function(t, e, s, a, h, l, d) {
|
|
1358
1358
|
var v = this.options.ecmaVersion >= 11, g = v && this.eat(u.questionDot);
|
|
1359
1359
|
a && g && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
1360
|
-
var
|
|
1361
|
-
if (
|
|
1360
|
+
var o = this.eat(u.bracketL);
|
|
1361
|
+
if (o || g && this.type !== u.parenL && this.type !== u.backQuote || this.eat(u.dot)) {
|
|
1362
1362
|
var P = this.startNodeAt(e, s);
|
|
1363
|
-
P.object = t,
|
|
1363
|
+
P.object = t, o ? (P.property = this.parseExpression(), this.expect(u.bracketR)) : this.type === u.privateId && t.type !== "Super" ? P.property = this.parsePrivateIdent() : P.property = this.parseIdent(this.options.allowReserved !== "never"), P.computed = !!o, v && (P.optional = g), t = this.finishNode(P, "MemberExpression");
|
|
1364
1364
|
} else if (!a && this.eat(u.parenL)) {
|
|
1365
1365
|
var N = new ce(), j = this.yieldPos, nt = this.awaitPos, lt = this.awaitIdentPos;
|
|
1366
1366
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
1367
1367
|
var Nt = this.parseExprList(u.parenR, this.options.ecmaVersion >= 8, !1, N);
|
|
1368
|
-
if (
|
|
1368
|
+
if (h && !g && this.shouldParseAsyncArrow())
|
|
1369
1369
|
return this.checkPatternErrors(N, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = j, this.awaitPos = nt, this.awaitIdentPos = lt, this.parseSubscriptAsyncArrow(e, s, Nt, d);
|
|
1370
1370
|
this.checkExpressionErrors(N, !0), this.yieldPos = j || this.yieldPos, this.awaitPos = nt || this.awaitPos, this.awaitIdentPos = lt || this.awaitIdentPos;
|
|
1371
1371
|
var I = this.startNodeAt(e, s);
|
|
@@ -1379,7 +1379,7 @@ _.parseSubscript = function(t, e, s, a, o, l, d) {
|
|
|
1379
1379
|
};
|
|
1380
1380
|
_.parseExprAtom = function(t, e, s) {
|
|
1381
1381
|
this.type === u.slash && this.readRegexp();
|
|
1382
|
-
var a,
|
|
1382
|
+
var a, h = this.potentialArrowAt === this.start;
|
|
1383
1383
|
switch (this.type) {
|
|
1384
1384
|
case u._super:
|
|
1385
1385
|
return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), a = this.startNode(), this.next(), this.type === u.parenL && !this.allowDirectSuper && this.raise(a.start, "super() call outside constructor of a subclass"), this.type !== u.dot && this.type !== u.bracketL && this.type !== u.parenL && this.unexpected(), this.finishNode(a, "Super");
|
|
@@ -1389,7 +1389,7 @@ _.parseExprAtom = function(t, e, s) {
|
|
|
1389
1389
|
var l = this.start, d = this.startLoc, v = this.containsEsc, g = this.parseIdent(!1);
|
|
1390
1390
|
if (this.options.ecmaVersion >= 8 && !v && g.name === "async" && !this.canInsertSemicolon() && this.eat(u._function))
|
|
1391
1391
|
return this.overrideContext(F.f_expr), this.parseFunction(this.startNodeAt(l, d), 0, !1, !0, e);
|
|
1392
|
-
if (
|
|
1392
|
+
if (h && !this.canInsertSemicolon()) {
|
|
1393
1393
|
if (this.eat(u.arrow))
|
|
1394
1394
|
return this.parseArrowExpression(this.startNodeAt(l, d), [g], !1, e);
|
|
1395
1395
|
if (this.options.ecmaVersion >= 8 && g.name === "async" && this.type === u.name && !v && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc))
|
|
@@ -1397,8 +1397,8 @@ _.parseExprAtom = function(t, e, s) {
|
|
|
1397
1397
|
}
|
|
1398
1398
|
return g;
|
|
1399
1399
|
case u.regexp:
|
|
1400
|
-
var
|
|
1401
|
-
return a = this.parseLiteral(
|
|
1400
|
+
var o = this.value;
|
|
1401
|
+
return a = this.parseLiteral(o.value), a.regex = { pattern: o.pattern, flags: o.flags }, a;
|
|
1402
1402
|
case u.num:
|
|
1403
1403
|
case u.string:
|
|
1404
1404
|
return this.parseLiteral(this.value);
|
|
@@ -1407,7 +1407,7 @@ _.parseExprAtom = function(t, e, s) {
|
|
|
1407
1407
|
case u._false:
|
|
1408
1408
|
return a = this.startNode(), a.value = this.type === u._null ? null : this.type === u._true, a.raw = this.type.keyword, this.next(), this.finishNode(a, "Literal");
|
|
1409
1409
|
case u.parenL:
|
|
1410
|
-
var P = this.start, N = this.parseParenAndDistinguishExpression(
|
|
1410
|
+
var P = this.start, N = this.parseParenAndDistinguishExpression(h, e);
|
|
1411
1411
|
return t && (t.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(N) && (t.parenthesizedAssign = P), t.parenthesizedBind < 0 && (t.parenthesizedBind = P)), N;
|
|
1412
1412
|
case u.bracketL:
|
|
1413
1413
|
return a = this.startNode(), this.next(), a.elements = this.parseExprList(u.bracketR, !0, !0, t), this.finishNode(a, "ArrayExpression");
|
|
@@ -1467,12 +1467,12 @@ _.shouldParseArrow = function(t) {
|
|
|
1467
1467
|
return !this.canInsertSemicolon();
|
|
1468
1468
|
};
|
|
1469
1469
|
_.parseParenAndDistinguishExpression = function(t, e) {
|
|
1470
|
-
var s = this.start, a = this.startLoc,
|
|
1470
|
+
var s = this.start, a = this.startLoc, h, l = this.options.ecmaVersion >= 8;
|
|
1471
1471
|
if (this.options.ecmaVersion >= 6) {
|
|
1472
1472
|
this.next();
|
|
1473
|
-
var d = this.start, v = this.startLoc, g = [],
|
|
1473
|
+
var d = this.start, v = this.startLoc, g = [], o = !0, P = !1, N = new ce(), j = this.yieldPos, nt = this.awaitPos, lt;
|
|
1474
1474
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== u.parenR; )
|
|
1475
|
-
if (
|
|
1475
|
+
if (o ? o = !1 : this.expect(u.comma), l && this.afterTrailingComma(u.parenR, !0)) {
|
|
1476
1476
|
P = !0;
|
|
1477
1477
|
break;
|
|
1478
1478
|
} else if (this.type === u.ellipsis) {
|
|
@@ -1486,14 +1486,14 @@ _.parseParenAndDistinguishExpression = function(t, e) {
|
|
|
1486
1486
|
var Nt = this.lastTokEnd, I = this.lastTokEndLoc;
|
|
1487
1487
|
if (this.expect(u.parenR), t && this.shouldParseArrow(g) && this.eat(u.arrow))
|
|
1488
1488
|
return this.checkPatternErrors(N, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = j, this.awaitPos = nt, this.parseParenArrowList(s, a, g, e);
|
|
1489
|
-
(!g.length || P) && this.unexpected(this.lastTokStart), lt && this.unexpected(lt), this.checkExpressionErrors(N, !0), this.yieldPos = j || this.yieldPos, this.awaitPos = nt || this.awaitPos, g.length > 1 ? (
|
|
1489
|
+
(!g.length || P) && this.unexpected(this.lastTokStart), lt && this.unexpected(lt), this.checkExpressionErrors(N, !0), this.yieldPos = j || this.yieldPos, this.awaitPos = nt || this.awaitPos, g.length > 1 ? (h = this.startNodeAt(d, v), h.expressions = g, this.finishNodeAt(h, "SequenceExpression", Nt, I)) : h = g[0];
|
|
1490
1490
|
} else
|
|
1491
|
-
|
|
1491
|
+
h = this.parseParenExpression();
|
|
1492
1492
|
if (this.options.preserveParens) {
|
|
1493
1493
|
var Z = this.startNodeAt(s, a);
|
|
1494
|
-
return Z.expression =
|
|
1494
|
+
return Z.expression = h, this.finishNode(Z, "ParenthesizedExpression");
|
|
1495
1495
|
} else
|
|
1496
|
-
return
|
|
1496
|
+
return h;
|
|
1497
1497
|
};
|
|
1498
1498
|
_.parseParenItem = function(t) {
|
|
1499
1499
|
return t;
|
|
@@ -1511,8 +1511,8 @@ _.parseNew = function() {
|
|
|
1511
1511
|
var s = this.containsEsc;
|
|
1512
1512
|
return t.property = this.parseIdent(!0), t.property.name !== "target" && this.raiseRecoverable(t.property.start, "The only valid meta property for new is 'new.target'"), s && this.raiseRecoverable(t.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(t.start, "'new.target' can only be used in functions and class static block"), this.finishNode(t, "MetaProperty");
|
|
1513
1513
|
}
|
|
1514
|
-
var a = this.start,
|
|
1515
|
-
return t.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), a,
|
|
1514
|
+
var a = this.start, h = this.startLoc;
|
|
1515
|
+
return t.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), a, h, !0, !1), this.eat(u.parenL) ? t.arguments = this.parseExprList(u.parenR, this.options.ecmaVersion >= 8, !1) : t.arguments = Ps, this.finishNode(t, "NewExpression");
|
|
1516
1516
|
};
|
|
1517
1517
|
_.parseTemplateElement = function(t) {
|
|
1518
1518
|
var e = t.isTagged, s = this.startNode();
|
|
@@ -1541,24 +1541,24 @@ _.isAsyncProp = function(t) {
|
|
|
1541
1541
|
return !t.computed && t.key.type === "Identifier" && t.key.name === "async" && (this.type === u.name || this.type === u.num || this.type === u.string || this.type === u.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === u.star) && !J.test(this.input.slice(this.lastTokEnd, this.start));
|
|
1542
1542
|
};
|
|
1543
1543
|
_.parseObj = function(t, e) {
|
|
1544
|
-
var s = this.startNode(), a = !0,
|
|
1544
|
+
var s = this.startNode(), a = !0, h = {};
|
|
1545
1545
|
for (s.properties = [], this.next(); !this.eat(u.braceR); ) {
|
|
1546
1546
|
if (a)
|
|
1547
1547
|
a = !1;
|
|
1548
1548
|
else if (this.expect(u.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(u.braceR))
|
|
1549
1549
|
break;
|
|
1550
1550
|
var l = this.parseProperty(t, e);
|
|
1551
|
-
t || this.checkPropClash(l,
|
|
1551
|
+
t || this.checkPropClash(l, h, e), s.properties.push(l);
|
|
1552
1552
|
}
|
|
1553
1553
|
return this.finishNode(s, t ? "ObjectPattern" : "ObjectExpression");
|
|
1554
1554
|
};
|
|
1555
1555
|
_.parseProperty = function(t, e) {
|
|
1556
|
-
var s = this.startNode(), a,
|
|
1556
|
+
var s = this.startNode(), a, h, l, d;
|
|
1557
1557
|
if (this.options.ecmaVersion >= 9 && this.eat(u.ellipsis))
|
|
1558
1558
|
return t ? (s.argument = this.parseIdent(!1), this.type === u.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(s, "RestElement")) : (s.argument = this.parseMaybeAssign(!1, e), this.type === u.comma && e && e.trailingComma < 0 && (e.trailingComma = this.start), this.finishNode(s, "SpreadElement"));
|
|
1559
1559
|
this.options.ecmaVersion >= 6 && (s.method = !1, s.shorthand = !1, (t || e) && (l = this.start, d = this.startLoc), t || (a = this.eat(u.star)));
|
|
1560
1560
|
var v = this.containsEsc;
|
|
1561
|
-
return this.parsePropertyName(s), !t && !v && this.options.ecmaVersion >= 8 && !a && this.isAsyncProp(s) ? (
|
|
1561
|
+
return this.parsePropertyName(s), !t && !v && this.options.ecmaVersion >= 8 && !a && this.isAsyncProp(s) ? (h = !0, a = this.options.ecmaVersion >= 9 && this.eat(u.star), this.parsePropertyName(s)) : h = !1, this.parsePropertyValue(s, t, a, h, l, d, e, v), this.finishNode(s, "Property");
|
|
1562
1562
|
};
|
|
1563
1563
|
_.parseGetterSetter = function(t) {
|
|
1564
1564
|
var e = t.key.name;
|
|
@@ -1570,8 +1570,8 @@ _.parseGetterSetter = function(t) {
|
|
|
1570
1570
|
} else
|
|
1571
1571
|
t.kind === "set" && t.value.params[0].type === "RestElement" && this.raiseRecoverable(t.value.params[0].start, "Setter cannot use rest params");
|
|
1572
1572
|
};
|
|
1573
|
-
_.parsePropertyValue = function(t, e, s, a,
|
|
1574
|
-
(s || a) && this.type === u.colon && this.unexpected(), this.eat(u.colon) ? (t.value = e ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, d), t.kind = "init") : this.options.ecmaVersion >= 6 && this.type === u.parenL ? (e && this.unexpected(), t.method = !0, t.value = this.parseMethod(s, a), t.kind = "init") : !e && !v && this.options.ecmaVersion >= 5 && !t.computed && t.key.type === "Identifier" && (t.key.name === "get" || t.key.name === "set") && this.type !== u.comma && this.type !== u.braceR && this.type !== u.eq ? ((s || a) && this.unexpected(), this.parseGetterSetter(t)) : this.options.ecmaVersion >= 6 && !t.computed && t.key.type === "Identifier" ? ((s || a) && this.unexpected(), this.checkUnreserved(t.key), t.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos =
|
|
1573
|
+
_.parsePropertyValue = function(t, e, s, a, h, l, d, v) {
|
|
1574
|
+
(s || a) && this.type === u.colon && this.unexpected(), this.eat(u.colon) ? (t.value = e ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, d), t.kind = "init") : this.options.ecmaVersion >= 6 && this.type === u.parenL ? (e && this.unexpected(), t.method = !0, t.value = this.parseMethod(s, a), t.kind = "init") : !e && !v && this.options.ecmaVersion >= 5 && !t.computed && t.key.type === "Identifier" && (t.key.name === "get" || t.key.name === "set") && this.type !== u.comma && this.type !== u.braceR && this.type !== u.eq ? ((s || a) && this.unexpected(), this.parseGetterSetter(t)) : this.options.ecmaVersion >= 6 && !t.computed && t.key.type === "Identifier" ? ((s || a) && this.unexpected(), this.checkUnreserved(t.key), t.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = h), e ? t.value = this.parseMaybeDefault(h, l, this.copyNode(t.key)) : this.type === u.eq && d ? (d.shorthandAssign < 0 && (d.shorthandAssign = this.start), t.value = this.parseMaybeDefault(h, l, this.copyNode(t.key))) : t.value = this.copyNode(t.key), t.kind = "init", t.shorthand = !0) : this.unexpected();
|
|
1575
1575
|
};
|
|
1576
1576
|
_.parsePropertyName = function(t) {
|
|
1577
1577
|
if (this.options.ecmaVersion >= 6) {
|
|
@@ -1585,16 +1585,16 @@ _.initFunction = function(t) {
|
|
|
1585
1585
|
t.id = null, this.options.ecmaVersion >= 6 && (t.generator = t.expression = !1), this.options.ecmaVersion >= 8 && (t.async = !1);
|
|
1586
1586
|
};
|
|
1587
1587
|
_.parseMethod = function(t, e, s) {
|
|
1588
|
-
var a = this.startNode(),
|
|
1589
|
-
return this.initFunction(a), this.options.ecmaVersion >= 6 && (a.generator = t), this.options.ecmaVersion >= 8 && (a.async = !!e), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Oe(e, a.generator) | he | (s ? li : 0)), this.expect(u.parenL), a.params = this.parseBindingList(u.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(a, !1, !0, !1), this.yieldPos =
|
|
1588
|
+
var a = this.startNode(), h = this.yieldPos, l = this.awaitPos, d = this.awaitIdentPos;
|
|
1589
|
+
return this.initFunction(a), this.options.ecmaVersion >= 6 && (a.generator = t), this.options.ecmaVersion >= 8 && (a.async = !!e), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Oe(e, a.generator) | he | (s ? li : 0)), this.expect(u.parenL), a.params = this.parseBindingList(u.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(a, !1, !0, !1), this.yieldPos = h, this.awaitPos = l, this.awaitIdentPos = d, this.finishNode(a, "FunctionExpression");
|
|
1590
1590
|
};
|
|
1591
1591
|
_.parseArrowExpression = function(t, e, s, a) {
|
|
1592
|
-
var
|
|
1593
|
-
return this.enterScope(Oe(s, !1) | Le), this.initFunction(t), this.options.ecmaVersion >= 8 && (t.async = !!s), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, t.params = this.toAssignableList(e, !0), this.parseFunctionBody(t, !0, !1, a), this.yieldPos =
|
|
1592
|
+
var h = this.yieldPos, l = this.awaitPos, d = this.awaitIdentPos;
|
|
1593
|
+
return this.enterScope(Oe(s, !1) | Le), this.initFunction(t), this.options.ecmaVersion >= 8 && (t.async = !!s), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, t.params = this.toAssignableList(e, !0), this.parseFunctionBody(t, !0, !1, a), this.yieldPos = h, this.awaitPos = l, this.awaitIdentPos = d, this.finishNode(t, "ArrowFunctionExpression");
|
|
1594
1594
|
};
|
|
1595
1595
|
_.parseFunctionBody = function(t, e, s, a) {
|
|
1596
|
-
var
|
|
1597
|
-
if (
|
|
1596
|
+
var h = e && this.type !== u.braceL, l = this.strict, d = !1;
|
|
1597
|
+
if (h)
|
|
1598
1598
|
t.body = this.parseMaybeAssign(a), t.expression = !0, this.checkParams(t, !1);
|
|
1599
1599
|
else {
|
|
1600
1600
|
var v = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(t.params);
|
|
@@ -1613,27 +1613,27 @@ _.isSimpleParamList = function(t) {
|
|
|
1613
1613
|
return !0;
|
|
1614
1614
|
};
|
|
1615
1615
|
_.checkParams = function(t, e) {
|
|
1616
|
-
for (var s = /* @__PURE__ */ Object.create(null), a = 0,
|
|
1617
|
-
var l =
|
|
1616
|
+
for (var s = /* @__PURE__ */ Object.create(null), a = 0, h = t.params; a < h.length; a += 1) {
|
|
1617
|
+
var l = h[a];
|
|
1618
1618
|
this.checkLValInnerPattern(l, Re, e ? null : s);
|
|
1619
1619
|
}
|
|
1620
1620
|
};
|
|
1621
1621
|
_.parseExprList = function(t, e, s, a) {
|
|
1622
|
-
for (var
|
|
1622
|
+
for (var h = [], l = !0; !this.eat(t); ) {
|
|
1623
1623
|
if (l)
|
|
1624
1624
|
l = !1;
|
|
1625
1625
|
else if (this.expect(u.comma), e && this.afterTrailingComma(t))
|
|
1626
1626
|
break;
|
|
1627
1627
|
var d = void 0;
|
|
1628
|
-
s && this.type === u.comma ? d = null : this.type === u.ellipsis ? (d = this.parseSpread(a), a && this.type === u.comma && a.trailingComma < 0 && (a.trailingComma = this.start)) : d = this.parseMaybeAssign(!1, a),
|
|
1628
|
+
s && this.type === u.comma ? d = null : this.type === u.ellipsis ? (d = this.parseSpread(a), a && this.type === u.comma && a.trailingComma < 0 && (a.trailingComma = this.start)) : d = this.parseMaybeAssign(!1, a), h.push(d);
|
|
1629
1629
|
}
|
|
1630
|
-
return
|
|
1630
|
+
return h;
|
|
1631
1631
|
};
|
|
1632
1632
|
_.checkUnreserved = function(t) {
|
|
1633
1633
|
var e = t.start, s = t.end, a = t.name;
|
|
1634
1634
|
if (this.inGenerator && a === "yield" && this.raiseRecoverable(e, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && a === "await" && this.raiseRecoverable(e, "Cannot use 'await' as identifier inside an async function"), !(this.currentThisScope().flags & ue) && a === "arguments" && this.raiseRecoverable(e, "Cannot use 'arguments' in class field initializer"), this.inClassStaticBlock && (a === "arguments" || a === "await") && this.raise(e, "Cannot use " + a + " in class static initialization block"), this.keywords.test(a) && this.raise(e, "Unexpected keyword '" + a + "'"), !(this.options.ecmaVersion < 6 && this.input.slice(e, s).indexOf("\\") !== -1)) {
|
|
1635
|
-
var
|
|
1636
|
-
|
|
1635
|
+
var h = this.strict ? this.reservedWordsStrict : this.reservedWords;
|
|
1636
|
+
h.test(a) && (!this.inAsync && a === "await" && this.raiseRecoverable(e, "Cannot use keyword 'await' outside an async function"), this.raiseRecoverable(e, "The keyword '" + a + "' is reserved"));
|
|
1637
1637
|
}
|
|
1638
1638
|
};
|
|
1639
1639
|
_.parseIdent = function(t) {
|
|
@@ -1680,13 +1680,13 @@ At.exitScope = function() {
|
|
|
1680
1680
|
this.scopeStack.pop();
|
|
1681
1681
|
};
|
|
1682
1682
|
At.treatFunctionsAsVarInScope = function(t) {
|
|
1683
|
-
return t.flags & Dt || !this.inModule && t.flags &
|
|
1683
|
+
return t.flags & Dt || !this.inModule && t.flags & Gt;
|
|
1684
1684
|
};
|
|
1685
1685
|
At.declareName = function(t, e, s) {
|
|
1686
1686
|
var a = !1;
|
|
1687
1687
|
if (e === St) {
|
|
1688
|
-
var
|
|
1689
|
-
a =
|
|
1688
|
+
var h = this.currentScope();
|
|
1689
|
+
a = h.lexical.indexOf(t) > -1 || h.functions.indexOf(t) > -1 || h.var.indexOf(t) > -1, h.lexical.push(t), this.inModule && h.flags & Gt && delete this.undefinedExports[t];
|
|
1690
1690
|
} else if (e === di) {
|
|
1691
1691
|
var l = this.currentScope();
|
|
1692
1692
|
l.lexical.push(t);
|
|
@@ -1700,7 +1700,7 @@ At.declareName = function(t, e, s) {
|
|
|
1700
1700
|
a = !0;
|
|
1701
1701
|
break;
|
|
1702
1702
|
}
|
|
1703
|
-
if (g.var.push(t), this.inModule && g.flags &
|
|
1703
|
+
if (g.var.push(t), this.inModule && g.flags & Gt && delete this.undefinedExports[t], g.flags & ue)
|
|
1704
1704
|
break;
|
|
1705
1705
|
}
|
|
1706
1706
|
a && this.raiseRecoverable(s, "Identifier '" + t + "' has already been declared");
|
|
@@ -1714,37 +1714,37 @@ At.currentScope = function() {
|
|
|
1714
1714
|
At.currentVarScope = function() {
|
|
1715
1715
|
for (var t = this.scopeStack.length - 1; ; t--) {
|
|
1716
1716
|
var e = this.scopeStack[t];
|
|
1717
|
-
if (e.flags & (ue |
|
|
1717
|
+
if (e.flags & (ue | zt | _t))
|
|
1718
1718
|
return e;
|
|
1719
1719
|
}
|
|
1720
1720
|
};
|
|
1721
1721
|
At.currentThisScope = function() {
|
|
1722
1722
|
for (var t = this.scopeStack.length - 1; ; t--) {
|
|
1723
1723
|
var e = this.scopeStack[t];
|
|
1724
|
-
if (e.flags & (ue |
|
|
1724
|
+
if (e.flags & (ue | zt | _t) && !(e.flags & Le))
|
|
1725
1725
|
return e;
|
|
1726
1726
|
}
|
|
1727
1727
|
};
|
|
1728
|
-
var
|
|
1728
|
+
var Xt = function(e, s, a) {
|
|
1729
1729
|
this.type = "", this.start = s, this.end = 0, e.options.locations && (this.loc = new Kt(e, a)), e.options.directSourceFile && (this.sourceFile = e.options.directSourceFile), e.options.ranges && (this.range = [s, 0]);
|
|
1730
|
-
},
|
|
1731
|
-
|
|
1732
|
-
return new
|
|
1730
|
+
}, Qt = H.prototype;
|
|
1731
|
+
Qt.startNode = function() {
|
|
1732
|
+
return new Xt(this, this.start, this.startLoc);
|
|
1733
1733
|
};
|
|
1734
|
-
|
|
1735
|
-
return new
|
|
1734
|
+
Qt.startNodeAt = function(t, e) {
|
|
1735
|
+
return new Xt(this, t, e);
|
|
1736
1736
|
};
|
|
1737
1737
|
function vi(t, e, s, a) {
|
|
1738
1738
|
return t.type = e, t.end = s, this.options.locations && (t.loc.end = a), this.options.ranges && (t.range[1] = s), t;
|
|
1739
1739
|
}
|
|
1740
|
-
|
|
1740
|
+
Qt.finishNode = function(t, e) {
|
|
1741
1741
|
return vi.call(this, t, e, this.lastTokEnd, this.lastTokEndLoc);
|
|
1742
1742
|
};
|
|
1743
|
-
|
|
1743
|
+
Qt.finishNodeAt = function(t, e, s, a) {
|
|
1744
1744
|
return vi.call(this, t, e, s, a);
|
|
1745
1745
|
};
|
|
1746
|
-
|
|
1747
|
-
var e = new
|
|
1746
|
+
Qt.copyNode = function(t) {
|
|
1747
|
+
var e = new Xt(this, t.start, this.startLoc);
|
|
1748
1748
|
for (var s in t)
|
|
1749
1749
|
e[s] = t[s];
|
|
1750
1750
|
return e;
|
|
@@ -1763,7 +1763,7 @@ var ws = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai
|
|
|
1763
1763
|
12: "",
|
|
1764
1764
|
13: "",
|
|
1765
1765
|
14: Es
|
|
1766
|
-
},
|
|
1766
|
+
}, Ke = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu", Ci = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb", wi = Ci + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd", ki = wi + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho", Ai = ki + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", Ei = Ai + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith", _s = Ei + " " + ws, Ns = {
|
|
1767
1767
|
9: Ci,
|
|
1768
1768
|
10: wi,
|
|
1769
1769
|
11: ki,
|
|
@@ -1773,10 +1773,10 @@ var ws = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai
|
|
|
1773
1773
|
}, Ii = {};
|
|
1774
1774
|
function Ls(t) {
|
|
1775
1775
|
var e = Ii[t] = {
|
|
1776
|
-
binary: kt(As[t] + " " +
|
|
1776
|
+
binary: kt(As[t] + " " + Ke),
|
|
1777
1777
|
binaryOfStrings: kt(Is[t]),
|
|
1778
1778
|
nonBinary: {
|
|
1779
|
-
General_Category: kt(
|
|
1779
|
+
General_Category: kt(Ke),
|
|
1780
1780
|
Script: kt(Ns[t])
|
|
1781
1781
|
}
|
|
1782
1782
|
};
|
|
@@ -1803,30 +1803,30 @@ var xt = function(e) {
|
|
|
1803
1803
|
this.parser = e, this.validFlags = "gim" + (e.options.ecmaVersion >= 6 ? "uy" : "") + (e.options.ecmaVersion >= 9 ? "s" : "") + (e.options.ecmaVersion >= 13 ? "d" : "") + (e.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = Ii[e.options.ecmaVersion >= 14 ? 14 : e.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = !1, this.switchV = !1, this.switchN = !1, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = !1, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = /* @__PURE__ */ Object.create(null), this.backReferenceNames = [], this.branchID = null;
|
|
1804
1804
|
};
|
|
1805
1805
|
xt.prototype.reset = function(e, s, a) {
|
|
1806
|
-
var
|
|
1807
|
-
this.start = e | 0, this.source = s + "", this.flags = a,
|
|
1806
|
+
var h = a.indexOf("v") !== -1, l = a.indexOf("u") !== -1;
|
|
1807
|
+
this.start = e | 0, this.source = s + "", this.flags = a, h && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU = l && this.parser.options.ecmaVersion >= 6, this.switchV = !1, this.switchN = l && this.parser.options.ecmaVersion >= 9);
|
|
1808
1808
|
};
|
|
1809
1809
|
xt.prototype.raise = function(e) {
|
|
1810
1810
|
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + e);
|
|
1811
1811
|
};
|
|
1812
1812
|
xt.prototype.at = function(e, s) {
|
|
1813
1813
|
s === void 0 && (s = !1);
|
|
1814
|
-
var a = this.source,
|
|
1815
|
-
if (e >=
|
|
1814
|
+
var a = this.source, h = a.length;
|
|
1815
|
+
if (e >= h)
|
|
1816
1816
|
return -1;
|
|
1817
1817
|
var l = a.charCodeAt(e);
|
|
1818
|
-
if (!(s || this.switchU) || l <= 55295 || l >= 57344 || e + 1 >=
|
|
1818
|
+
if (!(s || this.switchU) || l <= 55295 || l >= 57344 || e + 1 >= h)
|
|
1819
1819
|
return l;
|
|
1820
1820
|
var d = a.charCodeAt(e + 1);
|
|
1821
1821
|
return d >= 56320 && d <= 57343 ? (l << 10) + d - 56613888 : l;
|
|
1822
1822
|
};
|
|
1823
1823
|
xt.prototype.nextIndex = function(e, s) {
|
|
1824
1824
|
s === void 0 && (s = !1);
|
|
1825
|
-
var a = this.source,
|
|
1826
|
-
if (e >=
|
|
1827
|
-
return
|
|
1825
|
+
var a = this.source, h = a.length;
|
|
1826
|
+
if (e >= h)
|
|
1827
|
+
return h;
|
|
1828
1828
|
var l = a.charCodeAt(e), d;
|
|
1829
|
-
return !(s || this.switchU) || l <= 55295 || l >= 57344 || e + 1 >=
|
|
1829
|
+
return !(s || this.switchU) || l <= 55295 || l >= 57344 || e + 1 >= h || (d = a.charCodeAt(e + 1)) < 56320 || d > 57343 ? e + 1 : e + 2;
|
|
1830
1830
|
};
|
|
1831
1831
|
xt.prototype.current = function(e) {
|
|
1832
1832
|
return e === void 0 && (e = !1), this.at(this.pos, e);
|
|
@@ -1842,8 +1842,8 @@ xt.prototype.eat = function(e, s) {
|
|
|
1842
1842
|
};
|
|
1843
1843
|
xt.prototype.eatChars = function(e, s) {
|
|
1844
1844
|
s === void 0 && (s = !1);
|
|
1845
|
-
for (var a = this.pos,
|
|
1846
|
-
var d = l[
|
|
1845
|
+
for (var a = this.pos, h = 0, l = e; h < l.length; h += 1) {
|
|
1846
|
+
var d = l[h], v = this.at(a, s);
|
|
1847
1847
|
if (v === -1 || v !== d)
|
|
1848
1848
|
return !1;
|
|
1849
1849
|
a = this.nextIndex(a, s);
|
|
@@ -1851,11 +1851,11 @@ xt.prototype.eatChars = function(e, s) {
|
|
|
1851
1851
|
return this.pos = a, !0;
|
|
1852
1852
|
};
|
|
1853
1853
|
C.validateRegExpFlags = function(t) {
|
|
1854
|
-
for (var e = t.validFlags, s = t.flags, a = !1,
|
|
1854
|
+
for (var e = t.validFlags, s = t.flags, a = !1, h = !1, l = 0; l < s.length; l++) {
|
|
1855
1855
|
var d = s.charAt(l);
|
|
1856
|
-
e.indexOf(d) === -1 && this.raise(t.start, "Invalid regular expression flag"), s.indexOf(d, l + 1) > -1 && this.raise(t.start, "Duplicate regular expression flag"), d === "u" && (a = !0), d === "v" && (
|
|
1856
|
+
e.indexOf(d) === -1 && this.raise(t.start, "Invalid regular expression flag"), s.indexOf(d, l + 1) > -1 && this.raise(t.start, "Duplicate regular expression flag"), d === "u" && (a = !0), d === "v" && (h = !0);
|
|
1857
1857
|
}
|
|
1858
|
-
this.options.ecmaVersion >= 15 && a &&
|
|
1858
|
+
this.options.ecmaVersion >= 15 && a && h && this.raise(t.start, "Invalid regular expression flag");
|
|
1859
1859
|
};
|
|
1860
1860
|
function Rs(t) {
|
|
1861
1861
|
for (var e in t)
|
|
@@ -1973,15 +1973,15 @@ C.regexp_eatBracedQuantifier = function(t, e) {
|
|
|
1973
1973
|
123
|
|
1974
1974
|
/* { */
|
|
1975
1975
|
)) {
|
|
1976
|
-
var a = 0,
|
|
1976
|
+
var a = 0, h = -1;
|
|
1977
1977
|
if (this.regexp_eatDecimalDigits(t) && (a = t.lastIntValue, t.eat(
|
|
1978
1978
|
44
|
|
1979
1979
|
/* , */
|
|
1980
|
-
) && this.regexp_eatDecimalDigits(t) && (
|
|
1980
|
+
) && this.regexp_eatDecimalDigits(t) && (h = t.lastIntValue), t.eat(
|
|
1981
1981
|
125
|
|
1982
1982
|
/* } */
|
|
1983
1983
|
)))
|
|
1984
|
-
return
|
|
1984
|
+
return h !== -1 && h < a && !e && t.raise("numbers out of order in {} quantifier"), !0;
|
|
1985
1985
|
t.switchU && !e && t.raise("Incomplete quantifier"), t.pos = s;
|
|
1986
1986
|
}
|
|
1987
1987
|
return !1;
|
|
@@ -2020,9 +2020,9 @@ C.regexp_eatUncapturingGroup = function(t) {
|
|
|
2020
2020
|
/* - */
|
|
2021
2021
|
);
|
|
2022
2022
|
if (s || a) {
|
|
2023
|
-
for (var
|
|
2024
|
-
var l = s.charAt(
|
|
2025
|
-
s.indexOf(l,
|
|
2023
|
+
for (var h = 0; h < s.length; h++) {
|
|
2024
|
+
var l = s.charAt(h);
|
|
2025
|
+
s.indexOf(l, h + 1) > -1 && t.raise("Duplicate regular expression modifiers");
|
|
2026
2026
|
}
|
|
2027
2027
|
if (a) {
|
|
2028
2028
|
var d = this.regexp_eatModifiers(t);
|
|
@@ -2106,8 +2106,8 @@ C.regexp_groupSpecifier = function(t) {
|
|
|
2106
2106
|
var e = this.options.ecmaVersion >= 16, s = t.groupNames[t.lastStringValue];
|
|
2107
2107
|
if (s)
|
|
2108
2108
|
if (e)
|
|
2109
|
-
for (var a = 0,
|
|
2110
|
-
var l =
|
|
2109
|
+
for (var a = 0, h = s; a < h.length; a += 1) {
|
|
2110
|
+
var l = h[a];
|
|
2111
2111
|
l.separatedFrom(t.branchID) || t.raise("Duplicate capture group name");
|
|
2112
2112
|
}
|
|
2113
2113
|
else
|
|
@@ -2214,8 +2214,8 @@ C.regexp_eatRegExpUnicodeEscapeSequence = function(t, e) {
|
|
|
2214
2214
|
/* u */
|
|
2215
2215
|
)) {
|
|
2216
2216
|
if (this.regexp_eatFixedHexDigits(t, 4)) {
|
|
2217
|
-
var
|
|
2218
|
-
if (a &&
|
|
2217
|
+
var h = t.lastIntValue;
|
|
2218
|
+
if (a && h >= 55296 && h <= 56319) {
|
|
2219
2219
|
var l = t.pos;
|
|
2220
2220
|
if (t.eat(
|
|
2221
2221
|
92
|
|
@@ -2226,9 +2226,9 @@ C.regexp_eatRegExpUnicodeEscapeSequence = function(t, e) {
|
|
|
2226
2226
|
) && this.regexp_eatFixedHexDigits(t, 4)) {
|
|
2227
2227
|
var d = t.lastIntValue;
|
|
2228
2228
|
if (d >= 56320 && d <= 57343)
|
|
2229
|
-
return t.lastIntValue = (
|
|
2229
|
+
return t.lastIntValue = (h - 55296) * 1024 + (d - 56320) + 65536, !0;
|
|
2230
2230
|
}
|
|
2231
|
-
t.pos = l, t.lastIntValue =
|
|
2231
|
+
t.pos = l, t.lastIntValue = h;
|
|
2232
2232
|
}
|
|
2233
2233
|
return !0;
|
|
2234
2234
|
}
|
|
@@ -2304,8 +2304,8 @@ C.regexp_eatUnicodePropertyValueExpression = function(t) {
|
|
|
2304
2304
|
}
|
|
2305
2305
|
}
|
|
2306
2306
|
if (t.pos = e, this.regexp_eatLoneUnicodePropertyNameOrValue(t)) {
|
|
2307
|
-
var
|
|
2308
|
-
return this.regexp_validateUnicodePropertyNameOrValue(t,
|
|
2307
|
+
var h = t.lastStringValue;
|
|
2308
|
+
return this.regexp_validateUnicodePropertyNameOrValue(t, h);
|
|
2309
2309
|
}
|
|
2310
2310
|
return Li;
|
|
2311
2311
|
};
|
|
@@ -2481,9 +2481,9 @@ C.regexp_eatNestedClass = function(t) {
|
|
|
2481
2481
|
92
|
|
2482
2482
|
/* \ */
|
|
2483
2483
|
)) {
|
|
2484
|
-
var
|
|
2485
|
-
if (
|
|
2486
|
-
return
|
|
2484
|
+
var h = this.regexp_eatCharacterClassEscape(t);
|
|
2485
|
+
if (h)
|
|
2486
|
+
return h;
|
|
2487
2487
|
t.pos = e;
|
|
2488
2488
|
}
|
|
2489
2489
|
return null;
|
|
@@ -2609,10 +2609,10 @@ C.regexp_eatFixedHexDigits = function(t, e) {
|
|
|
2609
2609
|
var s = t.pos;
|
|
2610
2610
|
t.lastIntValue = 0;
|
|
2611
2611
|
for (var a = 0; a < e; ++a) {
|
|
2612
|
-
var
|
|
2613
|
-
if (!Ri(
|
|
2612
|
+
var h = t.current();
|
|
2613
|
+
if (!Ri(h))
|
|
2614
2614
|
return t.pos = s, !1;
|
|
2615
|
-
t.lastIntValue = 16 * t.lastIntValue + Mi(
|
|
2615
|
+
t.lastIntValue = 16 * t.lastIntValue + Mi(h), t.advance();
|
|
2616
2616
|
}
|
|
2617
2617
|
return !0;
|
|
2618
2618
|
};
|
|
@@ -2658,8 +2658,8 @@ R.fullCharCodeAtPos = function() {
|
|
|
2658
2658
|
R.skipBlockComment = function() {
|
|
2659
2659
|
var t = this.options.onComment && this.curPosition(), e = this.pos, s = this.input.indexOf("*/", this.pos += 2);
|
|
2660
2660
|
if (s === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = s + 2, this.options.locations)
|
|
2661
|
-
for (var a = void 0,
|
|
2662
|
-
++this.curLine,
|
|
2661
|
+
for (var a = void 0, h = e; (a = hi(this.input, h, this.pos)) > -1; )
|
|
2662
|
+
++this.curLine, h = this.lineStart = a;
|
|
2663
2663
|
this.options.onComment && this.options.onComment(
|
|
2664
2664
|
!0,
|
|
2665
2665
|
this.input.slice(e + 2, s),
|
|
@@ -2898,24 +2898,24 @@ R.readRegexp = function() {
|
|
|
2898
2898
|
}
|
|
2899
2899
|
++this.pos;
|
|
2900
2900
|
}
|
|
2901
|
-
var
|
|
2901
|
+
var h = this.input.slice(s, this.pos);
|
|
2902
2902
|
++this.pos;
|
|
2903
2903
|
var l = this.pos, d = this.readWord1();
|
|
2904
2904
|
this.containsEsc && this.unexpected(l);
|
|
2905
2905
|
var v = this.regexpState || (this.regexpState = new xt(this));
|
|
2906
|
-
v.reset(s,
|
|
2906
|
+
v.reset(s, h, d), this.validateRegExpFlags(v), this.validateRegExpPattern(v);
|
|
2907
2907
|
var g = null;
|
|
2908
2908
|
try {
|
|
2909
|
-
g = new RegExp(
|
|
2909
|
+
g = new RegExp(h, d);
|
|
2910
2910
|
} catch {
|
|
2911
2911
|
}
|
|
2912
|
-
return this.finishToken(u.regexp, { pattern:
|
|
2912
|
+
return this.finishToken(u.regexp, { pattern: h, flags: d, value: g });
|
|
2913
2913
|
};
|
|
2914
2914
|
R.readInt = function(t, e, s) {
|
|
2915
|
-
for (var a = this.options.ecmaVersion >= 12 && e === void 0,
|
|
2915
|
+
for (var a = this.options.ecmaVersion >= 12 && e === void 0, h = s && this.input.charCodeAt(this.pos) === 48, l = this.pos, d = 0, v = 0, g = 0, o = e ?? 1 / 0; g < o; ++g, ++this.pos) {
|
|
2916
2916
|
var P = this.input.charCodeAt(this.pos), N = void 0;
|
|
2917
2917
|
if (a && P === 95) {
|
|
2918
|
-
|
|
2918
|
+
h && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"), v === 95 && this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"), g === 0 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"), v = P;
|
|
2919
2919
|
continue;
|
|
2920
2920
|
}
|
|
2921
2921
|
if (P >= 97 ? N = P - 97 + 10 : P >= 65 ? N = P - 65 + 10 : P >= 48 && P <= 57 ? N = P - 48 : N = 1 / 0, N >= t)
|
|
@@ -2943,8 +2943,8 @@ R.readNumber = function(t) {
|
|
|
2943
2943
|
s && this.strict && this.raise(e, "Invalid number");
|
|
2944
2944
|
var a = this.input.charCodeAt(this.pos);
|
|
2945
2945
|
if (!s && !t && this.options.ecmaVersion >= 11 && a === 110) {
|
|
2946
|
-
var
|
|
2947
|
-
return ++this.pos, ft(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(u.num,
|
|
2946
|
+
var h = Vi(this.input.slice(e, this.pos));
|
|
2947
|
+
return ++this.pos, ft(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(u.num, h);
|
|
2948
2948
|
}
|
|
2949
2949
|
s && /[89]/.test(this.input.slice(e, this.pos)) && (s = !1), a === 46 && !s && (++this.pos, this.readInt(10), a = this.input.charCodeAt(this.pos)), (a === 69 || a === 101) && !s && (a = this.input.charCodeAt(++this.pos), (a === 43 || a === 45) && ++this.pos, this.readInt(10) === null && this.raise(e, "Invalid number")), ft(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
2950
2950
|
var l = $s(this.input.slice(e, this.pos), s);
|
|
@@ -3085,11 +3085,11 @@ R.readEscapedChar = function(t) {
|
|
|
3085
3085
|
}
|
|
3086
3086
|
default:
|
|
3087
3087
|
if (e >= 48 && e <= 55) {
|
|
3088
|
-
var a = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0],
|
|
3089
|
-
return
|
|
3088
|
+
var a = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0], h = parseInt(a, 8);
|
|
3089
|
+
return h > 255 && (a = a.slice(0, -1), h = parseInt(a, 8)), this.pos += a.length - 1, e = this.input.charCodeAt(this.pos), (a !== "0" || e === 56 || e === 57) && (this.strict || t) && this.invalidStringToken(
|
|
3090
3090
|
this.pos - 1 - a.length,
|
|
3091
3091
|
t ? "Octal literal in template string" : "Octal literal in strict mode"
|
|
3092
|
-
), String.fromCharCode(
|
|
3092
|
+
), String.fromCharCode(h);
|
|
3093
3093
|
}
|
|
3094
3094
|
return It(e) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(e);
|
|
3095
3095
|
}
|
|
@@ -3101,10 +3101,10 @@ R.readHexChar = function(t) {
|
|
|
3101
3101
|
R.readWord1 = function() {
|
|
3102
3102
|
this.containsEsc = !1;
|
|
3103
3103
|
for (var t = "", e = !0, s = this.pos, a = this.options.ecmaVersion >= 6; this.pos < this.input.length; ) {
|
|
3104
|
-
var
|
|
3105
|
-
if (gt(
|
|
3106
|
-
this.pos +=
|
|
3107
|
-
else if (
|
|
3104
|
+
var h = this.fullCharCodeAtPos();
|
|
3105
|
+
if (gt(h, a))
|
|
3106
|
+
this.pos += h <= 65535 ? 1 : 2;
|
|
3107
|
+
else if (h === 92) {
|
|
3108
3108
|
this.containsEsc = !0, t += this.input.slice(s, this.pos);
|
|
3109
3109
|
var l = this.pos;
|
|
3110
3110
|
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
@@ -3128,7 +3128,7 @@ H.acorn = {
|
|
|
3128
3128
|
Position: Rt,
|
|
3129
3129
|
SourceLocation: Kt,
|
|
3130
3130
|
getLineInfo: _e,
|
|
3131
|
-
Node:
|
|
3131
|
+
Node: Xt,
|
|
3132
3132
|
TokenType: O,
|
|
3133
3133
|
tokTypes: u,
|
|
3134
3134
|
keywordTypes: Ot,
|
|
@@ -3145,15 +3145,15 @@ H.acorn = {
|
|
|
3145
3145
|
function Gs(t, e) {
|
|
3146
3146
|
return H.parse(t, e);
|
|
3147
3147
|
}
|
|
3148
|
-
function
|
|
3148
|
+
function Ws(t, e, s) {
|
|
3149
3149
|
return H.parseExpressionAt(t, e, s);
|
|
3150
3150
|
}
|
|
3151
|
-
function
|
|
3151
|
+
function Ks(t, e) {
|
|
3152
3152
|
return H.tokenizer(t, e);
|
|
3153
3153
|
}
|
|
3154
3154
|
const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3155
3155
|
__proto__: null,
|
|
3156
|
-
Node:
|
|
3156
|
+
Node: Xt,
|
|
3157
3157
|
Parser: H,
|
|
3158
3158
|
Position: Rt,
|
|
3159
3159
|
SourceLocation: Kt,
|
|
@@ -3170,16 +3170,16 @@ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3170
3170
|
lineBreakG: oi,
|
|
3171
3171
|
nonASCIIwhitespace: Ie,
|
|
3172
3172
|
parse: Gs,
|
|
3173
|
-
parseExpressionAt:
|
|
3173
|
+
parseExpressionAt: Ws,
|
|
3174
3174
|
tokContexts: F,
|
|
3175
3175
|
tokTypes: u,
|
|
3176
|
-
tokenizer:
|
|
3176
|
+
tokenizer: Ks,
|
|
3177
3177
|
version: ji
|
|
3178
3178
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3179
3179
|
function Xe(t, e) {
|
|
3180
3180
|
for (var s = 0; s < e.length; s++) {
|
|
3181
3181
|
var a = e[s];
|
|
3182
|
-
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(t, typeof (
|
|
3182
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(t, typeof (h = (function(l, d) {
|
|
3183
3183
|
if (typeof l != "object" || l === null) return l;
|
|
3184
3184
|
var v = l[Symbol.toPrimitive];
|
|
3185
3185
|
if (v !== void 0) {
|
|
@@ -3188,9 +3188,9 @@ function Xe(t, e) {
|
|
|
3188
3188
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3189
3189
|
}
|
|
3190
3190
|
return String(l);
|
|
3191
|
-
})(a.key)) == "symbol" ?
|
|
3191
|
+
})(a.key)) == "symbol" ? h : String(h), a);
|
|
3192
3192
|
}
|
|
3193
|
-
var
|
|
3193
|
+
var h;
|
|
3194
3194
|
}
|
|
3195
3195
|
function ne() {
|
|
3196
3196
|
return ne = Object.assign ? Object.assign.bind() : function(t) {
|
|
@@ -3201,7 +3201,7 @@ function ne() {
|
|
|
3201
3201
|
return t;
|
|
3202
3202
|
}, ne.apply(this, arguments);
|
|
3203
3203
|
}
|
|
3204
|
-
function
|
|
3204
|
+
function te(t, e) {
|
|
3205
3205
|
t.prototype = Object.create(e.prototype), t.prototype.constructor = t, ke(t, e);
|
|
3206
3206
|
}
|
|
3207
3207
|
function ke(t, e) {
|
|
@@ -3217,11 +3217,11 @@ function Qe(t, e) {
|
|
|
3217
3217
|
function Je(t, e) {
|
|
3218
3218
|
var s = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
3219
3219
|
if (s) return (s = s.call(t)).next.bind(s);
|
|
3220
|
-
if (Array.isArray(t) || (s = (function(
|
|
3221
|
-
if (
|
|
3222
|
-
if (typeof
|
|
3223
|
-
var d = Object.prototype.toString.call(
|
|
3224
|
-
return d === "Object" &&
|
|
3220
|
+
if (Array.isArray(t) || (s = (function(h, l) {
|
|
3221
|
+
if (h) {
|
|
3222
|
+
if (typeof h == "string") return Qe(h, l);
|
|
3223
|
+
var d = Object.prototype.toString.call(h).slice(8, -1);
|
|
3224
|
+
return d === "Object" && h.constructor && (d = h.constructor.name), d === "Map" || d === "Set" ? Array.from(h) : d === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d) ? Qe(h, l) : void 0;
|
|
3225
3225
|
}
|
|
3226
3226
|
})(t)) || e) {
|
|
3227
3227
|
s && (t = s);
|
|
@@ -3241,13 +3241,13 @@ var Xs = /* @__PURE__ */ new WeakMap();
|
|
|
3241
3241
|
function Qs(t) {
|
|
3242
3242
|
var e = Xs.get(t.Parser.acorn || t);
|
|
3243
3243
|
if (!e) {
|
|
3244
|
-
var s = { assert: rt(0, { startsExpr: st }), asserts: rt(0, { startsExpr: st }), global: rt(0, { startsExpr: st }), keyof: rt(0, { startsExpr: st }), readonly: rt(0, { startsExpr: st }), unique: rt(0, { startsExpr: st }), abstract: rt(0, { startsExpr: st }), declare: rt(0, { startsExpr: st }), enum: rt(0, { startsExpr: st }), module: rt(0, { startsExpr: st }), namespace: rt(0, { startsExpr: st }), interface: rt(0, { startsExpr: st }), type: rt(0, { startsExpr: st }) }, a = { at: new O("@"), jsxName: new O("jsxName"), jsxText: new O("jsxText", { beforeExpr: !0 }), jsxTagStart: new O("jsxTagStart", { startsExpr: !0 }), jsxTagEnd: new O("jsxTagEnd") },
|
|
3244
|
+
var s = { assert: rt(0, { startsExpr: st }), asserts: rt(0, { startsExpr: st }), global: rt(0, { startsExpr: st }), keyof: rt(0, { startsExpr: st }), readonly: rt(0, { startsExpr: st }), unique: rt(0, { startsExpr: st }), abstract: rt(0, { startsExpr: st }), declare: rt(0, { startsExpr: st }), enum: rt(0, { startsExpr: st }), module: rt(0, { startsExpr: st }), namespace: rt(0, { startsExpr: st }), interface: rt(0, { startsExpr: st }), type: rt(0, { startsExpr: st }) }, a = { at: new O("@"), jsxName: new O("jsxName"), jsxText: new O("jsxText", { beforeExpr: !0 }), jsxTagStart: new O("jsxTagStart", { startsExpr: !0 }), jsxTagEnd: new O("jsxTagEnd") }, h = { tc_oTag: new X("<tag", !1, !1), tc_cTag: new X("</tag", !1, !1), tc_expr: new X("<tag>...</tag>", !0, !0) }, l = new RegExp("^(?:" + Object.keys(s).join("|") + ")$");
|
|
3245
3245
|
a.jsxTagStart.updateContext = function() {
|
|
3246
|
-
this.context.push(
|
|
3246
|
+
this.context.push(h.tc_expr), this.context.push(h.tc_oTag), this.exprAllowed = !1;
|
|
3247
3247
|
}, a.jsxTagEnd.updateContext = function(d) {
|
|
3248
3248
|
var v = this.context.pop();
|
|
3249
|
-
v ===
|
|
3250
|
-
}, e = { tokTypes: ne({}, s, a), tokContexts: ne({},
|
|
3249
|
+
v === h.tc_oTag && d === u.slash || v === h.tc_cTag ? (this.context.pop(), this.exprAllowed = this.curContext() === h.tc_expr) : this.exprAllowed = !0;
|
|
3250
|
+
}, e = { tokTypes: ne({}, s, a), tokContexts: ne({}, h), keywordsRegExp: l, tokenIsLiteralPropertyName: function(d) {
|
|
3251
3251
|
return [u.name, u.string, u.num].concat(Object.values(Ot), Object.values(s)).includes(d);
|
|
3252
3252
|
}, tokenIsKeywordOrIdentifier: function(d) {
|
|
3253
3253
|
return [u.name].concat(Object.values(Ot), Object.values(s)).includes(d);
|
|
@@ -3267,8 +3267,8 @@ var Bt = 1024, Js = new RegExp("(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?
|
|
|
3267
3267
|
this.shorthandAssign = void 0, this.trailingComma = void 0, this.parenthesizedAssign = void 0, this.parenthesizedBind = void 0, this.doubleProto = void 0, this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
3268
3268
|
};
|
|
3269
3269
|
function Ys(t, e) {
|
|
3270
|
-
var s = e.key.name, a = t[s],
|
|
3271
|
-
return e.type !== "MethodDefinition" || e.kind !== "get" && e.kind !== "set" || (
|
|
3270
|
+
var s = e.key.name, a = t[s], h = "true";
|
|
3271
|
+
return e.type !== "MethodDefinition" || e.kind !== "get" && e.kind !== "set" || (h = (e.static ? "s" : "i") + e.kind), a === "iget" && h === "iset" || a === "iset" && h === "iget" || a === "sget" && h === "sset" || a === "sset" && h === "sget" ? (t[s] = "true", !1) : !!a || (t[s] = h, !1);
|
|
3272
3272
|
}
|
|
3273
3273
|
function Ze(t, e) {
|
|
3274
3274
|
var s = t.key;
|
|
@@ -3312,8 +3312,8 @@ var A = { AbstractMethodHasImplementation: function(t) {
|
|
|
3312
3312
|
}, StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.", TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.", TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.", UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", GenericsEndWithComma: "Trailing comma is not allowed at the end of generics.", UnexpectedTypeAnnotation: "Did not expect a type annotation here.", UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.", UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", UnsupportedSignatureParameterKind: function(t) {
|
|
3313
3313
|
return "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got " + t.type + ".";
|
|
3314
3314
|
}, LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Zs = { quot: '"', amp: "&", apos: "'", lt: "<", gt: ">", nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", fnof: "ƒ", circ: "ˆ", tilde: "˜", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", ensp: " ", emsp: " ", thinsp: " ", zwnj: "", zwj: "", lrm: "", rlm: "", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", bull: "•", hellip: "…", permil: "‰", prime: "′", Prime: "″", lsaquo: "‹", rsaquo: "›", oline: "‾", frasl: "⁄", euro: "€", image: "ℑ", weierp: "℘", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "∧", or: "∨", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦" }, tr = /^[\da-fA-F]+$/, er = /^\d+$/;
|
|
3315
|
-
function
|
|
3316
|
-
return t && (t.type === "JSXIdentifier" ? t.name : t.type === "JSXNamespacedName" ? t.namespace.name + ":" + t.name.name : t.type === "JSXMemberExpression" ?
|
|
3315
|
+
function $t(t) {
|
|
3316
|
+
return t && (t.type === "JSXIdentifier" ? t.name : t.type === "JSXNamespacedName" ? t.namespace.name + ":" + t.name.name : t.type === "JSXMemberExpression" ? $t(t.object) + "." + $t(t.property) : void 0);
|
|
3317
3317
|
}
|
|
3318
3318
|
var Te = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
3319
3319
|
function ti(t) {
|
|
@@ -3340,9 +3340,9 @@ function ei(t) {
|
|
|
3340
3340
|
return t === "private" || t === "public" || t === "protected";
|
|
3341
3341
|
}
|
|
3342
3342
|
function ar(t) {
|
|
3343
|
-
var e = {}, s = e.dts, a = s !== void 0 && s,
|
|
3343
|
+
var e = {}, s = e.dts, a = s !== void 0 && s, h = e.allowSatisfies, l = h !== void 0 && h;
|
|
3344
3344
|
return function(d) {
|
|
3345
|
-
var v = d.acorn || zs, g = Qs(v),
|
|
3345
|
+
var v = d.acorn || zs, g = Qs(v), o = v.tokTypes, P = v.keywordTypes, N = v.isIdentifierStart, j = v.lineBreak, nt = v.isNewLine, lt = v.tokContexts, Nt = v.isIdentifierChar, I = g.tokTypes, Z = g.tokContexts, fe = g.keywordsRegExp, $i = g.tokenIsLiteralPropertyName, Gi = g.tokenIsTemplate, Wi = g.tokenIsTSDeclarationStart, V = g.tokenIsIdentifier, Jt = g.tokenIsKeywordOrIdentifier, Ki = g.tokenIsTSTypeOperator;
|
|
3346
3346
|
function zi(S, tt, z) {
|
|
3347
3347
|
z === void 0 && (z = S.length);
|
|
3348
3348
|
for (var $ = tt; $ < z; $++) {
|
|
@@ -3357,7 +3357,7 @@ function ar(t) {
|
|
|
3357
3357
|
function i() {
|
|
3358
3358
|
return p.apply(this, arguments) || this;
|
|
3359
3359
|
}
|
|
3360
|
-
|
|
3360
|
+
te(i, p);
|
|
3361
3361
|
var r = i.prototype;
|
|
3362
3362
|
return r.takeDecorators = function(n) {
|
|
3363
3363
|
var c = this.decoratorStack[this.decoratorStack.length - 1];
|
|
@@ -3397,7 +3397,7 @@ function ar(t) {
|
|
|
3397
3397
|
function f() {
|
|
3398
3398
|
return c.apply(this, arguments) || this;
|
|
3399
3399
|
}
|
|
3400
|
-
|
|
3400
|
+
te(f, c);
|
|
3401
3401
|
var m = f.prototype;
|
|
3402
3402
|
return m.jsx_readToken = function() {
|
|
3403
3403
|
for (var y = "", x = this.pos; ; ) {
|
|
@@ -3512,7 +3512,7 @@ function ar(t) {
|
|
|
3512
3512
|
default:
|
|
3513
3513
|
this.unexpected();
|
|
3514
3514
|
}
|
|
3515
|
-
|
|
3515
|
+
$t(L.name) !== $t(E.name) && this.raise(L.start, "Expected corresponding JSX closing tag for <" + $t(E.name) + ">");
|
|
3516
3516
|
}
|
|
3517
3517
|
var w = E.name ? "Element" : "Fragment";
|
|
3518
3518
|
return b["opening" + w] = E, b["closing" + w] = L, b.children = T, this.type === D.relational && this.value === "<" && this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag"), this.finishNode(b, "JSX" + w);
|
|
@@ -3530,7 +3530,7 @@ function ar(t) {
|
|
|
3530
3530
|
function i() {
|
|
3531
3531
|
return p.apply(this, arguments) || this;
|
|
3532
3532
|
}
|
|
3533
|
-
|
|
3533
|
+
te(i, p);
|
|
3534
3534
|
var r = i.prototype;
|
|
3535
3535
|
return r.parseMaybeImportAttributes = function(n) {
|
|
3536
3536
|
if (this.type === D._with || this.type === $.assert) {
|
|
@@ -3561,10 +3561,10 @@ function ar(t) {
|
|
|
3561
3561
|
return f;
|
|
3562
3562
|
})(c), { allowedModifiers: ["const"], disallowedModifiers: ["in", "out"], errorTemplate: A.InvalidModifierOnTypeParameterPositions }), c;
|
|
3563
3563
|
}
|
|
3564
|
-
|
|
3564
|
+
te(tt, S);
|
|
3565
3565
|
var z, $, D, p = tt.prototype;
|
|
3566
3566
|
return p.getTokenFromCodeInType = function(i) {
|
|
3567
|
-
return i === 62 || i === 60 ? this.finishOp(
|
|
3567
|
+
return i === 62 || i === 60 ? this.finishOp(o.relational, 1) : S.prototype.getTokenFromCode.call(this, i);
|
|
3568
3568
|
}, p.readToken = function(i) {
|
|
3569
3569
|
if (!this.inType) {
|
|
3570
3570
|
var r = this.curContext();
|
|
@@ -3580,7 +3580,7 @@ function ar(t) {
|
|
|
3580
3580
|
}, p.getTokenFromCode = function(i) {
|
|
3581
3581
|
return this.inType ? this.getTokenFromCodeInType(i) : i === 64 ? (++this.pos, this.finishToken(I.at)) : S.prototype.getTokenFromCode.call(this, i);
|
|
3582
3582
|
}, p.isAbstractClass = function() {
|
|
3583
|
-
return this.ts_isContextual(I.abstract) && this.lookahead().type ===
|
|
3583
|
+
return this.ts_isContextual(I.abstract) && this.lookahead().type === o._class;
|
|
3584
3584
|
}, p.finishNode = function(i, r) {
|
|
3585
3585
|
return i.type !== "" && i.end !== 0 ? i : S.prototype.finishNode.call(this, i, r);
|
|
3586
3586
|
}, p.tryParse = function(i, r) {
|
|
@@ -3600,10 +3600,10 @@ function ar(t) {
|
|
|
3600
3600
|
var n;
|
|
3601
3601
|
i.optionalParametersLoc = (n = r?.loc) != null ? n : this.startLoc;
|
|
3602
3602
|
}, p.reScan_lt_gt = function() {
|
|
3603
|
-
this.type ===
|
|
3603
|
+
this.type === o.relational && (this.pos -= 1, this.readToken_lt_gt(this.fullCharCodeAtPos()));
|
|
3604
3604
|
}, p.reScan_lt = function() {
|
|
3605
3605
|
var i = this.type;
|
|
3606
|
-
return i ===
|
|
3606
|
+
return i === o.bitShift ? (this.pos -= 2, this.finishOp(o.relational, 1), o.relational) : i;
|
|
3607
3607
|
}, p.resetEndLocation = function(i, r) {
|
|
3608
3608
|
r === void 0 && (r = this.lastTokEndLoc), i.end = r.column, i.loc.end = r, this.options.ranges && (i.range[1] = r.column);
|
|
3609
3609
|
}, p.startNodeAtNode = function(i) {
|
|
@@ -3626,7 +3626,7 @@ function ar(t) {
|
|
|
3626
3626
|
}, p.tsIsIdentifier = function() {
|
|
3627
3627
|
return V(this.type);
|
|
3628
3628
|
}, p.tsTryParseTypeOrTypePredicateAnnotation = function() {
|
|
3629
|
-
return this.match(
|
|
3629
|
+
return this.match(o.colon) ? this.tsParseTypeOrTypePredicateAnnotation(o.colon) : void 0;
|
|
3630
3630
|
}, p.tsTryParseGenericAsyncArrowFunction = function(i, r, n) {
|
|
3631
3631
|
var c = this;
|
|
3632
3632
|
if (this.tsMatchLeftRelational()) {
|
|
@@ -3634,12 +3634,12 @@ function ar(t) {
|
|
|
3634
3634
|
this.maybeInArrowParameters = !0;
|
|
3635
3635
|
var m = this.tsTryParseAndCatch(function() {
|
|
3636
3636
|
var y = c.startNodeAt(i, r);
|
|
3637
|
-
return y.typeParameters = c.tsParseTypeParameters(), S.prototype.parseFunctionParams.call(c, y), y.returnType = c.tsTryParseTypeOrTypePredicateAnnotation(), c.expect(
|
|
3637
|
+
return y.typeParameters = c.tsParseTypeParameters(), S.prototype.parseFunctionParams.call(c, y), y.returnType = c.tsTryParseTypeOrTypePredicateAnnotation(), c.expect(o.arrow), y;
|
|
3638
3638
|
});
|
|
3639
3639
|
if (this.maybeInArrowParameters = f, m) return S.prototype.parseArrowExpression.call(this, m, null, !0, n);
|
|
3640
3640
|
}
|
|
3641
3641
|
}, p.tsParseTypeArgumentsInExpression = function() {
|
|
3642
|
-
if (this.reScan_lt() ===
|
|
3642
|
+
if (this.reScan_lt() === o.relational) return this.tsParseTypeArguments();
|
|
3643
3643
|
}, p.tsInNoContext = function(i) {
|
|
3644
3644
|
var r = this.context;
|
|
3645
3645
|
this.context = [r[0]];
|
|
@@ -3649,7 +3649,7 @@ function ar(t) {
|
|
|
3649
3649
|
this.context = r;
|
|
3650
3650
|
}
|
|
3651
3651
|
}, p.tsTryParseTypeAnnotation = function() {
|
|
3652
|
-
return this.match(
|
|
3652
|
+
return this.match(o.colon) ? this.tsParseTypeAnnotation() : void 0;
|
|
3653
3653
|
}, p.isUnparsedContextual = function(i, r) {
|
|
3654
3654
|
var n = i + r.length;
|
|
3655
3655
|
if (this.input.slice(i, n) === r) {
|
|
@@ -3658,7 +3658,7 @@ function ar(t) {
|
|
|
3658
3658
|
}
|
|
3659
3659
|
return !1;
|
|
3660
3660
|
}, p.isAbstractConstructorSignature = function() {
|
|
3661
|
-
return this.ts_isContextual(I.abstract) && this.lookahead().type ===
|
|
3661
|
+
return this.ts_isContextual(I.abstract) && this.lookahead().type === o._new;
|
|
3662
3662
|
}, p.nextTokenStartSince = function(i) {
|
|
3663
3663
|
return Te.lastIndex = i, Te.test(this.input) ? Te.lastIndex : i;
|
|
3664
3664
|
}, p.lookaheadCharCode = function() {
|
|
@@ -3688,7 +3688,7 @@ function ar(t) {
|
|
|
3688
3688
|
var c = this.getCurLookaheadState();
|
|
3689
3689
|
return this.setLookaheadState(r), c;
|
|
3690
3690
|
}, p.readWord = function() {
|
|
3691
|
-
var i = this.readWord1(), r =
|
|
3691
|
+
var i = this.readWord1(), r = o.name;
|
|
3692
3692
|
return this.keywords.test(i) ? r = P[i] : new RegExp(fe).test(i) && (r = I[i]), this.finishToken(r, i);
|
|
3693
3693
|
}, p.skipBlockComment = function() {
|
|
3694
3694
|
var i;
|
|
@@ -3708,7 +3708,7 @@ function ar(t) {
|
|
|
3708
3708
|
}, p.resetStartLocation = function(i, r, n) {
|
|
3709
3709
|
i.start = r, i.loc.start = n, this.options.ranges && (i.range[0] = r);
|
|
3710
3710
|
}, p.isLineTerminator = function() {
|
|
3711
|
-
return this.eat(
|
|
3711
|
+
return this.eat(o.semi) || S.prototype.canInsertSemicolon.call(this);
|
|
3712
3712
|
}, p.hasFollowingLineBreak = function() {
|
|
3713
3713
|
return Ye.lastIndex = this.end, Ye.test(this.input);
|
|
3714
3714
|
}, p.addExtra = function(i, r, n, c) {
|
|
@@ -3736,9 +3736,9 @@ function ar(t) {
|
|
|
3736
3736
|
}, p.ts_isContextualWithState = function(i, r) {
|
|
3737
3737
|
return i.type === r && !i.containsEsc;
|
|
3738
3738
|
}, p.isContextualWithState = function(i, r) {
|
|
3739
|
-
return r.type ===
|
|
3739
|
+
return r.type === o.name && r.value === i && !r.containsEsc;
|
|
3740
3740
|
}, p.tsIsStartOfMappedType = function() {
|
|
3741
|
-
return this.next(), this.eat(
|
|
3741
|
+
return this.next(), this.eat(o.plusMin) ? this.ts_isContextual(I.readonly) : (this.ts_isContextual(I.readonly) && this.next(), !!this.match(o.bracketL) && (this.next(), !!this.tsIsIdentifier() && (this.next(), this.match(o._in))));
|
|
3742
3742
|
}, p.tsInDisallowConditionalTypesContext = function(i) {
|
|
3743
3743
|
var r = this.inDisallowConditionalTypesContext;
|
|
3744
3744
|
this.inDisallowConditionalTypesContext = !0;
|
|
@@ -3748,7 +3748,7 @@ function ar(t) {
|
|
|
3748
3748
|
this.inDisallowConditionalTypesContext = r;
|
|
3749
3749
|
}
|
|
3750
3750
|
}, p.tsTryParseType = function() {
|
|
3751
|
-
return this.tsEatThenParseType(
|
|
3751
|
+
return this.tsEatThenParseType(o.colon);
|
|
3752
3752
|
}, p.match = function(i) {
|
|
3753
3753
|
return this.type === i;
|
|
3754
3754
|
}, p.matchJsx = function(i) {
|
|
@@ -3771,45 +3771,45 @@ function ar(t) {
|
|
|
3771
3771
|
for (var f = 0; f < r; f++) this.next();
|
|
3772
3772
|
return !0;
|
|
3773
3773
|
}, p.canHaveLeadingDecorator = function() {
|
|
3774
|
-
return this.match(
|
|
3774
|
+
return this.match(o._class);
|
|
3775
3775
|
}, p.eatContextual = function(i) {
|
|
3776
3776
|
return fe.test(i) ? !!this.ts_isContextual(I[i]) && (this.next(), !0) : S.prototype.eatContextual.call(this, i);
|
|
3777
3777
|
}, p.tsIsExternalModuleReference = function() {
|
|
3778
3778
|
return this.isContextual("require") && this.lookaheadCharCode() === 40;
|
|
3779
3779
|
}, p.tsParseExternalModuleReference = function() {
|
|
3780
3780
|
var i = this.startNode();
|
|
3781
|
-
return this.expectContextual("require"), this.expect(
|
|
3781
|
+
return this.expectContextual("require"), this.expect(o.parenL), this.match(o.string) || this.unexpected(), i.expression = this.parseExprAtom(), this.expect(o.parenR), this.finishNode(i, "TSExternalModuleReference");
|
|
3782
3782
|
}, p.tsParseEntityName = function(i) {
|
|
3783
3783
|
i === void 0 && (i = !0);
|
|
3784
|
-
for (var r = this.parseIdent(i); this.eat(
|
|
3784
|
+
for (var r = this.parseIdent(i); this.eat(o.dot); ) {
|
|
3785
3785
|
var n = this.startNodeAtNode(r);
|
|
3786
3786
|
n.left = r, n.right = this.parseIdent(i), r = this.finishNode(n, "TSQualifiedName");
|
|
3787
3787
|
}
|
|
3788
3788
|
return r;
|
|
3789
3789
|
}, p.tsParseEnumMember = function() {
|
|
3790
3790
|
var i = this.startNode();
|
|
3791
|
-
return i.id = this.match(
|
|
3791
|
+
return i.id = this.match(o.string) ? this.parseLiteral(this.value) : this.parseIdent(!0), this.eat(o.eq) && (i.initializer = this.parseMaybeAssign()), this.finishNode(i, "TSEnumMember");
|
|
3792
3792
|
}, p.tsParseEnumDeclaration = function(i, r) {
|
|
3793
|
-
return r === void 0 && (r = {}), r.const && (i.const = !0), r.declare && (i.declare = !0), this.expectContextual("enum"), i.id = this.parseIdent(), this.checkLValSimple(i.id), this.expect(
|
|
3793
|
+
return r === void 0 && (r = {}), r.const && (i.const = !0), r.declare && (i.declare = !0), this.expectContextual("enum"), i.id = this.parseIdent(), this.checkLValSimple(i.id), this.expect(o.braceL), i.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)), this.expect(o.braceR), this.finishNode(i, "TSEnumDeclaration");
|
|
3794
3794
|
}, p.tsParseModuleBlock = function() {
|
|
3795
3795
|
var i = this.startNode();
|
|
3796
|
-
for (S.prototype.enterScope.call(this, 512), this.expect(
|
|
3796
|
+
for (S.prototype.enterScope.call(this, 512), this.expect(o.braceL), i.body = []; this.type !== o.braceR; ) {
|
|
3797
3797
|
var r = this.parseStatement(null, !0);
|
|
3798
3798
|
i.body.push(r);
|
|
3799
3799
|
}
|
|
3800
3800
|
return this.next(), S.prototype.exitScope.call(this), this.finishNode(i, "TSModuleBlock");
|
|
3801
3801
|
}, p.tsParseAmbientExternalModuleDeclaration = function(i) {
|
|
3802
|
-
return this.ts_isContextual(I.global) ? (i.global = !0, i.id = this.parseIdent()) : this.match(
|
|
3802
|
+
return this.ts_isContextual(I.global) ? (i.global = !0, i.id = this.parseIdent()) : this.match(o.string) ? i.id = this.parseLiteral(this.value) : this.unexpected(), this.match(o.braceL) ? (S.prototype.enterScope.call(this, Bt), i.body = this.tsParseModuleBlock(), S.prototype.exitScope.call(this)) : S.prototype.semicolon.call(this), this.finishNode(i, "TSModuleDeclaration");
|
|
3803
3803
|
}, p.tsTryParseDeclare = function(i) {
|
|
3804
3804
|
var r = this;
|
|
3805
3805
|
if (!this.isLineTerminator()) {
|
|
3806
3806
|
var n, c = this.type;
|
|
3807
|
-
return this.isContextual("let") && (c =
|
|
3808
|
-
if (c ===
|
|
3809
|
-
if (c ===
|
|
3807
|
+
return this.isContextual("let") && (c = o._var, n = "let"), this.tsInAmbientContext(function() {
|
|
3808
|
+
if (c === o._function) return i.declare = !0, r.parseFunctionStatement(i, !1, !0);
|
|
3809
|
+
if (c === o._class) return i.declare = !0, r.parseClass(i, !0);
|
|
3810
3810
|
if (c === I.enum) return r.tsParseEnumDeclaration(i, { declare: !0 });
|
|
3811
3811
|
if (c === I.global) return r.tsParseAmbientExternalModuleDeclaration(i);
|
|
3812
|
-
if (c ===
|
|
3812
|
+
if (c === o._const || c === o._var) return r.match(o._const) && r.isLookaheadContextual("enum") ? (r.expect(o._const), r.tsParseEnumDeclaration(i, { const: !0, declare: !0 })) : (i.declare = !0, r.parseVarStatement(i, n || r.value, !0));
|
|
3813
3813
|
if (c === I.interface) {
|
|
3814
3814
|
var f = r.tsParseInterfaceDeclaration(i, { declare: !0 });
|
|
3815
3815
|
if (f) return f;
|
|
@@ -3821,11 +3821,11 @@ function ar(t) {
|
|
|
3821
3821
|
switch (i) {
|
|
3822
3822
|
case "EnumMembers":
|
|
3823
3823
|
case "TypeMembers":
|
|
3824
|
-
return this.match(
|
|
3824
|
+
return this.match(o.braceR);
|
|
3825
3825
|
case "HeritageClauseElement":
|
|
3826
|
-
return this.match(
|
|
3826
|
+
return this.match(o.braceL);
|
|
3827
3827
|
case "TupleElementTypes":
|
|
3828
|
-
return this.match(
|
|
3828
|
+
return this.match(o.bracketR);
|
|
3829
3829
|
case "TypeParametersOrArguments":
|
|
3830
3830
|
return this.tsMatchRightRelational();
|
|
3831
3831
|
}
|
|
@@ -3834,9 +3834,9 @@ function ar(t) {
|
|
|
3834
3834
|
m = -1;
|
|
3835
3835
|
var y = r();
|
|
3836
3836
|
if (y == null) return;
|
|
3837
|
-
if (f.push(y), !this.eat(
|
|
3837
|
+
if (f.push(y), !this.eat(o.comma)) {
|
|
3838
3838
|
if (this.tsIsListTerminator(i)) break;
|
|
3839
|
-
return void (n && this.expect(
|
|
3839
|
+
return void (n && this.expect(o.comma));
|
|
3840
3840
|
}
|
|
3841
3841
|
m = this.lastTokStart;
|
|
3842
3842
|
}
|
|
@@ -3847,9 +3847,9 @@ function ar(t) {
|
|
|
3847
3847
|
return c;
|
|
3848
3848
|
})(this.tsParseDelimitedListWorker(i, r, !0, n));
|
|
3849
3849
|
}, p.tsParseBracketedList = function(i, r, n, c, f) {
|
|
3850
|
-
c || this.expect(n ?
|
|
3850
|
+
c || this.expect(n ? o.bracketL : o.relational);
|
|
3851
3851
|
var m = this.tsParseDelimitedList(i, r, f);
|
|
3852
|
-
return this.expect(n ?
|
|
3852
|
+
return this.expect(n ? o.bracketR : o.relational), m;
|
|
3853
3853
|
}, p.tsParseTypeParameterName = function() {
|
|
3854
3854
|
return this.parseIdent().name;
|
|
3855
3855
|
}, p.tsEatThenParseType = function(i) {
|
|
@@ -3870,25 +3870,25 @@ function ar(t) {
|
|
|
3870
3870
|
return i(), r.tsParseType();
|
|
3871
3871
|
});
|
|
3872
3872
|
}, p.tsSkipParameterStart = function() {
|
|
3873
|
-
if (V(this.type) || this.match(
|
|
3874
|
-
if (this.match(
|
|
3873
|
+
if (V(this.type) || this.match(o._this)) return this.next(), !0;
|
|
3874
|
+
if (this.match(o.braceL)) try {
|
|
3875
3875
|
return this.parseObj(!0), !0;
|
|
3876
3876
|
} catch {
|
|
3877
3877
|
return !1;
|
|
3878
3878
|
}
|
|
3879
|
-
if (this.match(
|
|
3879
|
+
if (this.match(o.bracketL)) {
|
|
3880
3880
|
this.next();
|
|
3881
3881
|
try {
|
|
3882
|
-
return this.parseBindingList(
|
|
3882
|
+
return this.parseBindingList(o.bracketR, !0, !0), !0;
|
|
3883
3883
|
} catch {
|
|
3884
3884
|
return !1;
|
|
3885
3885
|
}
|
|
3886
3886
|
}
|
|
3887
3887
|
return !1;
|
|
3888
3888
|
}, p.tsIsUnambiguouslyStartOfFunctionType = function() {
|
|
3889
|
-
return this.next(), !!(this.match(
|
|
3889
|
+
return this.next(), !!(this.match(o.parenR) || this.match(o.ellipsis) || this.tsSkipParameterStart() && (this.match(o.colon) || this.match(o.comma) || this.match(o.question) || this.match(o.eq) || this.match(o.parenR) && (this.next(), this.match(o.arrow))));
|
|
3890
3890
|
}, p.tsIsStartOfFunctionType = function() {
|
|
3891
|
-
return !!this.tsMatchLeftRelational() || this.match(
|
|
3891
|
+
return !!this.tsMatchLeftRelational() || this.match(o.parenL) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));
|
|
3892
3892
|
}, p.tsInAllowConditionalTypesContext = function(i) {
|
|
3893
3893
|
var r = this.inDisallowConditionalTypesContext;
|
|
3894
3894
|
this.inDisallowConditionalTypesContext = !1;
|
|
@@ -3899,20 +3899,20 @@ function ar(t) {
|
|
|
3899
3899
|
}
|
|
3900
3900
|
}, p.tsParseBindingListForSignature = function() {
|
|
3901
3901
|
var i = this;
|
|
3902
|
-
return S.prototype.parseBindingList.call(this,
|
|
3902
|
+
return S.prototype.parseBindingList.call(this, o.parenR, !0, !0).map(function(r) {
|
|
3903
3903
|
return r.type !== "Identifier" && r.type !== "RestElement" && r.type !== "ObjectPattern" && r.type !== "ArrayPattern" && i.raise(r.start, A.UnsupportedSignatureParameterKind(r.type)), r;
|
|
3904
3904
|
});
|
|
3905
3905
|
}, p.tsParseTypePredicateAsserts = function() {
|
|
3906
3906
|
if (this.type !== I.asserts) return !1;
|
|
3907
3907
|
var i = this.containsEsc;
|
|
3908
|
-
return this.next(), !(!V(this.type) && !this.match(
|
|
3908
|
+
return this.next(), !(!V(this.type) && !this.match(o._this) || (i && this.raise(this.lastTokStart, "Escape sequence in keyword asserts"), 0));
|
|
3909
3909
|
}, p.tsParseThisTypeNode = function() {
|
|
3910
3910
|
var i = this.startNode();
|
|
3911
3911
|
return this.next(), this.finishNode(i, "TSThisType");
|
|
3912
3912
|
}, p.tsParseTypeAnnotation = function(i, r) {
|
|
3913
3913
|
var n = this;
|
|
3914
3914
|
return i === void 0 && (i = !0), r === void 0 && (r = this.startNode()), this.tsInType(function() {
|
|
3915
|
-
i && n.expect(
|
|
3915
|
+
i && n.expect(o.colon), r.typeAnnotation = n.tsParseType();
|
|
3916
3916
|
}), this.finishNode(r, "TSTypeAnnotation");
|
|
3917
3917
|
}, p.tsParseThisTypePredicate = function(i) {
|
|
3918
3918
|
this.next();
|
|
@@ -3930,7 +3930,7 @@ function ar(t) {
|
|
|
3930
3930
|
var n = r.startNode();
|
|
3931
3931
|
r.expect(i);
|
|
3932
3932
|
var c = r.startNode(), f = !!r.tsTryParse(r.tsParseTypePredicateAsserts.bind(r));
|
|
3933
|
-
if (f && r.match(
|
|
3933
|
+
if (f && r.match(o._this)) {
|
|
3934
3934
|
var m = r.tsParseThisTypeOrThisTypePredicate();
|
|
3935
3935
|
return m.type === "TSThisType" ? (c.parameterName = m, c.asserts = !0, c.typeAnnotation = null, m = r.finishNode(c, "TSTypePredicate")) : (r.resetStartLocationFromNode(m, c), m.asserts = !0), n.typeAnnotation = m, r.finishNode(n, "TSTypeAnnotation");
|
|
3936
3936
|
}
|
|
@@ -3940,17 +3940,17 @@ function ar(t) {
|
|
|
3940
3940
|
return c.parameterName = y, c.typeAnnotation = x, c.asserts = f, n.typeAnnotation = r.finishNode(c, "TSTypePredicate"), r.finishNode(n, "TSTypeAnnotation");
|
|
3941
3941
|
});
|
|
3942
3942
|
}, p.tsFillSignature = function(i, r) {
|
|
3943
|
-
var n = i ===
|
|
3944
|
-
r.typeParameters = this.tsTryParseTypeParameters(), this.expect(
|
|
3943
|
+
var n = i === o.arrow;
|
|
3944
|
+
r.typeParameters = this.tsTryParseTypeParameters(), this.expect(o.parenL), r.parameters = this.tsParseBindingListForSignature(), (n || this.match(i)) && (r.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(i));
|
|
3945
3945
|
}, p.tsTryNextParseConstantContext = function() {
|
|
3946
|
-
if (this.lookahead().type !==
|
|
3946
|
+
if (this.lookahead().type !== o._const) return null;
|
|
3947
3947
|
this.next();
|
|
3948
3948
|
var i = this.tsParseTypeReference();
|
|
3949
3949
|
return i.typeParameters && this.raise(i.typeName.start, A.CannotFindName({ name: "const" })), i;
|
|
3950
3950
|
}, p.tsParseFunctionOrConstructorType = function(i, r) {
|
|
3951
3951
|
var n = this, c = this.startNode();
|
|
3952
3952
|
return i === "TSConstructorType" && (c.abstract = !!r, r && this.next(), this.next()), this.tsInAllowConditionalTypesContext(function() {
|
|
3953
|
-
return n.tsFillSignature(
|
|
3953
|
+
return n.tsFillSignature(o.arrow, c);
|
|
3954
3954
|
}), this.finishNode(c, i);
|
|
3955
3955
|
}, p.tsParseUnionOrIntersectionType = function(i, r, n) {
|
|
3956
3956
|
var c = this.startNode(), f = this.eat(n), m = [];
|
|
@@ -3971,11 +3971,11 @@ function ar(t) {
|
|
|
3971
3971
|
return this.next(), i.operator = r, i.typeAnnotation = this.tsParseTypeOperatorOrHigher(), r === "readonly" && this.tsCheckTypeAnnotationForReadOnly(i), this.finishNode(i, "TSTypeOperator");
|
|
3972
3972
|
}, p.tsParseConstraintForInferType = function() {
|
|
3973
3973
|
var i = this;
|
|
3974
|
-
if (this.eat(
|
|
3974
|
+
if (this.eat(o._extends)) {
|
|
3975
3975
|
var r = this.tsInDisallowConditionalTypesContext(function() {
|
|
3976
3976
|
return i.tsParseType();
|
|
3977
3977
|
});
|
|
3978
|
-
if (this.inDisallowConditionalTypesContext || !this.match(
|
|
3978
|
+
if (this.inDisallowConditionalTypesContext || !this.match(o.question)) return r;
|
|
3979
3979
|
}
|
|
3980
3980
|
}, p.tsParseInferType = function() {
|
|
3981
3981
|
var i = this, r = this.startNode();
|
|
@@ -3988,10 +3988,10 @@ function ar(t) {
|
|
|
3988
3988
|
var i = this, r = this.startNode();
|
|
3989
3989
|
return r.literal = (function() {
|
|
3990
3990
|
switch (i.type) {
|
|
3991
|
-
case
|
|
3992
|
-
case
|
|
3993
|
-
case
|
|
3994
|
-
case
|
|
3991
|
+
case o.num:
|
|
3992
|
+
case o.string:
|
|
3993
|
+
case o._true:
|
|
3994
|
+
case o._false:
|
|
3995
3995
|
return i.parseExprAtom();
|
|
3996
3996
|
default:
|
|
3997
3997
|
i.unexpected();
|
|
@@ -3999,22 +3999,22 @@ function ar(t) {
|
|
|
3999
3999
|
})(), this.finishNode(r, "TSLiteralType");
|
|
4000
4000
|
}, p.tsParseImportType = function() {
|
|
4001
4001
|
var i = this.startNode();
|
|
4002
|
-
return this.expect(
|
|
4002
|
+
return this.expect(o._import), this.expect(o.parenL), this.match(o.string) || this.raise(this.start, A.UnsupportedImportTypeArgument), i.argument = this.parseExprAtom(), this.expect(o.parenR), this.eat(o.dot) && (i.qualifier = this.tsParseEntityName()), this.tsMatchLeftRelational() && (i.typeParameters = this.tsParseTypeArguments()), this.finishNode(i, "TSImportType");
|
|
4003
4003
|
}, p.tsParseTypeQuery = function() {
|
|
4004
4004
|
var i = this.startNode();
|
|
4005
|
-
return this.expect(
|
|
4005
|
+
return this.expect(o._typeof), i.exprName = this.match(o._import) ? this.tsParseImportType() : this.tsParseEntityName(), !this.hasPrecedingLineBreak() && this.tsMatchLeftRelational() && (i.typeParameters = this.tsParseTypeArguments()), this.finishNode(i, "TSTypeQuery");
|
|
4006
4006
|
}, p.tsParseMappedTypeParameter = function() {
|
|
4007
4007
|
var i = this.startNode();
|
|
4008
|
-
return i.name = this.tsParseTypeParameterName(), i.constraint = this.tsExpectThenParseType(
|
|
4008
|
+
return i.name = this.tsParseTypeParameterName(), i.constraint = this.tsExpectThenParseType(o._in), this.finishNode(i, "TSTypeParameter");
|
|
4009
4009
|
}, p.tsParseMappedType = function() {
|
|
4010
4010
|
var i = this.startNode();
|
|
4011
|
-
return this.expect(
|
|
4011
|
+
return this.expect(o.braceL), this.match(o.plusMin) ? (i.readonly = this.value, this.next(), this.expectContextual("readonly")) : this.eatContextual("readonly") && (i.readonly = !0), this.expect(o.bracketL), i.typeParameter = this.tsParseMappedTypeParameter(), i.nameType = this.eatContextual("as") ? this.tsParseType() : null, this.expect(o.bracketR), this.match(o.plusMin) ? (i.optional = this.value, this.next(), this.expect(o.question)) : this.eat(o.question) && (i.optional = !0), i.typeAnnotation = this.tsTryParseType(), this.semicolon(), this.expect(o.braceR), this.finishNode(i, "TSMappedType");
|
|
4012
4012
|
}, p.tsParseTypeLiteral = function() {
|
|
4013
4013
|
var i = this.startNode();
|
|
4014
4014
|
return i.members = this.tsParseObjectTypeMembers(), this.finishNode(i, "TSTypeLiteral");
|
|
4015
4015
|
}, p.tsParseTupleElementType = function() {
|
|
4016
|
-
var i = this.startLoc, r = this.start, n = this.eat(
|
|
4017
|
-
if (this.eat(
|
|
4016
|
+
var i = this.startLoc, r = this.start, n = this.eat(o.ellipsis), c = this.tsParseType(), f = this.eat(o.question);
|
|
4017
|
+
if (this.eat(o.colon)) {
|
|
4018
4018
|
var m = this.startNodeAtNode(c);
|
|
4019
4019
|
m.optional = f, c.type !== "TSTypeReference" || c.typeParameters || c.typeName.type !== "Identifier" ? (this.raise(c.start, A.InvalidTupleMemberLabel), m.label = c) : m.label = c.typeName, m.elementType = this.tsParseType(), c = this.finishNode(m, "TSNamedTupleMember");
|
|
4020
4020
|
} else if (f) {
|
|
@@ -4045,44 +4045,44 @@ function ar(t) {
|
|
|
4045
4045
|
var i = this.startNode();
|
|
4046
4046
|
return i.typeName = this.tsParseEntityName(), !this.hasPrecedingLineBreak() && this.tsMatchLeftRelational() && (i.typeParameters = this.tsParseTypeArguments()), this.finishNode(i, "TSTypeReference");
|
|
4047
4047
|
}, p.tsMatchLeftRelational = function() {
|
|
4048
|
-
return this.match(
|
|
4048
|
+
return this.match(o.relational) && this.value === "<";
|
|
4049
4049
|
}, p.tsMatchRightRelational = function() {
|
|
4050
|
-
return this.match(
|
|
4050
|
+
return this.match(o.relational) && this.value === ">";
|
|
4051
4051
|
}, p.tsParseParenthesizedType = function() {
|
|
4052
4052
|
var i = this.startNode();
|
|
4053
|
-
return this.expect(
|
|
4053
|
+
return this.expect(o.parenL), i.typeAnnotation = this.tsParseType(), this.expect(o.parenR), this.finishNode(i, "TSParenthesizedType");
|
|
4054
4054
|
}, p.tsParseNonArrayType = function() {
|
|
4055
4055
|
switch (this.type) {
|
|
4056
|
-
case
|
|
4057
|
-
case
|
|
4058
|
-
case
|
|
4059
|
-
case
|
|
4056
|
+
case o.string:
|
|
4057
|
+
case o.num:
|
|
4058
|
+
case o._true:
|
|
4059
|
+
case o._false:
|
|
4060
4060
|
return this.tsParseLiteralTypeNode();
|
|
4061
|
-
case
|
|
4061
|
+
case o.plusMin:
|
|
4062
4062
|
if (this.value === "-") {
|
|
4063
4063
|
var i = this.startNode();
|
|
4064
|
-
return this.lookahead().type !==
|
|
4064
|
+
return this.lookahead().type !== o.num && this.unexpected(), i.literal = this.parseMaybeUnary(), this.finishNode(i, "TSLiteralType");
|
|
4065
4065
|
}
|
|
4066
4066
|
break;
|
|
4067
|
-
case
|
|
4067
|
+
case o._this:
|
|
4068
4068
|
return this.tsParseThisTypeOrThisTypePredicate();
|
|
4069
|
-
case
|
|
4069
|
+
case o._typeof:
|
|
4070
4070
|
return this.tsParseTypeQuery();
|
|
4071
|
-
case
|
|
4071
|
+
case o._import:
|
|
4072
4072
|
return this.tsParseImportType();
|
|
4073
|
-
case
|
|
4073
|
+
case o.braceL:
|
|
4074
4074
|
return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();
|
|
4075
|
-
case
|
|
4075
|
+
case o.bracketL:
|
|
4076
4076
|
return this.tsParseTupleType();
|
|
4077
|
-
case
|
|
4077
|
+
case o.parenL:
|
|
4078
4078
|
return this.tsParseParenthesizedType();
|
|
4079
|
-
case
|
|
4080
|
-
case
|
|
4079
|
+
case o.backQuote:
|
|
4080
|
+
case o.dollarBraceL:
|
|
4081
4081
|
return this.tsParseTemplateLiteralType();
|
|
4082
4082
|
default:
|
|
4083
4083
|
var r = this.type;
|
|
4084
|
-
if (V(r) || r ===
|
|
4085
|
-
var n = r ===
|
|
4084
|
+
if (V(r) || r === o._void || r === o._null) {
|
|
4085
|
+
var n = r === o._void ? "TSVoidKeyword" : r === o._null ? "TSNullKeyword" : (function(f) {
|
|
4086
4086
|
switch (f) {
|
|
4087
4087
|
case "any":
|
|
4088
4088
|
return "TSAnyKeyword";
|
|
@@ -4117,40 +4117,40 @@ function ar(t) {
|
|
|
4117
4117
|
}
|
|
4118
4118
|
this.unexpected();
|
|
4119
4119
|
}, p.tsParseArrayTypeOrHigher = function() {
|
|
4120
|
-
for (var i = this.tsParseNonArrayType(); !this.hasPrecedingLineBreak() && this.eat(
|
|
4120
|
+
for (var i = this.tsParseNonArrayType(); !this.hasPrecedingLineBreak() && this.eat(o.bracketL); ) if (this.match(o.bracketR)) {
|
|
4121
4121
|
var r = this.startNodeAtNode(i);
|
|
4122
|
-
r.elementType = i, this.expect(
|
|
4122
|
+
r.elementType = i, this.expect(o.bracketR), i = this.finishNode(r, "TSArrayType");
|
|
4123
4123
|
} else {
|
|
4124
4124
|
var n = this.startNodeAtNode(i);
|
|
4125
|
-
n.objectType = i, n.indexType = this.tsParseType(), this.expect(
|
|
4125
|
+
n.objectType = i, n.indexType = this.tsParseType(), this.expect(o.bracketR), i = this.finishNode(n, "TSIndexedAccessType");
|
|
4126
4126
|
}
|
|
4127
4127
|
return i;
|
|
4128
4128
|
}, p.tsParseTypeOperatorOrHigher = function() {
|
|
4129
4129
|
var i = this;
|
|
4130
|
-
return
|
|
4130
|
+
return Ki(this.type) && !this.containsEsc ? this.tsParseTypeOperator() : this.isContextual("infer") ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(function() {
|
|
4131
4131
|
return i.tsParseArrayTypeOrHigher();
|
|
4132
4132
|
});
|
|
4133
4133
|
}, p.tsParseIntersectionTypeOrHigher = function() {
|
|
4134
|
-
return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this),
|
|
4134
|
+
return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), o.bitwiseAND);
|
|
4135
4135
|
}, p.tsParseUnionTypeOrHigher = function() {
|
|
4136
|
-
return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this),
|
|
4136
|
+
return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), o.bitwiseOR);
|
|
4137
4137
|
}, p.tsParseNonConditionalType = function() {
|
|
4138
|
-
return this.tsIsStartOfFunctionType() ? this.tsParseFunctionOrConstructorType("TSFunctionType") : this.match(
|
|
4138
|
+
return this.tsIsStartOfFunctionType() ? this.tsParseFunctionOrConstructorType("TSFunctionType") : this.match(o._new) ? this.tsParseFunctionOrConstructorType("TSConstructorType") : this.isAbstractConstructorSignature() ? this.tsParseFunctionOrConstructorType("TSConstructorType", !0) : this.tsParseUnionTypeOrHigher();
|
|
4139
4139
|
}, p.tsParseType = function() {
|
|
4140
4140
|
var i = this;
|
|
4141
4141
|
ti(this.inType);
|
|
4142
4142
|
var r = this.tsParseNonConditionalType();
|
|
4143
|
-
if (this.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(
|
|
4143
|
+
if (this.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(o._extends)) return r;
|
|
4144
4144
|
var n = this.startNodeAtNode(r);
|
|
4145
4145
|
return n.checkType = r, n.extendsType = this.tsInDisallowConditionalTypesContext(function() {
|
|
4146
4146
|
return i.tsParseNonConditionalType();
|
|
4147
|
-
}), this.expect(
|
|
4147
|
+
}), this.expect(o.question), n.trueType = this.tsInAllowConditionalTypesContext(function() {
|
|
4148
4148
|
return i.tsParseType();
|
|
4149
|
-
}), this.expect(
|
|
4149
|
+
}), this.expect(o.colon), n.falseType = this.tsInAllowConditionalTypesContext(function() {
|
|
4150
4150
|
return i.tsParseType();
|
|
4151
4151
|
}), this.finishNode(n, "TSConditionalType");
|
|
4152
4152
|
}, p.tsIsUnambiguouslyIndexSignature = function() {
|
|
4153
|
-
return this.next(), !!V(this.type) && (this.next(), this.match(
|
|
4153
|
+
return this.next(), !!V(this.type) && (this.next(), this.match(o.colon));
|
|
4154
4154
|
}, p.tsInType = function(i) {
|
|
4155
4155
|
var r = this.inType;
|
|
4156
4156
|
this.inType = !0;
|
|
@@ -4160,10 +4160,10 @@ function ar(t) {
|
|
|
4160
4160
|
this.inType = r;
|
|
4161
4161
|
}
|
|
4162
4162
|
}, p.tsTryParseIndexSignature = function(i) {
|
|
4163
|
-
if (this.match(
|
|
4164
|
-
this.expect(
|
|
4163
|
+
if (this.match(o.bracketL) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))) {
|
|
4164
|
+
this.expect(o.bracketL);
|
|
4165
4165
|
var r = this.parseIdent();
|
|
4166
|
-
r.typeAnnotation = this.tsParseTypeAnnotation(), this.resetEndLocation(r), this.expect(
|
|
4166
|
+
r.typeAnnotation = this.tsParseTypeAnnotation(), this.resetEndLocation(r), this.expect(o.bracketR), i.parameters = [r];
|
|
4167
4167
|
var n = this.tsTryParseTypeAnnotation();
|
|
4168
4168
|
return n && (i.typeAnnotation = n), this.tsParseTypeMemberSemicolon(), this.finishNode(i, "TSIndexSignature");
|
|
4169
4169
|
}
|
|
@@ -4172,7 +4172,7 @@ function ar(t) {
|
|
|
4172
4172
|
}, p.tsParseTypeParameter = function(i) {
|
|
4173
4173
|
i === void 0 && (i = this.tsParseNoneModifiers.bind(this));
|
|
4174
4174
|
var r = this.startNode();
|
|
4175
|
-
return i(r), r.name = this.tsParseTypeParameterName(), r.constraint = this.tsEatThenParseType(
|
|
4175
|
+
return i(r), r.name = this.tsParseTypeParameterName(), r.constraint = this.tsEatThenParseType(o._extends), r.default = this.tsEatThenParseType(o.eq), this.finishNode(r, "TSTypeParameter");
|
|
4176
4176
|
}, p.tsParseTypeParameters = function(i) {
|
|
4177
4177
|
var r = this.startNode();
|
|
4178
4178
|
this.tsMatchLeftRelational() || this.matchJsx("jsxTagStart") ? this.next() : this.unexpected();
|
|
@@ -4184,11 +4184,11 @@ function ar(t) {
|
|
|
4184
4184
|
var r = this.getCurLookaheadState(), n = i();
|
|
4185
4185
|
return n !== void 0 && n !== !1 ? n : void this.setLookaheadState(r);
|
|
4186
4186
|
}, p.tsTokenCanFollowModifier = function() {
|
|
4187
|
-
return (this.match(
|
|
4187
|
+
return (this.match(o.bracketL) || this.match(o.braceL) || this.match(o.star) || this.match(o.ellipsis) || this.match(o.privateId) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak();
|
|
4188
4188
|
}, p.tsNextTokenCanFollowModifier = function() {
|
|
4189
4189
|
return this.next(!0), this.tsTokenCanFollowModifier();
|
|
4190
4190
|
}, p.tsParseModifier = function(i, r) {
|
|
4191
|
-
if (V(this.type) || this.type ===
|
|
4191
|
+
if (V(this.type) || this.type === o._in) {
|
|
4192
4192
|
var n = this.value;
|
|
4193
4193
|
if (i.indexOf(n) !== -1 && !this.containsEsc) {
|
|
4194
4194
|
if (r && this.tsIsStartOfStaticBlocks()) return;
|
|
@@ -4217,9 +4217,9 @@ function ar(t) {
|
|
|
4217
4217
|
var i = this, r = this.startNode();
|
|
4218
4218
|
return r.params = this.tsInType(function() {
|
|
4219
4219
|
return i.tsInNoContext(function() {
|
|
4220
|
-
return i.expect(
|
|
4220
|
+
return i.expect(o.relational), i.tsParseDelimitedList("TypeParametersOrArguments", i.tsParseType.bind(i));
|
|
4221
4221
|
});
|
|
4222
|
-
}), r.params.length === 0 && this.raise(this.start, A.EmptyTypeArguments), this.exprAllowed = !1, this.expect(
|
|
4222
|
+
}), r.params.length === 0 && this.raise(this.start, A.EmptyTypeArguments), this.exprAllowed = !1, this.expect(o.relational), this.finishNode(r, "TSTypeParameterInstantiation");
|
|
4223
4223
|
}, p.tsParseHeritageClause = function(i) {
|
|
4224
4224
|
var r = this, n = this.start, c = this.tsParseDelimitedList("HeritageClauseElement", function() {
|
|
4225
4225
|
var f = r.startNode();
|
|
@@ -4227,21 +4227,21 @@ function ar(t) {
|
|
|
4227
4227
|
});
|
|
4228
4228
|
return c.length || this.raise(n, A.EmptyHeritageClauseType({ token: i })), c;
|
|
4229
4229
|
}, p.tsParseTypeMemberSemicolon = function() {
|
|
4230
|
-
this.eat(
|
|
4230
|
+
this.eat(o.comma) || this.isLineTerminator() || this.expect(o.semi);
|
|
4231
4231
|
}, p.tsTryParseAndCatch = function(i) {
|
|
4232
4232
|
var r = this.tryParse(function(n) {
|
|
4233
4233
|
return i() || n();
|
|
4234
4234
|
});
|
|
4235
4235
|
if (!r.aborted && r.node) return r.error && this.setLookaheadState(r.failState), r.node;
|
|
4236
4236
|
}, p.tsParseSignatureMember = function(i, r) {
|
|
4237
|
-
return this.tsFillSignature(
|
|
4237
|
+
return this.tsFillSignature(o.colon, r), this.tsParseTypeMemberSemicolon(), this.finishNode(r, i);
|
|
4238
4238
|
}, p.tsParsePropertyOrMethodSignature = function(i, r) {
|
|
4239
|
-
this.eat(
|
|
4239
|
+
this.eat(o.question) && (i.optional = !0);
|
|
4240
4240
|
var n = i;
|
|
4241
|
-
if (this.match(
|
|
4241
|
+
if (this.match(o.parenL) || this.tsMatchLeftRelational()) {
|
|
4242
4242
|
r && this.raise(i.start, A.ReadonlyForMethodSignature);
|
|
4243
4243
|
var c = n;
|
|
4244
|
-
c.kind && this.tsMatchLeftRelational() && this.raise(this.start, A.AccesorCannotHaveTypeParameters), this.tsFillSignature(
|
|
4244
|
+
c.kind && this.tsMatchLeftRelational() && this.raise(this.start, A.AccesorCannotHaveTypeParameters), this.tsFillSignature(o.colon, c), this.tsParseTypeMemberSemicolon();
|
|
4245
4245
|
var f = "parameters", m = "typeAnnotation";
|
|
4246
4246
|
if (c.kind === "get") c[f].length > 0 && (this.raise(this.start, "A 'get' accesor must not have any formal parameters."), this.isThisParam(c[f][0]) && this.raise(this.start, A.AccesorCannotDeclareThisParameter));
|
|
4247
4247
|
else if (c.kind === "set") {
|
|
@@ -4260,31 +4260,31 @@ function ar(t) {
|
|
|
4260
4260
|
return b && (x.typeAnnotation = b), this.tsParseTypeMemberSemicolon(), this.finishNode(x, "TSPropertySignature");
|
|
4261
4261
|
}, p.tsParseTypeMember = function() {
|
|
4262
4262
|
var i = this.startNode();
|
|
4263
|
-
if (this.match(
|
|
4264
|
-
if (this.match(
|
|
4263
|
+
if (this.match(o.parenL) || this.tsMatchLeftRelational()) return this.tsParseSignatureMember("TSCallSignatureDeclaration", i);
|
|
4264
|
+
if (this.match(o._new)) {
|
|
4265
4265
|
var r = this.startNode();
|
|
4266
|
-
return this.next(), this.match(
|
|
4266
|
+
return this.next(), this.match(o.parenL) || this.tsMatchLeftRelational() ? this.tsParseSignatureMember("TSConstructSignatureDeclaration", i) : (i.key = this.createIdentifier(r, "new"), this.tsParsePropertyOrMethodSignature(i, !1));
|
|
4267
4267
|
}
|
|
4268
4268
|
return this.tsParseModifiers({ modified: i, allowedModifiers: ["readonly"], disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"] }), this.tsTryParseIndexSignature(i) || (this.parsePropertyName(i), i.computed || i.key.type !== "Identifier" || i.key.name !== "get" && i.key.name !== "set" || !this.tsTokenCanFollowModifier() || (i.kind = i.key.name, this.parsePropertyName(i)), this.tsParsePropertyOrMethodSignature(i, !!i.readonly));
|
|
4269
4269
|
}, p.tsParseList = function(i, r) {
|
|
4270
4270
|
for (var n = []; !this.tsIsListTerminator(i); ) n.push(r());
|
|
4271
4271
|
return n;
|
|
4272
4272
|
}, p.tsParseObjectTypeMembers = function() {
|
|
4273
|
-
this.expect(
|
|
4273
|
+
this.expect(o.braceL);
|
|
4274
4274
|
var i = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this));
|
|
4275
|
-
return this.expect(
|
|
4275
|
+
return this.expect(o.braceR), i;
|
|
4276
4276
|
}, p.tsParseInterfaceDeclaration = function(i, r) {
|
|
4277
4277
|
if (r === void 0 && (r = {}), this.hasFollowingLineBreak()) return null;
|
|
4278
|
-
this.expectContextual("interface"), r.declare && (i.declare = !0), V(this.type) ? (i.id = this.parseIdent(), this.checkLValSimple(i.id, 7)) : (i.id = null, this.raise(this.start, A.MissingInterfaceName)), i.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)), this.eat(
|
|
4278
|
+
this.expectContextual("interface"), r.declare && (i.declare = !0), V(this.type) ? (i.id = this.parseIdent(), this.checkLValSimple(i.id, 7)) : (i.id = null, this.raise(this.start, A.MissingInterfaceName)), i.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)), this.eat(o._extends) && (i.extends = this.tsParseHeritageClause("extends"));
|
|
4279
4279
|
var n = this.startNode();
|
|
4280
4280
|
return n.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)), i.body = this.finishNode(n, "TSInterfaceBody"), this.finishNode(i, "TSInterfaceDeclaration");
|
|
4281
4281
|
}, p.tsParseAbstractDeclaration = function(i) {
|
|
4282
|
-
if (this.match(
|
|
4282
|
+
if (this.match(o._class)) return i.abstract = !0, this.parseClass(i, !0);
|
|
4283
4283
|
if (this.ts_isContextual(I.interface)) {
|
|
4284
4284
|
if (!this.hasFollowingLineBreak()) return i.abstract = !0, this.tsParseInterfaceDeclaration(i);
|
|
4285
4285
|
} else this.unexpected(i.start);
|
|
4286
4286
|
}, p.tsIsDeclarationStart = function() {
|
|
4287
|
-
return
|
|
4287
|
+
return Wi(this.type);
|
|
4288
4288
|
}, p.tsParseExpressionStatement = function(i, r) {
|
|
4289
4289
|
switch (r.name) {
|
|
4290
4290
|
case "declare":
|
|
@@ -4292,7 +4292,7 @@ function ar(t) {
|
|
|
4292
4292
|
if (n) return n.declare = !0, n;
|
|
4293
4293
|
break;
|
|
4294
4294
|
case "global":
|
|
4295
|
-
if (this.match(
|
|
4295
|
+
if (this.match(o.braceL)) {
|
|
4296
4296
|
S.prototype.enterScope.call(this, Bt);
|
|
4297
4297
|
var c = i;
|
|
4298
4298
|
return c.global = !0, c.id = r, c.body = this.tsParseModuleBlock(), S.prototype.exitScope.call(this), this.finishNode(c, "TSModuleDeclaration");
|
|
@@ -4309,12 +4309,12 @@ function ar(t) {
|
|
|
4309
4309
|
if (r && !this.containsEsc || n) return !1;
|
|
4310
4310
|
if ((i === I.type || i === I.interface) && !this.containsEsc) {
|
|
4311
4311
|
var c = this.lookahead();
|
|
4312
|
-
if (V(c.type) && !this.isContextualWithState("from", c) || c.type ===
|
|
4312
|
+
if (V(c.type) && !this.isContextualWithState("from", c) || c.type === o.braceL) return !1;
|
|
4313
4313
|
}
|
|
4314
|
-
} else if (!this.match(
|
|
4314
|
+
} else if (!this.match(o._default)) return !1;
|
|
4315
4315
|
var f = this.nextTokenStart(), m = this.isUnparsedContextual(f, "from");
|
|
4316
4316
|
if (this.input.charCodeAt(f) === 44 || V(this.type) && m) return !0;
|
|
4317
|
-
if (this.match(
|
|
4317
|
+
if (this.match(o._default) && m) {
|
|
4318
4318
|
var y = this.input.charCodeAt(this.nextTokenStartSince(f + 4));
|
|
4319
4319
|
return y === 34 || y === 39;
|
|
4320
4320
|
}
|
|
@@ -4330,7 +4330,7 @@ function ar(t) {
|
|
|
4330
4330
|
}, p.tsCheckLineTerminator = function(i) {
|
|
4331
4331
|
return i ? !this.hasFollowingLineBreak() && (this.next(), !0) : !this.isLineTerminator();
|
|
4332
4332
|
}, p.tsParseModuleOrNamespaceDeclaration = function(i, r) {
|
|
4333
|
-
if (r === void 0 && (r = !1), i.id = this.parseIdent(), r || this.checkLValSimple(i.id, 8), this.eat(
|
|
4333
|
+
if (r === void 0 && (r = !1), i.id = this.parseIdent(), r || this.checkLValSimple(i.id, 8), this.eat(o.dot)) {
|
|
4334
4334
|
var n = this.startNode();
|
|
4335
4335
|
this.tsParseModuleOrNamespaceDeclaration(n, !0), i.body = n;
|
|
4336
4336
|
} else S.prototype.enterScope.call(this, Bt), i.body = this.tsParseModuleBlock(), S.prototype.exitScope.call(this);
|
|
@@ -4340,7 +4340,7 @@ function ar(t) {
|
|
|
4340
4340
|
}, p.tsParseTypeAliasDeclaration = function(i) {
|
|
4341
4341
|
var r = this;
|
|
4342
4342
|
return i.id = this.parseIdent(), this.checkLValSimple(i.id, 6), i.typeAnnotation = this.tsInType(function() {
|
|
4343
|
-
if (i.typeParameters = r.tsTryParseTypeParameters(r.tsParseInOutModifiers.bind(r)), r.expect(
|
|
4343
|
+
if (i.typeParameters = r.tsTryParseTypeParameters(r.tsParseInOutModifiers.bind(r)), r.expect(o.eq), r.ts_isContextual(I.interface) && r.lookahead().type !== o.dot) {
|
|
4344
4344
|
var n = r.startNode();
|
|
4345
4345
|
return r.next(), r.finishNode(n, "TSIntrinsicKeyword");
|
|
4346
4346
|
}
|
|
@@ -4349,11 +4349,11 @@ function ar(t) {
|
|
|
4349
4349
|
}, p.tsParseDeclaration = function(i, r, n) {
|
|
4350
4350
|
switch (r) {
|
|
4351
4351
|
case "abstract":
|
|
4352
|
-
if (this.tsCheckLineTerminator(n) && (this.match(
|
|
4352
|
+
if (this.tsCheckLineTerminator(n) && (this.match(o._class) || V(this.type))) return this.tsParseAbstractDeclaration(i);
|
|
4353
4353
|
break;
|
|
4354
4354
|
case "module":
|
|
4355
4355
|
if (this.tsCheckLineTerminator(n)) {
|
|
4356
|
-
if (this.match(
|
|
4356
|
+
if (this.match(o.string)) return this.tsParseAmbientExternalModuleDeclaration(i);
|
|
4357
4357
|
if (V(this.type)) return this.tsParseModuleOrNamespaceDeclaration(i);
|
|
4358
4358
|
}
|
|
4359
4359
|
break;
|
|
@@ -4366,7 +4366,7 @@ function ar(t) {
|
|
|
4366
4366
|
}, p.tsTryParseExportDeclaration = function() {
|
|
4367
4367
|
return this.tsParseDeclaration(this.startNode(), this.value, !0);
|
|
4368
4368
|
}, p.tsParseImportEqualsDeclaration = function(i, r) {
|
|
4369
|
-
i.isExport = r || !1, i.id = this.parseIdent(), this.checkLValSimple(i.id, 2), S.prototype.expect.call(this,
|
|
4369
|
+
i.isExport = r || !1, i.id = this.parseIdent(), this.checkLValSimple(i.id, 2), S.prototype.expect.call(this, o.eq);
|
|
4370
4370
|
var n = this.tsParseModuleReference();
|
|
4371
4371
|
return i.importKind === "type" && n.type !== "TSExternalModuleReference" && this.raise(n.start, A.ImportAliasHasImportType), i.moduleReference = n, S.prototype.semicolon.call(this), this.finishNode(i, "TSImportEqualsDeclaration");
|
|
4372
4372
|
}, p.isExportDefaultSpecifier = function() {
|
|
@@ -4376,12 +4376,12 @@ function ar(t) {
|
|
|
4376
4376
|
if (this.isContextual("async") || this.isContextual("let")) return !1;
|
|
4377
4377
|
if ((i === I.type || i === I.interface) && !this.containsEsc) {
|
|
4378
4378
|
var r = this.lookahead();
|
|
4379
|
-
if (V(r.type) && !this.isContextualWithState("from", r) || r.type ===
|
|
4379
|
+
if (V(r.type) && !this.isContextualWithState("from", r) || r.type === o.braceL) return !1;
|
|
4380
4380
|
}
|
|
4381
|
-
} else if (!this.match(
|
|
4381
|
+
} else if (!this.match(o._default)) return !1;
|
|
4382
4382
|
var n = this.nextTokenStart(), c = this.isUnparsedContextual(n, "from");
|
|
4383
4383
|
if (this.input.charCodeAt(n) === 44 || V(this.type) && c) return !0;
|
|
4384
|
-
if (this.match(
|
|
4384
|
+
if (this.match(o._default) && c) {
|
|
4385
4385
|
var f = this.input.charCodeAt(this.nextTokenStartSince(n + 4));
|
|
4386
4386
|
return f === 34 || f === 39;
|
|
4387
4387
|
}
|
|
@@ -4390,34 +4390,34 @@ function ar(t) {
|
|
|
4390
4390
|
var r = (i === void 0 ? {} : i).isTagged, n = r !== void 0 && r, c = this.startNode();
|
|
4391
4391
|
this.next(), c.expressions = [];
|
|
4392
4392
|
var f = this.parseTemplateElement({ isTagged: n });
|
|
4393
|
-
for (c.quasis = [f]; !f.tail; ) this.type ===
|
|
4393
|
+
for (c.quasis = [f]; !f.tail; ) this.type === o.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(o.dollarBraceL), c.expressions.push(this.inType ? this.tsParseType() : this.parseExpression()), this.expect(o.braceR), c.quasis.push(f = this.parseTemplateElement({ isTagged: n }));
|
|
4394
4394
|
return this.next(), this.finishNode(c, "TemplateLiteral");
|
|
4395
4395
|
}, p.parseFunction = function(i, r, n, c, f) {
|
|
4396
|
-
this.initFunction(i), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !c) && (this.type ===
|
|
4396
|
+
this.initFunction(i), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !c) && (this.type === o.star && 2 & r && this.unexpected(), i.generator = this.eat(o.star)), this.options.ecmaVersion >= 8 && (i.async = !!c), 1 & r && (i.id = 4 & r && this.type !== o.name ? null : this.parseIdent());
|
|
4397
4397
|
var m = this.yieldPos, y = this.awaitPos, x = this.awaitIdentPos, b = this.maybeInArrowParameters;
|
|
4398
|
-
this.maybeInArrowParameters = !1, this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Se(i.async, i.generator)), 1 & r || (i.id = this.type ===
|
|
4398
|
+
this.maybeInArrowParameters = !1, this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Se(i.async, i.generator)), 1 & r || (i.id = this.type === o.name ? this.parseIdent() : null), this.parseFunctionParams(i);
|
|
4399
4399
|
var T = 1 & r;
|
|
4400
4400
|
return this.parseFunctionBody(i, n, !1, f, { isFunctionDeclaration: T }), this.yieldPos = m, this.awaitPos = y, this.awaitIdentPos = x, 1 & r && i.id && !(2 & r) && this.checkLValSimple(i.id, i.body ? this.strict || i.generator || i.async ? this.treatFunctionsAsVar ? 1 : 2 : 3 : 0), this.maybeInArrowParameters = b, this.finishNode(i, T ? "FunctionDeclaration" : "FunctionExpression");
|
|
4401
4401
|
}, p.parseFunctionBody = function(i, r, n, c, f) {
|
|
4402
|
-
r === void 0 && (r = !1), n === void 0 && (n = !1), c === void 0 && (c = !1), this.match(
|
|
4402
|
+
r === void 0 && (r = !1), n === void 0 && (n = !1), c === void 0 && (c = !1), this.match(o.colon) && (i.returnType = this.tsParseTypeOrTypePredicateAnnotation(o.colon));
|
|
4403
4403
|
var m = f != null && f.isFunctionDeclaration ? "TSDeclareFunction" : f != null && f.isClassMethod ? "TSDeclareMethod" : void 0;
|
|
4404
|
-
return m && !this.match(
|
|
4404
|
+
return m && !this.match(o.braceL) && this.isLineTerminator() ? this.finishNode(i, m) : m === "TSDeclareFunction" && this.isAmbientContext && (this.raise(i.start, A.DeclareFunctionHasImplementation), i.declare) ? (S.prototype.parseFunctionBody.call(this, i, r, n, !1), this.finishNode(i, m)) : (S.prototype.parseFunctionBody.call(this, i, r, n, c), i);
|
|
4405
4405
|
}, p.parseNew = function() {
|
|
4406
4406
|
var i;
|
|
4407
4407
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
4408
4408
|
var r = this.startNode(), n = this.parseIdent(!0);
|
|
4409
|
-
if (this.options.ecmaVersion >= 6 && this.eat(
|
|
4409
|
+
if (this.options.ecmaVersion >= 6 && this.eat(o.dot)) {
|
|
4410
4410
|
r.meta = n;
|
|
4411
4411
|
var c = this.containsEsc;
|
|
4412
4412
|
return r.property = this.parseIdent(!0), r.property.name !== "target" && this.raiseRecoverable(r.property.start, "The only valid meta property for new is 'new.target'"), c && this.raiseRecoverable(r.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(r.start, "'new.target' can only be used in functions and class static block"), this.finishNode(r, "MetaProperty");
|
|
4413
4413
|
}
|
|
4414
|
-
var f = this.start, m = this.startLoc, y = this.type ===
|
|
4414
|
+
var f = this.start, m = this.startLoc, y = this.type === o._import;
|
|
4415
4415
|
r.callee = this.parseSubscripts(this.parseExprAtom(), f, m, !0, !1), y && r.callee.type === "ImportExpression" && this.raise(f, "Cannot use new with import()");
|
|
4416
4416
|
var x = r.callee;
|
|
4417
|
-
return x.type !== "TSInstantiationExpression" || (i = x.extra) != null && i.parenthesized || (r.typeParameters = x.typeParameters, r.callee = x.expression), r.arguments = this.eat(
|
|
4417
|
+
return x.type !== "TSInstantiationExpression" || (i = x.extra) != null && i.parenthesized || (r.typeParameters = x.typeParameters, r.callee = x.expression), r.arguments = this.eat(o.parenL) ? this.parseExprList(o.parenR, this.options.ecmaVersion >= 8, !1) : [], this.finishNode(r, "NewExpression");
|
|
4418
4418
|
}, p.parseExprOp = function(i, r, n, c, f) {
|
|
4419
4419
|
var m;
|
|
4420
|
-
if (
|
|
4420
|
+
if (o._in.binop > c && !this.hasPrecedingLineBreak() && (this.isContextual("as") && (m = "TSAsExpression"), l && this.isContextual("satisfies") && (m = "TSSatisfiesExpression"), m)) {
|
|
4421
4421
|
var y = this.startNodeAt(r, n);
|
|
4422
4422
|
y.expression = i;
|
|
4423
4423
|
var x = this.tsTryNextParseConstantContext();
|
|
@@ -4426,25 +4426,25 @@ function ar(t) {
|
|
|
4426
4426
|
return S.prototype.parseExprOp.call(this, i, r, n, c, f);
|
|
4427
4427
|
}, p.parseImportSpecifiers = function() {
|
|
4428
4428
|
var i = [], r = !0;
|
|
4429
|
-
if (g.tokenIsIdentifier(this.type) && (i.push(this.parseImportDefaultSpecifier()), !this.eat(
|
|
4430
|
-
if (this.type ===
|
|
4431
|
-
for (this.expect(
|
|
4429
|
+
if (g.tokenIsIdentifier(this.type) && (i.push(this.parseImportDefaultSpecifier()), !this.eat(o.comma))) return i;
|
|
4430
|
+
if (this.type === o.star) return i.push(this.parseImportNamespaceSpecifier()), i;
|
|
4431
|
+
for (this.expect(o.braceL); !this.eat(o.braceR); ) {
|
|
4432
4432
|
if (r) r = !1;
|
|
4433
|
-
else if (this.expect(
|
|
4433
|
+
else if (this.expect(o.comma), this.afterTrailingComma(o.braceR)) break;
|
|
4434
4434
|
i.push(this.parseImportSpecifier());
|
|
4435
4435
|
}
|
|
4436
4436
|
return i;
|
|
4437
4437
|
}, p.parseImport = function(i) {
|
|
4438
4438
|
var r = this.lookahead();
|
|
4439
|
-
if (i.importKind = "value", this.importOrExportOuterKind = "value", V(r.type) || this.match(
|
|
4439
|
+
if (i.importKind = "value", this.importOrExportOuterKind = "value", V(r.type) || this.match(o.star) || this.match(o.braceL)) {
|
|
4440
4440
|
var n = this.lookahead(2);
|
|
4441
|
-
if (n.type !==
|
|
4441
|
+
if (n.type !== o.comma && !this.isContextualWithState("from", n) && n.type !== o.eq && this.ts_eatContextualWithState("type", 1, r) && (this.importOrExportOuterKind = "type", i.importKind = "type", r = this.lookahead(), n = this.lookahead(2)), V(r.type) && n.type === o.eq) {
|
|
4442
4442
|
this.next();
|
|
4443
4443
|
var c = this.tsParseImportEqualsDeclaration(i);
|
|
4444
4444
|
return this.importOrExportOuterKind = "value", c;
|
|
4445
4445
|
}
|
|
4446
4446
|
}
|
|
4447
|
-
return this.next(), this.type ===
|
|
4447
|
+
return this.next(), this.type === o.string ? (i.specifiers = [], i.source = this.parseExprAtom()) : (i.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), i.source = this.type === o.string ? this.parseExprAtom() : this.unexpected()), this.parseMaybeImportAttributes(i), this.semicolon(), this.finishNode(i, "ImportDeclaration"), this.importOrExportOuterKind = "value", i.importKind === "type" && i.specifiers.length > 1 && i.specifiers[0].type === "ImportDefaultSpecifier" && this.raise(i.start, A.TypeImportCannotSpecifyDefaultAndNamed), i;
|
|
4448
4448
|
}, p.parseExportDefaultDeclaration = function() {
|
|
4449
4449
|
if (this.isAbstractClass()) {
|
|
4450
4450
|
var i = this.startNode();
|
|
@@ -4456,25 +4456,25 @@ function ar(t) {
|
|
|
4456
4456
|
}
|
|
4457
4457
|
return S.prototype.parseExportDefaultDeclaration.call(this);
|
|
4458
4458
|
}, p.parseExportAllDeclaration = function(i, r) {
|
|
4459
|
-
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (i.exported = this.parseModuleExportName(), this.checkExport(r, i.exported, this.lastTokStart)) : i.exported = null), this.expectContextual("from"), this.type !==
|
|
4459
|
+
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (i.exported = this.parseModuleExportName(), this.checkExport(r, i.exported, this.lastTokStart)) : i.exported = null), this.expectContextual("from"), this.type !== o.string && this.unexpected(), i.source = this.parseExprAtom(), this.parseMaybeImportAttributes(i), this.semicolon(), this.finishNode(i, "ExportAllDeclaration");
|
|
4460
4460
|
}, p.parseDynamicImport = function(i) {
|
|
4461
|
-
if (this.next(), i.source = this.parseMaybeAssign(), this.eat(
|
|
4461
|
+
if (this.next(), i.source = this.parseMaybeAssign(), this.eat(o.comma)) {
|
|
4462
4462
|
var r = this.parseExpression();
|
|
4463
4463
|
i.arguments = [r];
|
|
4464
4464
|
}
|
|
4465
|
-
if (!this.eat(
|
|
4465
|
+
if (!this.eat(o.parenR)) {
|
|
4466
4466
|
var n = this.start;
|
|
4467
|
-
this.eat(
|
|
4467
|
+
this.eat(o.comma) && this.eat(o.parenR) ? this.raiseRecoverable(n, "Trailing comma is not allowed in import()") : this.unexpected(n);
|
|
4468
4468
|
}
|
|
4469
4469
|
return this.finishNode(i, "ImportExpression");
|
|
4470
4470
|
}, p.parseExport = function(i, r) {
|
|
4471
4471
|
var n = this.lookahead();
|
|
4472
|
-
if (this.ts_eatWithState(
|
|
4472
|
+
if (this.ts_eatWithState(o._import, 2, n)) {
|
|
4473
4473
|
this.ts_isContextual(I.type) && this.lookaheadCharCode() !== 61 ? (i.importKind = "type", this.importOrExportOuterKind = "type", this.next()) : (i.importKind = "value", this.importOrExportOuterKind = "value");
|
|
4474
4474
|
var c = this.tsParseImportEqualsDeclaration(i, !0);
|
|
4475
4475
|
return this.importOrExportOuterKind = void 0, c;
|
|
4476
4476
|
}
|
|
4477
|
-
if (this.ts_eatWithState(
|
|
4477
|
+
if (this.ts_eatWithState(o.eq, 2, n)) {
|
|
4478
4478
|
var f = i;
|
|
4479
4479
|
return f.expression = this.parseExpression(), this.semicolon(), this.importOrExportOuterKind = void 0, this.finishNode(f, "TSExportAssignment");
|
|
4480
4480
|
}
|
|
@@ -4482,11 +4482,11 @@ function ar(t) {
|
|
|
4482
4482
|
var m = i;
|
|
4483
4483
|
return this.expectContextual("namespace"), m.id = this.parseIdent(), this.semicolon(), this.importOrExportOuterKind = void 0, this.finishNode(m, "TSNamespaceExportDeclaration");
|
|
4484
4484
|
}
|
|
4485
|
-
if (this.ts_isContextualWithState(n, I.type) && this.lookahead(2).type ===
|
|
4486
|
-
if (this.eat(
|
|
4485
|
+
if (this.ts_isContextualWithState(n, I.type) && this.lookahead(2).type === o.braceL ? (this.next(), this.importOrExportOuterKind = "type", i.exportKind = "type") : (this.importOrExportOuterKind = "value", i.exportKind = "value"), this.next(), this.eat(o.star)) return this.parseExportAllDeclaration(i, r);
|
|
4486
|
+
if (this.eat(o._default)) return this.checkExport(r, "default", this.lastTokStart), i.declaration = this.parseExportDefaultDeclaration(), this.finishNode(i, "ExportDefaultDeclaration");
|
|
4487
4487
|
if (this.shouldParseExportStatement()) i.declaration = this.parseExportDeclaration(i), i.declaration.type === "VariableDeclaration" ? this.checkVariableExport(r, i.declaration.declarations) : this.checkExport(r, i.declaration.id, i.declaration.id.start), i.specifiers = [], i.source = null;
|
|
4488
4488
|
else {
|
|
4489
|
-
if (i.declaration = null, i.specifiers = this.parseExportSpecifiers(r), this.eatContextual("from")) this.type !==
|
|
4489
|
+
if (i.declaration = null, i.specifiers = this.parseExportSpecifiers(r), this.eatContextual("from")) this.type !== o.string && this.unexpected(), i.source = this.parseExprAtom(), this.parseMaybeImportAttributes(i);
|
|
4490
4490
|
else {
|
|
4491
4491
|
for (var y, x = Je(i.specifiers); !(y = x()).done; ) {
|
|
4492
4492
|
var b = y.value;
|
|
@@ -4517,10 +4517,10 @@ function ar(t) {
|
|
|
4517
4517
|
if (this.type === I.at) return this.parseDecorators(), this.parseExprAtom();
|
|
4518
4518
|
if (V(this.type)) {
|
|
4519
4519
|
var c = this.potentialArrowAt === this.start, f = this.start, m = this.startLoc, y = this.containsEsc, x = this.parseIdent(!1);
|
|
4520
|
-
if (this.options.ecmaVersion >= 8 && !y && x.name === "async" && !this.canInsertSemicolon() && this.eat(
|
|
4520
|
+
if (this.options.ecmaVersion >= 8 && !y && x.name === "async" && !this.canInsertSemicolon() && this.eat(o._function)) return this.overrideContext(lt.f_expr), this.parseFunction(this.startNodeAt(f, m), 0, !1, !0, r);
|
|
4521
4521
|
if (c && !this.canInsertSemicolon()) {
|
|
4522
|
-
if (this.eat(
|
|
4523
|
-
if (this.options.ecmaVersion >= 8 && x.name === "async" && this.type ===
|
|
4522
|
+
if (this.eat(o.arrow)) return this.parseArrowExpression(this.startNodeAt(f, m), [x], !1, r);
|
|
4523
|
+
if (this.options.ecmaVersion >= 8 && x.name === "async" && this.type === o.name && !y && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return x = this.parseIdent(!1), !this.canInsertSemicolon() && this.eat(o.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAt(f, m), [x], !0, r);
|
|
4524
4524
|
}
|
|
4525
4525
|
return x;
|
|
4526
4526
|
}
|
|
@@ -4530,21 +4530,21 @@ function ar(t) {
|
|
|
4530
4530
|
var i = this.potentialArrowAt === this.start, r = this.containsEsc, n = this.parseIdent();
|
|
4531
4531
|
if (!r && n.name === "async" && !this.canInsertSemicolon()) {
|
|
4532
4532
|
var c = this.type;
|
|
4533
|
-
if (c ===
|
|
4533
|
+
if (c === o._function) return this.next(), this.parseFunction(this.startNodeAtNode(n), void 0, !0, !0);
|
|
4534
4534
|
if (V(c)) {
|
|
4535
4535
|
if (this.lookaheadCharCode() === 61) {
|
|
4536
4536
|
var f = this.parseIdent(!1);
|
|
4537
|
-
return !this.canInsertSemicolon() && this.eat(
|
|
4537
|
+
return !this.canInsertSemicolon() && this.eat(o.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAtNode(n), [f], !0);
|
|
4538
4538
|
}
|
|
4539
4539
|
return n;
|
|
4540
4540
|
}
|
|
4541
4541
|
}
|
|
4542
|
-
return i && this.match(
|
|
4542
|
+
return i && this.match(o.arrow) && !this.canInsertSemicolon() ? (this.next(), this.parseArrowExpression(this.startNodeAtNode(n), [n], !1)) : n;
|
|
4543
4543
|
}
|
|
4544
4544
|
this.unexpected();
|
|
4545
4545
|
}, p.parseIdentNode = function() {
|
|
4546
4546
|
var i = this.startNode();
|
|
4547
|
-
return
|
|
4547
|
+
return Jt(this.type) ? (i.name = this.value, i) : S.prototype.parseIdentNode.call(this);
|
|
4548
4548
|
}, p.parseVarStatement = function(i, r, n) {
|
|
4549
4549
|
n === void 0 && (n = !1);
|
|
4550
4550
|
var c = this.isAmbientContext;
|
|
@@ -4557,9 +4557,9 @@ function ar(t) {
|
|
|
4557
4557
|
}
|
|
4558
4558
|
return f;
|
|
4559
4559
|
}, p.parseStatement = function(i, r, n) {
|
|
4560
|
-
if (this.match(I.at) && this.parseDecorators(!0), this.match(
|
|
4560
|
+
if (this.match(I.at) && this.parseDecorators(!0), this.match(o._const) && this.isLookaheadContextual("enum")) {
|
|
4561
4561
|
var c = this.startNode();
|
|
4562
|
-
return this.expect(
|
|
4562
|
+
return this.expect(o._const), this.tsParseEnumDeclaration(c, { const: !0 });
|
|
4563
4563
|
}
|
|
4564
4564
|
if (this.ts_isContextual(I.enum)) return this.tsParseEnumDeclaration(this.startNode());
|
|
4565
4565
|
if (this.ts_isContextual(I.interface)) {
|
|
@@ -4570,28 +4570,28 @@ function ar(t) {
|
|
|
4570
4570
|
}, p.parseAccessModifier = function() {
|
|
4571
4571
|
return this.tsParseModifier(["public", "protected", "private"]);
|
|
4572
4572
|
}, p.parsePostMemberNameModifiers = function(i) {
|
|
4573
|
-
this.eat(
|
|
4573
|
+
this.eat(o.question) && (i.optional = !0), i.readonly && this.match(o.parenL) && this.raise(i.start, A.ClassMethodHasReadonly), i.declare && this.match(o.parenL) && this.raise(i.start, A.ClassMethodHasDeclare);
|
|
4574
4574
|
}, p.parseExpressionStatement = function(i, r) {
|
|
4575
4575
|
return (r.type === "Identifier" ? this.tsParseExpressionStatement(i, r) : void 0) || S.prototype.parseExpressionStatement.call(this, i, r);
|
|
4576
4576
|
}, p.shouldParseExportStatement = function() {
|
|
4577
4577
|
return !!this.tsIsDeclarationStart() || !!this.match(I.at) || S.prototype.shouldParseExportStatement.call(this);
|
|
4578
4578
|
}, p.parseConditional = function(i, r, n, c, f) {
|
|
4579
|
-
if (this.eat(
|
|
4579
|
+
if (this.eat(o.question)) {
|
|
4580
4580
|
var m = this.startNodeAt(r, n);
|
|
4581
|
-
return m.test = i, m.consequent = this.parseMaybeAssign(), this.expect(
|
|
4581
|
+
return m.test = i, m.consequent = this.parseMaybeAssign(), this.expect(o.colon), m.alternate = this.parseMaybeAssign(c), this.finishNode(m, "ConditionalExpression");
|
|
4582
4582
|
}
|
|
4583
4583
|
return i;
|
|
4584
4584
|
}, p.parseMaybeConditional = function(i, r) {
|
|
4585
4585
|
var n = this, c = this.start, f = this.startLoc, m = this.parseExprOps(i, r);
|
|
4586
4586
|
if (this.checkExpressionErrors(r)) return m;
|
|
4587
|
-
if (!this.maybeInArrowParameters || !this.match(
|
|
4587
|
+
if (!this.maybeInArrowParameters || !this.match(o.question)) return this.parseConditional(m, c, f, i, r);
|
|
4588
4588
|
var y = this.tryParse(function() {
|
|
4589
4589
|
return n.parseConditional(m, c, f, i, r);
|
|
4590
4590
|
});
|
|
4591
4591
|
return y.node ? (y.error && this.setLookaheadState(y.failState), y.node) : (y.error && this.setOptionalParametersError(r, y.error), m);
|
|
4592
4592
|
}, p.parseParenItem = function(i) {
|
|
4593
4593
|
var r = this.start, n = this.startLoc;
|
|
4594
|
-
if (i = S.prototype.parseParenItem.call(this, i), this.eat(
|
|
4594
|
+
if (i = S.prototype.parseParenItem.call(this, i), this.eat(o.question) && (i.optional = !0, this.resetEndLocation(i)), this.match(o.colon)) {
|
|
4595
4595
|
var c = this.startNodeAt(r, n);
|
|
4596
4596
|
return c.expression = i, c.typeAnnotation = this.tsParseTypeAnnotation(), this.finishNode(c, "TSTypeCastExpression");
|
|
4597
4597
|
}
|
|
@@ -4612,12 +4612,12 @@ function ar(t) {
|
|
|
4612
4612
|
n && (i.typeParameters = n);
|
|
4613
4613
|
}
|
|
4614
4614
|
}, p.parseClassPropertyAnnotation = function(i) {
|
|
4615
|
-
i.optional || (this.value === "!" && this.eat(
|
|
4615
|
+
i.optional || (this.value === "!" && this.eat(o.prefix) ? i.definite = !0 : this.eat(o.question) && (i.optional = !0));
|
|
4616
4616
|
var r = this.tsTryParseTypeAnnotation();
|
|
4617
4617
|
r && (i.typeAnnotation = r);
|
|
4618
4618
|
}, p.parseClassField = function(i) {
|
|
4619
4619
|
if (i.key.type === "PrivateIdentifier") i.abstract && this.raise(i.start, A.PrivateElementHasAbstract), i.accessibility && this.raise(i.start, A.PrivateElementHasAccessibility({ modifier: i.accessibility })), this.parseClassPropertyAnnotation(i);
|
|
4620
|
-
else if (this.parseClassPropertyAnnotation(i), this.isAmbientContext && (!i.readonly || i.typeAnnotation) && this.match(
|
|
4620
|
+
else if (this.parseClassPropertyAnnotation(i), this.isAmbientContext && (!i.readonly || i.typeAnnotation) && this.match(o.eq) && this.raise(this.start, A.DeclareClassFieldHasInitializer), i.abstract && this.match(o.eq)) {
|
|
4621
4621
|
var r = i.key;
|
|
4622
4622
|
this.raise(this.start, A.AbstractPropertyHasInitializer({ propertyName: r.type !== "Identifier" || i.computed ? "[" + this.input.slice(r.start, r.end) + "]" : r.name }));
|
|
4623
4623
|
}
|
|
@@ -4632,21 +4632,21 @@ function ar(t) {
|
|
|
4632
4632
|
var E = i.value = this.parseMethod(r, n, c, !0, i);
|
|
4633
4633
|
return i.kind === "get" && E.params.length !== 0 && this.raiseRecoverable(E.start, "getter should have no params"), i.kind === "set" && E.params.length !== 1 && this.raiseRecoverable(E.start, "setter should have exactly one param"), i.kind === "set" && E.params[0].type === "RestElement" && this.raiseRecoverable(E.params[0].start, "Setter cannot use rest params"), this.finishNode(i, "MethodDefinition");
|
|
4634
4634
|
}, p.isClassMethod = function() {
|
|
4635
|
-
return this.match(
|
|
4635
|
+
return this.match(o.relational);
|
|
4636
4636
|
}, p.parseClassElement = function(i) {
|
|
4637
4637
|
var r = this;
|
|
4638
|
-
if (this.eat(
|
|
4638
|
+
if (this.eat(o.semi)) return null;
|
|
4639
4639
|
var n, c = this.options.ecmaVersion, f = this.startNode(), m = "", y = !1, x = !1, b = "method", T = ["declare", "private", "public", "protected", "accessor", "override", "abstract", "readonly", "static"], E = this.tsParseModifiers({ modified: f, allowedModifiers: T, disallowedModifiers: ["in", "out"], stopOnStartOfClassStaticBlock: !0, errorTemplate: A.InvalidModifierOnTypeParameterPositions });
|
|
4640
4640
|
n = !!E.static;
|
|
4641
4641
|
var L = function() {
|
|
4642
4642
|
if (!r.tsIsStartOfStaticBlocks()) {
|
|
4643
4643
|
var w = r.tsTryParseIndexSignature(f);
|
|
4644
4644
|
if (w) return f.abstract && r.raise(f.start, A.IndexSignatureHasAbstract), f.accessibility && r.raise(f.start, A.IndexSignatureHasAccessibility({ modifier: f.accessibility })), f.declare && r.raise(f.start, A.IndexSignatureHasDeclare), f.override && r.raise(f.start, A.IndexSignatureHasOverride), w;
|
|
4645
|
-
if (!r.inAbstractClass && f.abstract && r.raise(f.start, A.NonAbstractClassHasAbstractMethod), f.override && i && r.raise(f.start, A.OverrideNotInSubClass), f.static = n, n && (r.isClassElementNameStart() || r.type ===
|
|
4645
|
+
if (!r.inAbstractClass && f.abstract && r.raise(f.start, A.NonAbstractClassHasAbstractMethod), f.override && i && r.raise(f.start, A.OverrideNotInSubClass), f.static = n, n && (r.isClassElementNameStart() || r.type === o.star || (m = "static")), !m && c >= 8 && r.eatContextual("async") && (!r.isClassElementNameStart() && r.type !== o.star || r.canInsertSemicolon() ? m = "async" : x = !0), !m && (c >= 9 || !x) && r.eat(o.star) && (y = !0), !m && !x && !y) {
|
|
4646
4646
|
var U = r.value;
|
|
4647
4647
|
(r.eatContextual("get") || r.eatContextual("set")) && (r.isClassElementNameStart() ? b = U : m = U);
|
|
4648
4648
|
}
|
|
4649
|
-
if (m ? (f.computed = !1, f.key = r.startNodeAt(r.lastTokStart, r.lastTokStartLoc), f.key.name = m, r.finishNode(f.key, "Identifier")) : r.parseClassElementName(f), r.parsePostMemberNameModifiers(f), r.isClassMethod() || c < 13 || r.type ===
|
|
4649
|
+
if (m ? (f.computed = !1, f.key = r.startNodeAt(r.lastTokStart, r.lastTokStartLoc), f.key.name = m, r.finishNode(f.key, "Identifier")) : r.parseClassElementName(f), r.parsePostMemberNameModifiers(f), r.isClassMethod() || c < 13 || r.type === o.parenL || b !== "method" || y || x) {
|
|
4650
4650
|
var B = !f.static && Ze(f, "constructor"), q = B && i;
|
|
4651
4651
|
B && b !== "method" && r.raise(f.key.start, "Constructor can't have get/set modifier"), f.kind = B ? "constructor" : b, r.parseClassMethod(f, y, x, q);
|
|
4652
4652
|
} else r.parseClassField(f);
|
|
@@ -4658,16 +4658,16 @@ function ar(t) {
|
|
|
4658
4658
|
}, p.isClassElementNameStart = function() {
|
|
4659
4659
|
return !!this.tsIsIdentifier() || S.prototype.isClassElementNameStart.call(this);
|
|
4660
4660
|
}, p.parseClassSuper = function(i) {
|
|
4661
|
-
S.prototype.parseClassSuper.call(this, i), i.superClass && (this.tsMatchLeftRelational() || this.match(
|
|
4661
|
+
S.prototype.parseClassSuper.call(this, i), i.superClass && (this.tsMatchLeftRelational() || this.match(o.bitShift)) && (i.superTypeParameters = this.tsParseTypeArgumentsInExpression()), this.eatContextual("implements") && (i.implements = this.tsParseHeritageClause("implements"));
|
|
4662
4662
|
}, p.parseFunctionParams = function(i) {
|
|
4663
4663
|
var r = this.tsTryParseTypeParameters();
|
|
4664
4664
|
r && (i.typeParameters = r), S.prototype.parseFunctionParams.call(this, i);
|
|
4665
4665
|
}, p.parseVarId = function(i, r) {
|
|
4666
|
-
S.prototype.parseVarId.call(this, i, r), i.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.value === "!" && this.eat(
|
|
4666
|
+
S.prototype.parseVarId.call(this, i, r), i.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.value === "!" && this.eat(o.prefix) && (i.definite = !0);
|
|
4667
4667
|
var n = this.tsTryParseTypeAnnotation();
|
|
4668
4668
|
n && (i.id.typeAnnotation = n, this.resetEndLocation(i.id));
|
|
4669
4669
|
}, p.parseArrowExpression = function(i, r, n, c) {
|
|
4670
|
-
this.match(
|
|
4670
|
+
this.match(o.colon) && (i.returnType = this.tsParseTypeAnnotation());
|
|
4671
4671
|
var f = this.yieldPos, m = this.awaitPos, y = this.awaitIdentPos;
|
|
4672
4672
|
this.enterScope(16 | Se(n, !1)), this.initFunction(i);
|
|
4673
4673
|
var x = this.maybeInArrowParameters;
|
|
@@ -4680,11 +4680,11 @@ function ar(t) {
|
|
|
4680
4680
|
var c = !1, f = -1, m = -1, y = -1;
|
|
4681
4681
|
r ? (f = r.parenthesizedAssign, m = r.trailingComma, y = r.doubleProto, r.parenthesizedAssign = r.trailingComma = -1) : (r = new Ut(), c = !0);
|
|
4682
4682
|
var x = this.start, b = this.startLoc;
|
|
4683
|
-
(this.type ===
|
|
4683
|
+
(this.type === o.parenL || V(this.type)) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = i === "await");
|
|
4684
4684
|
var T = this.parseMaybeConditional(i, r);
|
|
4685
4685
|
if (n && (T = n.call(this, T, x, b)), this.type.isAssign) {
|
|
4686
4686
|
var E = this.startNodeAt(x, b);
|
|
4687
|
-
return E.operator = this.value, this.type ===
|
|
4687
|
+
return E.operator = this.value, this.type === o.eq && (T = this.toAssignable(T, !0, r)), c || (r.parenthesizedAssign = r.trailingComma = r.doubleProto = -1), r.shorthandAssign >= T.start && (r.shorthandAssign = -1), this.type === o.eq ? this.checkLValPattern(T) : this.checkLValSimple(T), E.left = T, this.next(), E.right = this.parseMaybeAssign(i), y > -1 && (r.doubleProto = y), this.finishNode(E, "AssignmentExpression");
|
|
4688
4688
|
}
|
|
4689
4689
|
return c && this.checkExpressionErrors(r, !0), f > -1 && (r.parenthesizedAssign = f), m > -1 && (r.trailingComma = m), T;
|
|
4690
4690
|
}, p.parseMaybeAssign = function(i, r, n) {
|
|
@@ -4730,7 +4730,7 @@ function ar(t) {
|
|
|
4730
4730
|
}, p.checkLValInnerPattern = function(i, r, n) {
|
|
4731
4731
|
r === void 0 && (r = 0), i.type === "TSParameterProperty" ? this.checkLValInnerPattern(i.parameter, r, n) : S.prototype.checkLValInnerPattern.call(this, i, r, n);
|
|
4732
4732
|
}, p.parseBindingListItem = function(i) {
|
|
4733
|
-
this.eat(
|
|
4733
|
+
this.eat(o.question) && (i.type === "Identifier" || this.isAmbientContext || this.inType || this.raise(i.start, A.PatternIsOptional), i.optional = !0);
|
|
4734
4734
|
var r = this.tsTryParseTypeAnnotation();
|
|
4735
4735
|
return r && (i.typeAnnotation = r), this.resetEndLocation(i), i;
|
|
4736
4736
|
}, p.isAssignable = function(i, r) {
|
|
@@ -4810,21 +4810,21 @@ function ar(t) {
|
|
|
4810
4810
|
} }), i.index = this.pos, i;
|
|
4811
4811
|
}
|
|
4812
4812
|
}, p.parseBindingAtom = function() {
|
|
4813
|
-
return this.type ===
|
|
4813
|
+
return this.type === o._this ? this.parseIdent(!0) : S.prototype.parseBindingAtom.call(this);
|
|
4814
4814
|
}, p.shouldParseArrow = function(i) {
|
|
4815
4815
|
var r, n = this;
|
|
4816
|
-
if (r = this.match(
|
|
4816
|
+
if (r = this.match(o.colon) ? i.every(function(f) {
|
|
4817
4817
|
return n.isAssignable(f, !0);
|
|
4818
4818
|
}) : !this.canInsertSemicolon()) {
|
|
4819
|
-
if (this.match(
|
|
4819
|
+
if (this.match(o.colon)) {
|
|
4820
4820
|
var c = this.tryParse(function(f) {
|
|
4821
|
-
var m = n.tsParseTypeOrTypePredicateAnnotation(
|
|
4822
|
-
return !n.canInsertSemicolon() && n.match(
|
|
4821
|
+
var m = n.tsParseTypeOrTypePredicateAnnotation(o.colon);
|
|
4822
|
+
return !n.canInsertSemicolon() && n.match(o.arrow) || f(), m;
|
|
4823
4823
|
});
|
|
4824
4824
|
if (c.aborted) return this.shouldParseArrowReturnType = void 0, !1;
|
|
4825
4825
|
c.thrown || (c.error && this.setLookaheadState(c.failState), this.shouldParseArrowReturnType = c.node);
|
|
4826
4826
|
}
|
|
4827
|
-
return !!this.match(
|
|
4827
|
+
return !!this.match(o.arrow) || (this.shouldParseArrowReturnType = void 0, !1);
|
|
4828
4828
|
}
|
|
4829
4829
|
return this.shouldParseArrowReturnType = void 0, r;
|
|
4830
4830
|
}, p.parseParenArrowList = function(i, r, n, c) {
|
|
@@ -4836,19 +4836,19 @@ function ar(t) {
|
|
|
4836
4836
|
var y = this.maybeInArrowParameters;
|
|
4837
4837
|
this.maybeInArrowParameters = !0, this.next();
|
|
4838
4838
|
var x, b = this.start, T = this.startLoc, E = [], L = !0, w = !1, U = new Ut(), B = this.yieldPos, q = this.awaitPos;
|
|
4839
|
-
for (this.yieldPos = 0, this.awaitPos = 0; this.type !==
|
|
4840
|
-
if (L ? L = !1 : this.expect(
|
|
4839
|
+
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== o.parenR; ) {
|
|
4840
|
+
if (L ? L = !1 : this.expect(o.comma), m && this.afterTrailingComma(o.parenR, !0)) {
|
|
4841
4841
|
w = !0;
|
|
4842
4842
|
break;
|
|
4843
4843
|
}
|
|
4844
|
-
if (this.type ===
|
|
4845
|
-
x = this.start, E.push(this.parseParenItem(this.parseRestBinding())), this.type ===
|
|
4844
|
+
if (this.type === o.ellipsis) {
|
|
4845
|
+
x = this.start, E.push(this.parseParenItem(this.parseRestBinding())), this.type === o.comma && this.raise(this.start, "Comma is not permitted after the rest element");
|
|
4846
4846
|
break;
|
|
4847
4847
|
}
|
|
4848
4848
|
E.push(this.parseMaybeAssign(r, U, this.parseParenItem));
|
|
4849
4849
|
}
|
|
4850
4850
|
var G = this.lastTokEnd, it = this.lastTokEndLoc;
|
|
4851
|
-
if (this.expect(
|
|
4851
|
+
if (this.expect(o.parenR), this.maybeInArrowParameters = y, i && this.shouldParseArrow(E) && this.eat(o.arrow)) return this.checkPatternErrors(U, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = B, this.awaitPos = q, this.parseParenArrowList(c, f, E, r);
|
|
4852
4852
|
E.length && !w || this.unexpected(this.lastTokStart), x && this.unexpected(x), this.checkExpressionErrors(U, !0), this.yieldPos = B || this.yieldPos, this.awaitPos = q || this.awaitPos, E.length > 1 ? ((n = this.startNodeAt(b, T)).expressions = E, this.finishNodeAt(n, "SequenceExpression", G, it)) : n = E[0];
|
|
4853
4853
|
} else n = this.parseParenExpression();
|
|
4854
4854
|
if (this.options.preserveParens) {
|
|
@@ -4861,80 +4861,80 @@ function ar(t) {
|
|
|
4861
4861
|
return f.tag = i, f.quasi = this.parseTemplate({ isTagged: !0 }), c && this.raise(r, "Tagged Template Literals are not allowed in optionalChain."), this.finishNode(f, "TaggedTemplateExpression");
|
|
4862
4862
|
}, p.shouldParseAsyncArrow = function() {
|
|
4863
4863
|
var i = this;
|
|
4864
|
-
if (!this.match(
|
|
4864
|
+
if (!this.match(o.colon)) return !this.canInsertSemicolon() && this.eat(o.arrow);
|
|
4865
4865
|
var r = this.tryParse(function(n) {
|
|
4866
|
-
var c = i.tsParseTypeOrTypePredicateAnnotation(
|
|
4867
|
-
return !i.canInsertSemicolon() && i.match(
|
|
4866
|
+
var c = i.tsParseTypeOrTypePredicateAnnotation(o.colon);
|
|
4867
|
+
return !i.canInsertSemicolon() && i.match(o.arrow) || n(), c;
|
|
4868
4868
|
});
|
|
4869
|
-
return r.aborted ? (this.shouldParseAsyncArrowReturnType = void 0, !1) : r.thrown ? void 0 : (r.error && this.setLookaheadState(r.failState), this.shouldParseAsyncArrowReturnType = r.node, !this.canInsertSemicolon() && this.eat(
|
|
4869
|
+
return r.aborted ? (this.shouldParseAsyncArrowReturnType = void 0, !1) : r.thrown ? void 0 : (r.error && this.setLookaheadState(r.failState), this.shouldParseAsyncArrowReturnType = r.node, !this.canInsertSemicolon() && this.eat(o.arrow));
|
|
4870
4870
|
}, p.parseSubscriptAsyncArrow = function(i, r, n, c) {
|
|
4871
4871
|
var f = this.startNodeAt(i, r);
|
|
4872
4872
|
return f.returnType = this.shouldParseAsyncArrowReturnType, this.shouldParseAsyncArrowReturnType = void 0, this.parseArrowExpression(f, n, !0, c);
|
|
4873
4873
|
}, p.parseExprList = function(i, r, n, c) {
|
|
4874
4874
|
for (var f = [], m = !0; !this.eat(i); ) {
|
|
4875
4875
|
if (m) m = !1;
|
|
4876
|
-
else if (this.expect(
|
|
4876
|
+
else if (this.expect(o.comma), r && this.afterTrailingComma(i)) break;
|
|
4877
4877
|
var y = void 0;
|
|
4878
|
-
n && this.type ===
|
|
4878
|
+
n && this.type === o.comma ? y = null : this.type === o.ellipsis ? (y = this.parseSpread(c), c && this.type === o.comma && c.trailingComma < 0 && (c.trailingComma = this.start)) : y = this.parseMaybeAssign(!1, c, this.parseParenItem), f.push(y);
|
|
4879
4879
|
}
|
|
4880
4880
|
return f;
|
|
4881
4881
|
}, p.parseSubscript = function(i, r, n, c, f, m, y) {
|
|
4882
4882
|
var x = this, b = m;
|
|
4883
|
-
if (!this.hasPrecedingLineBreak() && this.value === "!" && this.match(
|
|
4883
|
+
if (!this.hasPrecedingLineBreak() && this.value === "!" && this.match(o.prefix)) {
|
|
4884
4884
|
this.exprAllowed = !1, this.next();
|
|
4885
4885
|
var T = this.startNodeAt(r, n);
|
|
4886
4886
|
return T.expression = i, i = this.finishNode(T, "TSNonNullExpression");
|
|
4887
4887
|
}
|
|
4888
4888
|
var E = !1;
|
|
4889
|
-
if (this.match(
|
|
4889
|
+
if (this.match(o.questionDot) && this.lookaheadCharCode() === 60) {
|
|
4890
4890
|
if (c) return i;
|
|
4891
4891
|
i.optional = !0, b = E = !0, this.next();
|
|
4892
4892
|
}
|
|
4893
|
-
if (this.tsMatchLeftRelational() || this.match(
|
|
4893
|
+
if (this.tsMatchLeftRelational() || this.match(o.bitShift)) {
|
|
4894
4894
|
var L, w = this.tsTryParseAndCatch(function() {
|
|
4895
4895
|
if (!c && x.atPossibleAsyncArrow(i)) {
|
|
4896
4896
|
var Be = x.tsTryParseGenericAsyncArrowFunction(r, n, y);
|
|
4897
4897
|
if (Be) return i = Be;
|
|
4898
4898
|
}
|
|
4899
|
-
var
|
|
4900
|
-
if (!
|
|
4901
|
-
if (E && !x.match(
|
|
4902
|
-
if (Gi(x.type) || x.type ===
|
|
4899
|
+
var Zt = x.tsParseTypeArgumentsInExpression();
|
|
4900
|
+
if (!Zt) return i;
|
|
4901
|
+
if (E && !x.match(o.parenL)) return L = x.curPosition(), i;
|
|
4902
|
+
if (Gi(x.type) || x.type === o.backQuote) {
|
|
4903
4903
|
var Ue = x.parseTaggedTemplateExpression(i, r, n, b);
|
|
4904
|
-
return Ue.typeParameters =
|
|
4904
|
+
return Ue.typeParameters = Zt, Ue;
|
|
4905
4905
|
}
|
|
4906
|
-
if (!c && x.eat(
|
|
4906
|
+
if (!c && x.eat(o.parenL)) {
|
|
4907
4907
|
var qe = new Ut(), Lt = x.startNodeAt(r, n);
|
|
4908
|
-
return Lt.callee = i, Lt.arguments = x.parseExprList(
|
|
4908
|
+
return Lt.callee = i, Lt.arguments = x.parseExprList(o.parenR, x.options.ecmaVersion >= 8, !1, qe), x.tsCheckForInvalidTypeCasts(Lt.arguments), Lt.typeParameters = Zt, b && (Lt.optional = E), x.checkExpressionErrors(qe, !0), i = x.finishNode(Lt, "CallExpression");
|
|
4909
4909
|
}
|
|
4910
4910
|
var me = x.type;
|
|
4911
|
-
if (!(x.tsMatchRightRelational() || me ===
|
|
4911
|
+
if (!(x.tsMatchRightRelational() || me === o.bitShift || me !== o.parenL && (He = me, !!He.startsExpr) && !x.hasPrecedingLineBreak())) {
|
|
4912
4912
|
var He, ye = x.startNodeAt(r, n);
|
|
4913
|
-
return ye.expression = i, ye.typeParameters =
|
|
4913
|
+
return ye.expression = i, ye.typeParameters = Zt, x.finishNode(ye, "TSInstantiationExpression");
|
|
4914
4914
|
}
|
|
4915
4915
|
});
|
|
4916
|
-
if (L && this.unexpected(L), w) return w.type === "TSInstantiationExpression" && (this.match(
|
|
4916
|
+
if (L && this.unexpected(L), w) return w.type === "TSInstantiationExpression" && (this.match(o.dot) || this.match(o.questionDot) && this.lookaheadCharCode() !== 40) && this.raise(this.start, A.InvalidPropertyAccessAfterInstantiationExpression), i = w;
|
|
4917
4917
|
}
|
|
4918
|
-
var U = this.options.ecmaVersion >= 11, B = U && this.eat(
|
|
4918
|
+
var U = this.options.ecmaVersion >= 11, B = U && this.eat(o.questionDot);
|
|
4919
4919
|
c && B && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
4920
|
-
var q = this.eat(
|
|
4921
|
-
if (q || B && this.type !==
|
|
4920
|
+
var q = this.eat(o.bracketL);
|
|
4921
|
+
if (q || B && this.type !== o.parenL && this.type !== o.backQuote || this.eat(o.dot)) {
|
|
4922
4922
|
var G = this.startNodeAt(r, n);
|
|
4923
|
-
G.object = i, q ? (G.property = this.parseExpression(), this.expect(
|
|
4924
|
-
} else if (!c && this.eat(
|
|
4923
|
+
G.object = i, q ? (G.property = this.parseExpression(), this.expect(o.bracketR)) : G.property = this.type === o.privateId && i.type !== "Super" ? this.parsePrivateIdent() : this.parseIdent(this.options.allowReserved !== "never"), G.computed = !!q, U && (G.optional = B), i = this.finishNode(G, "MemberExpression");
|
|
4924
|
+
} else if (!c && this.eat(o.parenL)) {
|
|
4925
4925
|
var it = this.maybeInArrowParameters;
|
|
4926
4926
|
this.maybeInArrowParameters = !0;
|
|
4927
4927
|
var Ct = new Ut(), Ft = this.yieldPos, jt = this.awaitPos, wt = this.awaitIdentPos;
|
|
4928
4928
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
4929
|
-
var je = this.parseExprList(
|
|
4929
|
+
var je = this.parseExprList(o.parenR, this.options.ecmaVersion >= 8, !1, Ct);
|
|
4930
4930
|
if (f && !B && this.shouldParseAsyncArrow()) this.checkPatternErrors(Ct, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = Ft, this.awaitPos = jt, this.awaitIdentPos = wt, i = this.parseSubscriptAsyncArrow(r, n, je, y);
|
|
4931
4931
|
else {
|
|
4932
4932
|
this.checkExpressionErrors(Ct, !0), this.yieldPos = Ft || this.yieldPos, this.awaitPos = jt || this.awaitPos, this.awaitIdentPos = wt || this.awaitIdentPos;
|
|
4933
|
-
var
|
|
4934
|
-
|
|
4933
|
+
var Yt = this.startNodeAt(r, n);
|
|
4934
|
+
Yt.callee = i, Yt.arguments = je, U && (Yt.optional = B), i = this.finishNode(Yt, "CallExpression");
|
|
4935
4935
|
}
|
|
4936
4936
|
this.maybeInArrowParameters = it;
|
|
4937
|
-
} else if (this.type ===
|
|
4937
|
+
} else if (this.type === o.backQuote) {
|
|
4938
4938
|
(B || b) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
4939
4939
|
var de = this.startNodeAt(r, n);
|
|
4940
4940
|
de.tag = i, de.quasi = this.parseTemplate({ isTagged: !0 }), i = this.finishNode(de, "TaggedTemplateExpression");
|
|
@@ -4956,7 +4956,7 @@ function ar(t) {
|
|
|
4956
4956
|
var i = this.parseBindingAtom(), r = i.type === "Identifier";
|
|
4957
4957
|
this.enterScope(r ? 32 : 0), this.checkLValPattern(i, r ? 4 : 2);
|
|
4958
4958
|
var n = this.tsTryParseTypeAnnotation();
|
|
4959
|
-
return n && (i.typeAnnotation = n, this.resetEndLocation(i)), this.expect(
|
|
4959
|
+
return n && (i.typeAnnotation = n, this.resetEndLocation(i)), this.expect(o.parenR), i;
|
|
4960
4960
|
}, p.parseClass = function(i, r) {
|
|
4961
4961
|
var n = this.inAbstractClass;
|
|
4962
4962
|
this.inAbstractClass = !!i.abstract;
|
|
@@ -4967,7 +4967,7 @@ function ar(t) {
|
|
|
4967
4967
|
var f = this.enterClassBody(), m = this.startNode(), y = !1;
|
|
4968
4968
|
m.body = [];
|
|
4969
4969
|
var x = [];
|
|
4970
|
-
for (this.expect(
|
|
4970
|
+
for (this.expect(o.braceL); this.type !== o.braceR; ) if (this.match(I.at)) x.push(this.parseDecorator());
|
|
4971
4971
|
else {
|
|
4972
4972
|
var b = this.parseClassElement(i.superClass !== null);
|
|
4973
4973
|
x.length && (b.decorators = x, this.resetStartLocationFromNode(b, x[0]), x = []), b && (m.body.push(b), b.type === "MethodDefinition" && b.kind === "constructor" && b.value.type === "FunctionExpression" ? (y && this.raiseRecoverable(b.start, "Duplicate constructor in the same class"), y = !0, b.decorators && b.decorators.length > 0 && this.raise(b.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")) : b.key && b.key.type === "PrivateIdentifier" && Ys(f, b) && this.raiseRecoverable(b.key.start, "Identifier '#" + b.key.name + "' has already been declared"));
|
|
@@ -4977,11 +4977,11 @@ function ar(t) {
|
|
|
4977
4977
|
this.inAbstractClass = n;
|
|
4978
4978
|
}
|
|
4979
4979
|
}, p.parseClassFunctionParams = function() {
|
|
4980
|
-
var i = this.tsTryParseTypeParameters(this.tsParseConstModifier), r = this.parseBindingList(
|
|
4980
|
+
var i = this.tsTryParseTypeParameters(this.tsParseConstModifier), r = this.parseBindingList(o.parenR, !1, this.options.ecmaVersion >= 8, !0);
|
|
4981
4981
|
return i && (r.typeParameters = i), r;
|
|
4982
4982
|
}, p.parseMethod = function(i, r, n, c, f) {
|
|
4983
4983
|
var m = this.startNode(), y = this.yieldPos, x = this.awaitPos, b = this.awaitIdentPos;
|
|
4984
|
-
if (this.initFunction(m), this.options.ecmaVersion >= 6 && (m.generator = i), this.options.ecmaVersion >= 8 && (m.async = !!r), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | Se(r, m.generator) | (n ? 128 : 0)), this.expect(
|
|
4984
|
+
if (this.initFunction(m), this.options.ecmaVersion >= 6 && (m.generator = i), this.options.ecmaVersion >= 8 && (m.async = !!r), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | Se(r, m.generator) | (n ? 128 : 0)), this.expect(o.parenL), m.params = this.parseClassFunctionParams(), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(m, !1, !0, !1, { isClassMethod: c }), this.yieldPos = y, this.awaitPos = x, this.awaitIdentPos = b, f && f.abstract && m.body) {
|
|
4985
4985
|
var T = f.key;
|
|
4986
4986
|
this.raise(f.start, A.AbstractMethodHasImplementation({ methodName: T.type !== "Identifier" || f.computed ? "[" + this.input.slice(T.start, T.end) + "]" : T.name }));
|
|
4987
4987
|
}
|
|
@@ -5005,7 +5005,7 @@ function ar(t) {
|
|
|
5005
5005
|
return r.importKind = "value", r;
|
|
5006
5006
|
}, p.parseExportSpecifier = function(i) {
|
|
5007
5007
|
var r = this.ts_isContextual(I.type);
|
|
5008
|
-
if (!this.match(
|
|
5008
|
+
if (!this.match(o.string) && r) {
|
|
5009
5009
|
var n = this.startNode();
|
|
5010
5010
|
return n.local = this.parseModuleExportName(), this.parseTypeOnlyImportExportSpecifier(n, !1, this.importOrExportOuterKind === "type"), this.finishNode(n, "ExportSpecifier"), this.checkExport(i, n.exported, n.exported.start), n;
|
|
5011
5011
|
}
|
|
@@ -5017,35 +5017,35 @@ function ar(t) {
|
|
|
5017
5017
|
var E = this.parseIdent();
|
|
5018
5018
|
if (this.isContextual("as")) {
|
|
5019
5019
|
var L = this.parseIdent();
|
|
5020
|
-
|
|
5021
|
-
} else
|
|
5022
|
-
} else
|
|
5020
|
+
Jt(this.type) ? (x = !0, y = E, c = r ? this.parseIdent() : this.parseModuleExportName(), b = !1) : (c = L, b = !1);
|
|
5021
|
+
} else Jt(this.type) ? (b = !1, c = r ? this.parseIdent() : this.parseModuleExportName()) : (x = !0, y = E);
|
|
5022
|
+
} else Jt(this.type) && (x = !0, r ? (y = S.prototype.parseIdent.call(this, !0), this.isContextual("as") || this.checkUnreserved(y)) : y = this.parseModuleExportName());
|
|
5023
5023
|
x && n && this.raise(T, r ? A.TypeModifierIsUsedInTypeImports : A.TypeModifierIsUsedInTypeExports), i[f] = y, i[m] = c, i[r ? "importKind" : "exportKind"] = x ? "type" : "value", b && this.eatContextual("as") && (i[m] = r ? this.parseIdent() : this.parseModuleExportName()), i[m] || (i[m] = this.copyNode(i[f])), r && this.checkLValSimple(i[m], 2);
|
|
5024
5024
|
}, p.raiseCommonCheck = function(i, r, n) {
|
|
5025
|
-
return r === "Comma is not permitted after the rest element" ? this.isAmbientContext && this.match(
|
|
5025
|
+
return r === "Comma is not permitted after the rest element" ? this.isAmbientContext && this.match(o.comma) && this.lookaheadCharCode() === 41 ? void this.next() : S.prototype.raise.call(this, i, r) : n ? S.prototype.raiseRecoverable.call(this, i, r) : S.prototype.raise.call(this, i, r);
|
|
5026
5026
|
}, p.raiseRecoverable = function(i, r) {
|
|
5027
5027
|
return this.raiseCommonCheck(i, r, !0);
|
|
5028
5028
|
}, p.raise = function(i, r) {
|
|
5029
5029
|
return this.raiseCommonCheck(i, r, !0);
|
|
5030
5030
|
}, p.updateContext = function(i) {
|
|
5031
5031
|
var r = this.type;
|
|
5032
|
-
if (r ==
|
|
5032
|
+
if (r == o.braceL) {
|
|
5033
5033
|
var n = this.curContext();
|
|
5034
5034
|
n == Z.tc_oTag ? this.context.push(lt.b_expr) : n == Z.tc_expr ? this.context.push(lt.b_tmpl) : S.prototype.updateContext.call(this, i), this.exprAllowed = !0;
|
|
5035
5035
|
} else {
|
|
5036
|
-
if (r !==
|
|
5036
|
+
if (r !== o.slash || i !== I.jsxTagStart) return S.prototype.updateContext.call(this, i);
|
|
5037
5037
|
this.context.length -= 2, this.context.push(Z.tc_cTag), this.exprAllowed = !1;
|
|
5038
5038
|
}
|
|
5039
5039
|
}, p.jsx_parseOpeningElementAt = function(i, r) {
|
|
5040
5040
|
var n = this, c = this.startNodeAt(i, r), f = this.jsx_parseElementName();
|
|
5041
|
-
if (f && (c.name = f), this.match(
|
|
5041
|
+
if (f && (c.name = f), this.match(o.relational) || this.match(o.bitShift)) {
|
|
5042
5042
|
var m = this.tsTryParseAndCatch(function() {
|
|
5043
5043
|
return n.tsParseTypeArgumentsInExpression();
|
|
5044
5044
|
});
|
|
5045
5045
|
m && (c.typeParameters = m);
|
|
5046
5046
|
}
|
|
5047
|
-
for (c.attributes = []; this.type !==
|
|
5048
|
-
return c.selfClosing = this.eat(
|
|
5047
|
+
for (c.attributes = []; this.type !== o.slash && this.type !== I.jsxTagEnd; ) c.attributes.push(this.jsx_parseAttribute());
|
|
5048
|
+
return c.selfClosing = this.eat(o.slash), this.expect(I.jsxTagEnd), this.finishNode(c, f ? "JSXOpeningElement" : "JSXOpeningFragment");
|
|
5049
5049
|
}, p.enterScope = function(i) {
|
|
5050
5050
|
i === Bt && this.importsStack.push([]), S.prototype.enterScope.call(this, i);
|
|
5051
5051
|
var r = S.prototype.currentScope.call(this);
|
|
@@ -5111,11 +5111,11 @@ async function hr(t) {
|
|
|
5111
5111
|
}
|
|
5112
5112
|
await Promise.all(
|
|
5113
5113
|
e.map(async (s) => {
|
|
5114
|
-
const a =
|
|
5114
|
+
const a = qt.join(t, s.name);
|
|
5115
5115
|
try {
|
|
5116
5116
|
await at.rm(a, { recursive: !0, force: !0 });
|
|
5117
|
-
} catch (
|
|
5118
|
-
if (
|
|
5117
|
+
} catch (h) {
|
|
5118
|
+
if (h.code !== "ENOENT") throw h;
|
|
5119
5119
|
}
|
|
5120
5120
|
})
|
|
5121
5121
|
);
|
|
@@ -5126,18 +5126,18 @@ function De(t) {
|
|
|
5126
5126
|
sourceType: "module",
|
|
5127
5127
|
locations: !0
|
|
5128
5128
|
}), a = [];
|
|
5129
|
-
return Ae(s, (
|
|
5130
|
-
if (
|
|
5131
|
-
const l =
|
|
5129
|
+
return Ae(s, (h) => {
|
|
5130
|
+
if (h.type !== "MethodDefinition") return;
|
|
5131
|
+
const l = h, d = l.key;
|
|
5132
5132
|
if (d.type !== "Identifier") return;
|
|
5133
5133
|
const v = d.name;
|
|
5134
5134
|
v && v !== "constructor" && l.accessibility !== "private" && a.push(v);
|
|
5135
5135
|
}), a;
|
|
5136
5136
|
}
|
|
5137
5137
|
async function ct(t, e, s = [], a) {
|
|
5138
|
-
const
|
|
5139
|
-
t !== void 0 &&
|
|
5140
|
-
const { stdout: l, stderr: d } = await or(
|
|
5138
|
+
const h = `${e} ${s.join(" ")}`;
|
|
5139
|
+
t !== void 0 && W(`${t} - exec(${h})`);
|
|
5140
|
+
const { stdout: l, stderr: d } = await or(h);
|
|
5141
5141
|
a === void 0 ? l.trim() && console.log(l.trim()) : await at.writeFile(a, l.trim(), "utf8"), d.trim() && console.error(d.trim());
|
|
5142
5142
|
}
|
|
5143
5143
|
async function ur(t, e) {
|
|
@@ -5160,7 +5160,7 @@ function Pt(t) {
|
|
|
5160
5160
|
✅ ${t}
|
|
5161
5161
|
`);
|
|
5162
5162
|
}
|
|
5163
|
-
function
|
|
5163
|
+
function W(t) {
|
|
5164
5164
|
console.info(`
|
|
5165
5165
|
${t}
|
|
5166
5166
|
`);
|
|
@@ -5179,36 +5179,36 @@ async function cr(t) {
|
|
|
5179
5179
|
}
|
|
5180
5180
|
}
|
|
5181
5181
|
async function dt(t, e, s = [], a = !1) {
|
|
5182
|
-
return
|
|
5182
|
+
return W(`${t} - spawn(${e} ${s.join(" ")})`), new Promise((h, l) => {
|
|
5183
5183
|
as(e, s, { stdio: "inherit" }).on("close", (v) => {
|
|
5184
|
-
v === 0 || a ?
|
|
5184
|
+
v === 0 || a ? h() : l(new Error(`${e} exited with code ${v}`));
|
|
5185
5185
|
});
|
|
5186
5186
|
});
|
|
5187
5187
|
}
|
|
5188
5188
|
function qi(t, e, s, a) {
|
|
5189
|
-
const
|
|
5190
|
-
if (
|
|
5191
|
-
return `${t.slice(0, Math.max(0,
|
|
5189
|
+
const h = t.indexOf(s), l = t.indexOf(a);
|
|
5190
|
+
if (h === -1 || l === -1) throw new Error(`Markers ${s}-${a} not found in content.`);
|
|
5191
|
+
return `${t.slice(0, Math.max(0, h + s.length))}
|
|
5192
5192
|
${e}
|
|
5193
5193
|
${t.slice(Math.max(0, l))}`;
|
|
5194
5194
|
}
|
|
5195
5195
|
async function oe(t, e) {
|
|
5196
5196
|
await at.writeFile(t, JSON.stringify(e, void 0, 4), "utf8");
|
|
5197
5197
|
}
|
|
5198
|
-
async function
|
|
5198
|
+
async function Wt(t, e) {
|
|
5199
5199
|
await at.writeFile(t, e, "utf8");
|
|
5200
5200
|
}
|
|
5201
5201
|
function Ae(t, e) {
|
|
5202
5202
|
e(t);
|
|
5203
5203
|
for (const [s, a] of Object.entries(t)) {
|
|
5204
5204
|
if (["loc", "range", "start", "end", "comments"].includes(s)) continue;
|
|
5205
|
-
const
|
|
5206
|
-
if (Array.isArray(
|
|
5207
|
-
for (const l of
|
|
5205
|
+
const h = a;
|
|
5206
|
+
if (Array.isArray(h))
|
|
5207
|
+
for (const l of h) {
|
|
5208
5208
|
const d = l;
|
|
5209
5209
|
d && typeof d.type == "string" && Ae(d, e);
|
|
5210
5210
|
}
|
|
5211
|
-
else
|
|
5211
|
+
else h && typeof h == "object" && typeof h.type == "string" && Ae(h, e);
|
|
5212
5212
|
}
|
|
5213
5213
|
}
|
|
5214
5214
|
async function pr() {
|
|
@@ -5229,13 +5229,13 @@ async function ii(t) {
|
|
|
5229
5229
|
}
|
|
5230
5230
|
async function si(t, e) {
|
|
5231
5231
|
const s = `v${t.version}`;
|
|
5232
|
-
async function a(
|
|
5233
|
-
const d = await ur(
|
|
5232
|
+
async function a(h, l = "") {
|
|
5233
|
+
const d = await ur(h, { withFileTypes: !0 });
|
|
5234
5234
|
for (const v of d) {
|
|
5235
|
-
const g = `${
|
|
5235
|
+
const g = `${h}/${v.name}`, o = l ? `${l}/${v.name}` : v.name;
|
|
5236
5236
|
if (v.isDirectory()) continue;
|
|
5237
|
-
const P = `${e}_${s}/${
|
|
5238
|
-
console.info(`⚙️ Uploading '${
|
|
5237
|
+
const P = `${e}_${s}/${o}`.replaceAll("\\", "/"), N = v.name.endsWith(".css") ? "text/css" : "application/octet-stream", j = v.name.endsWith(".js") ? "application/javascript" : N;
|
|
5238
|
+
console.info(`⚙️ Uploading '${o}' → '${P}'...`), await ct(void 0, `wrangler r2 object put "${P}" --file="${g}" --content-type ${j} --jurisdiction=eu --remote`);
|
|
5239
5239
|
}
|
|
5240
5240
|
}
|
|
5241
5241
|
await a("dist");
|
|
@@ -5268,26 +5268,26 @@ async function Dr() {
|
|
|
5268
5268
|
e = await lr("2️⃣", t);
|
|
5269
5269
|
}
|
|
5270
5270
|
if (await dt("3️⃣ Bundle project", "vite", ["build"]), await ct("4️⃣ Stage changes", "git", ["add", "."]), await ct("5️⃣ Commit changes", "git", ["commit", "-m", `"v${t.version}"`]), await ct("6️⃣ Push changes", "git", ["push", "origin", "main:main"]), s.typeId === "app")
|
|
5271
|
-
|
|
5271
|
+
W("7️⃣ Register module"), await pr();
|
|
5272
5272
|
else if (s.typeId === "engine")
|
|
5273
|
-
|
|
5273
|
+
W("7️⃣ Register module"), await si(t, `datapos-engine-eu/${s.uploadGroupName}`), await ii(e);
|
|
5274
5274
|
else if (s.uploadGroupName === void 0)
|
|
5275
|
-
|
|
5275
|
+
W("7️⃣ Registration NOT required.");
|
|
5276
5276
|
else {
|
|
5277
|
-
|
|
5277
|
+
W("7️⃣ Register module");
|
|
5278
5278
|
const a = e.id.split("-").slice(2).join("-");
|
|
5279
5279
|
await si(t, `datapos-engine-eu/${s.uploadGroupName}/${a}`), await ii(e);
|
|
5280
5280
|
}
|
|
5281
5281
|
if (s.isPublish) {
|
|
5282
5282
|
const a = ".npmrc";
|
|
5283
5283
|
try {
|
|
5284
|
-
await
|
|
5284
|
+
await Wt(a, `registry=https://registry.npmjs.org/
|
|
5285
5285
|
//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN ?? ""}`), await dt("8️⃣ Publish to npm", "npm", ["publish", "--access", "public"]);
|
|
5286
5286
|
} finally {
|
|
5287
5287
|
await cr(a);
|
|
5288
5288
|
}
|
|
5289
5289
|
} else
|
|
5290
|
-
|
|
5290
|
+
W(`8️⃣ Publishing NOT required for package with type identifier of '${s.typeId}'.`);
|
|
5291
5291
|
Pt(`Project version '${t.version}' released.`);
|
|
5292
5292
|
} catch (t) {
|
|
5293
5293
|
console.error("❌ Error releasing project.", t), process.exit(1);
|
|
@@ -5297,7 +5297,7 @@ async function Vr() {
|
|
|
5297
5297
|
try {
|
|
5298
5298
|
vt("Synchronise Project with GitHub");
|
|
5299
5299
|
const t = await Q("package.json");
|
|
5300
|
-
|
|
5300
|
+
W("Bump project version"), await Hi("1️⃣", t), await ct("2️⃣ Stage changes", "git", ["add", "."]), await ct("3️⃣ Commit changes", "git", ["commit", "-m", `"v${t.version}"`]), await ct("4️⃣ Push changes", "git", ["push", "origin", "main:main"]), Pt(`Project version '${t.version}' synchronised with GitHub.`);
|
|
5301
5301
|
} catch (t) {
|
|
5302
5302
|
console.error("❌ Error synchronising project with GitHub.", t), process.exit(1);
|
|
5303
5303
|
}
|
|
@@ -5312,15 +5312,15 @@ function Fr() {
|
|
|
5312
5312
|
}
|
|
5313
5313
|
}
|
|
5314
5314
|
async function lr(t, e) {
|
|
5315
|
-
|
|
5315
|
+
W(`${t} Build project configuration`);
|
|
5316
5316
|
const s = await Q("config.json");
|
|
5317
5317
|
return e.name != null && (s.id = e.name.replace("@datapos/", "").replace("@data-positioning/", "")), e.version != null && (s.version = e.version), await oe("config.json", s), s;
|
|
5318
5318
|
}
|
|
5319
5319
|
async function fr(t, e) {
|
|
5320
|
-
|
|
5321
|
-
const [s, a] = await Promise.all([Q("config.json"), Et("src/index.ts")]),
|
|
5322
|
-
if (!
|
|
5323
|
-
throw console.error("❌ Configuration is invalid:"), console.table(
|
|
5320
|
+
W(`${t} Build connector project configuration`);
|
|
5321
|
+
const [s, a] = await Promise.all([Q("config.json"), Et("src/index.ts")]), h = /* @__PURE__ */ Ee(Zi, s);
|
|
5322
|
+
if (!h.success)
|
|
5323
|
+
throw console.error("❌ Configuration is invalid:"), console.table(h.issues), new Error("Configuration is invalid.");
|
|
5324
5324
|
const l = De(a), d = yr(l);
|
|
5325
5325
|
return await Fe(e, s, l, d);
|
|
5326
5326
|
}
|
|
@@ -5328,27 +5328,27 @@ async function Fe(t, e, s, a) {
|
|
|
5328
5328
|
return s.length > 0 ? (console.info(`ℹ️ Implements ${s.length} operations:`), console.table(s)) : console.warn("⚠️ Implements no operations."), a === "unknown" ? console.warn("⚠️ No usage identified.") : console.info(`ℹ️ Supports '${a}' usage.`), t.name != null && (e.id = t.name.replace("@datapos/", "").replace("@data-positioning/", "")), t.version != null && (e.version = t.version), e.operations = s, e.usageId = a, await oe("config.json", e), e;
|
|
5329
5329
|
}
|
|
5330
5330
|
async function dr(t, e) {
|
|
5331
|
-
|
|
5332
|
-
const [s, a] = await Promise.all([Q("config.json"), Et("src/index.ts")]),
|
|
5333
|
-
if (!
|
|
5334
|
-
throw console.error("❌ Configuration is invalid:"), console.table(
|
|
5331
|
+
W(`${t} Build context project configuration`);
|
|
5332
|
+
const [s, a] = await Promise.all([Q("config.json"), Et("src/index.ts")]), h = /* @__PURE__ */ Ee(Yi, s);
|
|
5333
|
+
if (!h.success)
|
|
5334
|
+
throw console.error("❌ Configuration is invalid:"), console.table(h.issues), new Error("Configuration is invalid.");
|
|
5335
5335
|
const l = De(a);
|
|
5336
5336
|
return await Fe(e, s, l);
|
|
5337
5337
|
}
|
|
5338
5338
|
async function mr(t, e) {
|
|
5339
|
-
|
|
5340
|
-
const [s, a] = await Promise.all([Q("config.json"), Et("src/index.ts")]),
|
|
5341
|
-
if (!
|
|
5342
|
-
throw console.error("❌ Configuration is invalid:"), console.table(
|
|
5339
|
+
W(`${t} Build presenter project configuration`);
|
|
5340
|
+
const [s, a] = await Promise.all([Q("config.json"), Et("src/index.ts")]), h = /* @__PURE__ */ Ee(is, s);
|
|
5341
|
+
if (!h.success)
|
|
5342
|
+
throw console.error("❌ Configuration is invalid:"), console.table(h.issues), new Error("Configuration is invalid.");
|
|
5343
5343
|
const l = De(a);
|
|
5344
5344
|
return await Fe(e, s, l);
|
|
5345
5345
|
}
|
|
5346
5346
|
async function Hi(t, e, s = "./") {
|
|
5347
|
-
if (
|
|
5347
|
+
if (W(`${t} Bump project version`), e.version == null)
|
|
5348
5348
|
e.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${e.version}'.`), await oe(`${s}package.json`, e);
|
|
5349
5349
|
else {
|
|
5350
|
-
const a = e.version,
|
|
5351
|
-
e.version = `${
|
|
5350
|
+
const a = e.version, h = e.version.split(".");
|
|
5351
|
+
e.version = `${h[0]}.${h[1]}.${Number(h[2]) + 1}`, console.info(`Project version bumped from '${a}' to '${e.version}'.`), await oe(`${s}package.json`, e);
|
|
5352
5352
|
}
|
|
5353
5353
|
}
|
|
5354
5354
|
function yr(t) {
|
|
@@ -5384,7 +5384,7 @@ async function jr() {
|
|
|
5384
5384
|
}
|
|
5385
5385
|
}
|
|
5386
5386
|
async function br(t) {
|
|
5387
|
-
|
|
5387
|
+
W(`${t} Insert OWASP Badge(s) into 'README.md'`);
|
|
5388
5388
|
const e = await Q("dependency-check-reports/dependency-check-report.json"), s = { critical: 0, high: 0, moderate: 0, low: 0, unknown: 0 };
|
|
5389
5389
|
for (const d of e.dependencies)
|
|
5390
5390
|
if (d.vulnerabilities != null)
|
|
@@ -5392,16 +5392,16 @@ async function br(t) {
|
|
|
5392
5392
|
const g = v.severity?.toLowerCase() ?? "unknown";
|
|
5393
5393
|
g in s ? s[g]++ : s.unknown++;
|
|
5394
5394
|
}
|
|
5395
|
-
const a = await Tr(s),
|
|
5396
|
-
await
|
|
5395
|
+
const a = await Tr(s), h = await Et("./README.md"), l = qi(h, a.join(" "), vr, gr);
|
|
5396
|
+
await Wt("README.md", l), console.info("OWASP audit badge(s) inserted into 'README.md'");
|
|
5397
5397
|
}
|
|
5398
5398
|
async function Tr(t) {
|
|
5399
5399
|
const e = await Q("config.json"), s = [];
|
|
5400
|
-
if (Object.values(t).reduce((
|
|
5400
|
+
if (Object.values(t).reduce((h, l) => h + l, 0) === 0)
|
|
5401
5401
|
console.info("No vulnerabilities found."), s.push(`[](https://data-positioning.github.io/${e.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
5402
5402
|
else
|
|
5403
|
-
for (const [
|
|
5404
|
-
const d = xr[
|
|
5403
|
+
for (const [h, l] of Object.entries(t)) {
|
|
5404
|
+
const d = xr[h];
|
|
5405
5405
|
if (console.warn(`⚠️ ${l} ${d.label} vulnerability(ies) found.`), l === 0) continue;
|
|
5406
5406
|
const v = `https://img.shields.io/badge/OWASP-${l}%20${d.label}-${d.color}`;
|
|
5407
5407
|
s.push(`[](https://data-positioning.github.io/${e.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
@@ -5419,7 +5419,7 @@ const Sr = "<!-- DEPENDENCY_LICENSES_START -->", Pr = "<!-- DEPENDENCY_LICENSES_
|
|
|
5419
5419
|
async function Ur(t = [], e = !0) {
|
|
5420
5420
|
try {
|
|
5421
5421
|
vt("Document Dependencies"), await Ve();
|
|
5422
|
-
const s = t.flatMap((
|
|
5422
|
+
const s = t.flatMap((h) => ["--allowed", `'${h}'`]), a = ri(new ns(import.meta.resolve("@datapos/datapos-development/license-report-config")));
|
|
5423
5423
|
await ct(
|
|
5424
5424
|
"1️⃣ Generate 'licenses.json' file",
|
|
5425
5425
|
"license-report",
|
|
@@ -5430,7 +5430,7 @@ async function Ur(t = [], e = !0) {
|
|
|
5430
5430
|
"license-report-recursive",
|
|
5431
5431
|
["--only=prod,peer", "--output=tree", "--recurse", "--department.value=n/a", "--licensePeriod.value=n/a", "--material.value=n/a", "--relatedTo.value=n/a"],
|
|
5432
5432
|
"licenses/licenseTree.json"
|
|
5433
|
-
), await ct("4️⃣ Check 'licenseTree.json' file", "license-report-check", ["--source", "licenses/licenseTree.json", "--output=table", ...s])) : (
|
|
5433
|
+
), await ct("4️⃣ Check 'licenseTree.json' file", "license-report-check", ["--source", "licenses/licenseTree.json", "--output=table", ...s])) : (W("3️⃣ Skip 'licenses/licenseTree.json' file generate"), W("4️⃣ Skip 'licenses/licenseTree.json' file check")), await hr("licenses/downloads"), await ct("5️⃣ Download license files", "license-downloader", [
|
|
5434
5434
|
"--source",
|
|
5435
5435
|
"licenses/licenses.json",
|
|
5436
5436
|
"--licDir",
|
|
@@ -5444,45 +5444,45 @@ async function Ur(t = [], e = !0) {
|
|
|
5444
5444
|
}
|
|
5445
5445
|
}
|
|
5446
5446
|
async function Cr(t, e) {
|
|
5447
|
-
|
|
5447
|
+
W(`${t} Insert licenses into 'README.md'`);
|
|
5448
5448
|
const s = await Q("licenses/licenses.json"), a = await Q("licenses/downloads/licenses.ext.json");
|
|
5449
|
-
let
|
|
5450
|
-
e && (
|
|
5449
|
+
let h = [];
|
|
5450
|
+
e && (h = await Q("licenses/licenseTree.json"));
|
|
5451
5451
|
const l = [
|
|
5452
5452
|
...(() => {
|
|
5453
|
-
const
|
|
5453
|
+
const o = /* @__PURE__ */ new Map();
|
|
5454
5454
|
for (const P of s)
|
|
5455
|
-
|
|
5455
|
+
o.set(P.name, { ...P });
|
|
5456
5456
|
for (const P of a) {
|
|
5457
|
-
const N =
|
|
5458
|
-
|
|
5457
|
+
const N = o.get(P.name);
|
|
5458
|
+
o.set(P.name, N ? { ...N, ...P } : { ...P });
|
|
5459
5459
|
}
|
|
5460
|
-
for (const P of
|
|
5461
|
-
const N =
|
|
5462
|
-
N &&
|
|
5460
|
+
for (const P of h) {
|
|
5461
|
+
const N = o.get(P.name);
|
|
5462
|
+
N && o.set(P.name, { ...N, dependencyCount: P.requires?.length ?? 0 });
|
|
5463
5463
|
}
|
|
5464
|
-
return
|
|
5464
|
+
return o.values();
|
|
5465
5465
|
})()
|
|
5466
5466
|
];
|
|
5467
5467
|
let d = `|Name|Type|Installed|Latest|Latest Released|Deps|Document|
|
|
5468
5468
|
|:-|:-|:-:|:-:|:-|-:|:-|
|
|
5469
5469
|
`;
|
|
5470
|
-
for (const
|
|
5471
|
-
const P =
|
|
5470
|
+
for (const o of l) {
|
|
5471
|
+
const P = o.installedVersion === o.remoteVersion ? o.installedVersion : `${o.installedVersion} ⚠️`, N = o.latestRemoteModified ? wr(o.latestRemoteModified.split("T")[0]) : "n/a", j = o.dependencyCount != null && o.dependencyCount >= 0 ? o.dependencyCount : "n/a";
|
|
5472
5472
|
let nt;
|
|
5473
|
-
|
|
5473
|
+
o.licenseFileLink == null || o.licenseFileLink == "" ? nt = "⚠️ No license file" : nt = `[${o.licenseFileLink.slice(Math.max(0, o.licenseFileLink.lastIndexOf("/") + 1))}](${o.licenseFileLink})`, d += `|${o.name}|${o.licenseType}|${P}|${o.remoteVersion}|${N}|${j}|${nt}|
|
|
5474
5474
|
`;
|
|
5475
5475
|
}
|
|
5476
5476
|
const v = await Et("./README.md"), g = qi(v, d, Sr, Pr);
|
|
5477
|
-
await
|
|
5477
|
+
await Wt("README.md", g), console.info("OWASP audit badge(s) inserted into 'README.md'"), await Wt("README.md", g);
|
|
5478
5478
|
}
|
|
5479
5479
|
function wr(t) {
|
|
5480
5480
|
if (t == null || t === "") return "n/a";
|
|
5481
5481
|
const e = t.split("T")[0];
|
|
5482
5482
|
if (e == null || e === "") return "n/a";
|
|
5483
5483
|
const s = new Date(e), a = /* @__PURE__ */ new Date();
|
|
5484
|
-
let
|
|
5485
|
-
return a.getDate() < s.getDate() && (
|
|
5484
|
+
let h = (a.getFullYear() - s.getFullYear()) * 12 + (a.getMonth() - s.getMonth());
|
|
5485
|
+
return a.getDate() < s.getDate() && (h -= 1), h === 0 ? `this month: ${e}` : h === 1 ? `1 month ago: ${e}` : h <= 6 ? `${h} months ago: ${e}` : h <= 12 ? `${h} months ago: ${e} ⚠️` : `${h} months ago: ${e}❗`;
|
|
5486
5486
|
}
|
|
5487
5487
|
async function qr() {
|
|
5488
5488
|
try {
|
|
@@ -5509,7 +5509,7 @@ async function $r(t = []) {
|
|
|
5509
5509
|
if (s === "eslint")
|
|
5510
5510
|
await dt(`${a} Update '${s}'`, "npm", ["install", "@datapos/eslint-config-datapos@latest"]);
|
|
5511
5511
|
else if (await dt(`${a} Update '${s}'`, "npm", ["install", `@datapos/datapos-${s}@latest`]), s === "development") {
|
|
5512
|
-
const
|
|
5512
|
+
const h = await Q("config.json"), l = Ui(h.id);
|
|
5513
5513
|
await Ar(l);
|
|
5514
5514
|
}
|
|
5515
5515
|
}
|
|
@@ -5519,38 +5519,38 @@ async function $r(t = []) {
|
|
|
5519
5519
|
}
|
|
5520
5520
|
}
|
|
5521
5521
|
async function Ar(t) {
|
|
5522
|
-
const e =
|
|
5522
|
+
const e = qt.dirname(ri(import.meta.url));
|
|
5523
5523
|
await mt(e, "../", ".editorconfig"), await mt(e, "../", ".gitattributes"), await (t.isPublish ? mt(e, "../", ".gitignore_published", ".gitignore2") : mt(e, "../", ".gitignore_unpublished", ".gitignore2")), await mt(e, "../", ".markdownlint.json"), await mt(e, "../", "LICENSE"), await mt(e, "../", "tsconfig.json", "tsconfig2.json"), t.typeId === "eslint" || (await mt(e, "../", "eslint.config.ts", "eslint.config2.ts"), await mt(e, "../", "vite.config.ts", "vite.config2.ts"), await mt(e, "../", "vitest.config.ts", "vitest.config2.ts"));
|
|
5524
5524
|
}
|
|
5525
5525
|
async function mt(t, e, s, a) {
|
|
5526
|
-
const
|
|
5527
|
-
let
|
|
5526
|
+
const h = qt.resolve(t, `${e}${s}`), l = await Et(h), d = qt.resolve(process.cwd(), s), v = qt.resolve(process.cwd(), a ?? s);
|
|
5527
|
+
let g;
|
|
5528
5528
|
try {
|
|
5529
|
-
|
|
5530
|
-
} catch (
|
|
5531
|
-
if (
|
|
5529
|
+
g = await Et(d);
|
|
5530
|
+
} catch (o) {
|
|
5531
|
+
if (o.code !== "ENOENT") throw o;
|
|
5532
5532
|
}
|
|
5533
|
-
if (
|
|
5533
|
+
if (g === l) {
|
|
5534
5534
|
console.info(`ℹ️ File '${s}' is already up to date.`);
|
|
5535
5535
|
return;
|
|
5536
5536
|
}
|
|
5537
|
-
await
|
|
5537
|
+
await Wt(v, l), console.info(`ℹ️ File '${s}' synchronised.`);
|
|
5538
5538
|
}
|
|
5539
5539
|
async function Gr(t) {
|
|
5540
5540
|
try {
|
|
5541
5541
|
console.info(`🚀 Building public directory index for identifier '${t}'...`);
|
|
5542
5542
|
const e = {};
|
|
5543
|
-
async function s(
|
|
5544
|
-
console.info(`⚙️ Processing directory '${
|
|
5545
|
-
const d = [], v =
|
|
5543
|
+
async function s(h, l) {
|
|
5544
|
+
console.info(`⚙️ Processing directory '${h}'...`);
|
|
5545
|
+
const d = [], v = h.slice(`public/${t}`.length);
|
|
5546
5546
|
e[v === "" ? "/" : v] = d;
|
|
5547
5547
|
for (const g of l) {
|
|
5548
|
-
const
|
|
5548
|
+
const o = `${h}/${g}`;
|
|
5549
5549
|
try {
|
|
5550
|
-
const P = await at.stat(
|
|
5550
|
+
const P = await at.stat(o);
|
|
5551
5551
|
if (P.isDirectory()) {
|
|
5552
|
-
const N = await at.readdir(
|
|
5553
|
-
d.push(j), await s(
|
|
5552
|
+
const N = await at.readdir(o), j = { childCount: N.length, name: g, typeId: "folder" };
|
|
5553
|
+
d.push(j), await s(o, N);
|
|
5554
5554
|
} else {
|
|
5555
5555
|
const N = { id: Ji(), lastModifiedAt: P.mtimeMs, name: g, size: P.size, typeId: "object" };
|
|
5556
5556
|
d.push(N);
|
|
@@ -5559,9 +5559,9 @@ async function Gr(t) {
|
|
|
5559
5559
|
throw new Error(`Unable to get information for '${g}' in 'buildPublicDirectoryIndex'. ${String(P)}`);
|
|
5560
5560
|
}
|
|
5561
5561
|
}
|
|
5562
|
-
d.sort((g,
|
|
5563
|
-
const P = g.typeId.localeCompare(
|
|
5564
|
-
return P === 0 ? g.name.localeCompare(
|
|
5562
|
+
d.sort((g, o) => {
|
|
5563
|
+
const P = g.typeId.localeCompare(o.typeId);
|
|
5564
|
+
return P === 0 ? g.name.localeCompare(o.name) : P;
|
|
5565
5565
|
});
|
|
5566
5566
|
}
|
|
5567
5567
|
const a = await at.readdir(`public/${t}`);
|