@datapos/datapos-development 0.3.163 â 0.3.164
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/datapos-development.es.js +645 -657
- package/package.json +1 -1
|
@@ -34,9 +34,9 @@ var O = function(e, r) {
|
|
|
34
34
|
function ot(t, e) {
|
|
35
35
|
return new O(t, { beforeExpr: !0, binop: e });
|
|
36
36
|
}
|
|
37
|
-
var ht = { beforeExpr: !0 }, st = { startsExpr: !0 },
|
|
37
|
+
var ht = { beforeExpr: !0 }, st = { startsExpr: !0 }, kt = {};
|
|
38
38
|
function V(t, e) {
|
|
39
|
-
return e === void 0 && (e = {}), e.keyword = t,
|
|
39
|
+
return e === void 0 && (e = {}), e.keyword = t, kt[t] = new O(t, e);
|
|
40
40
|
}
|
|
41
41
|
var h = {
|
|
42
42
|
num: new O("num", st),
|
|
@@ -131,7 +131,7 @@ var h = {
|
|
|
131
131
|
_typeof: V("typeof", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
|
|
132
132
|
_void: V("void", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
|
|
133
133
|
_delete: V("delete", { beforeExpr: !0, prefix: !0, startsExpr: !0 })
|
|
134
|
-
},
|
|
134
|
+
}, Z = /\r\n?|\n|\u2028|\u2029/, qe = new RegExp(Z.source, "g");
|
|
135
135
|
function Tt(t) {
|
|
136
136
|
return t === 10 || t === 13 || t === 8232 || t === 8233;
|
|
137
137
|
}
|
|
@@ -144,7 +144,7 @@ function He(t, e, r) {
|
|
|
144
144
|
}
|
|
145
145
|
return -1;
|
|
146
146
|
}
|
|
147
|
-
var ye = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,
|
|
147
|
+
var ye = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, X = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, We = Object.prototype, Vi = We.hasOwnProperty, Fi = We.toString, wt = Object.hasOwn || (function(t, e) {
|
|
148
148
|
return Vi.call(t, e);
|
|
149
149
|
}), Ee = Array.isArray || (function(t) {
|
|
150
150
|
return Fi.call(t) === "[object Array]";
|
|
@@ -155,24 +155,24 @@ function bt(t) {
|
|
|
155
155
|
function mt(t) {
|
|
156
156
|
return t <= 65535 ? String.fromCharCode(t) : (t -= 65536, String.fromCharCode((t >> 10) + 55296, (t & 1023) + 56320));
|
|
157
157
|
}
|
|
158
|
-
var Bi = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,
|
|
158
|
+
var Bi = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, At = function(e, r) {
|
|
159
159
|
this.line = e, this.column = r;
|
|
160
160
|
};
|
|
161
|
-
|
|
162
|
-
return new
|
|
161
|
+
At.prototype.offset = function(e) {
|
|
162
|
+
return new At(this.line, this.column + e);
|
|
163
163
|
};
|
|
164
|
-
var
|
|
164
|
+
var Ft = function(e, r, a) {
|
|
165
165
|
this.start = r, this.end = a, e.sourceFile !== null && (this.source = e.sourceFile);
|
|
166
166
|
};
|
|
167
167
|
function xe(t, e) {
|
|
168
168
|
for (var r = 1, a = 0; ; ) {
|
|
169
169
|
var u = He(t, a, e);
|
|
170
170
|
if (u < 0)
|
|
171
|
-
return new
|
|
171
|
+
return new At(r, e - a);
|
|
172
172
|
++r, a = u;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
var
|
|
175
|
+
var zt = {
|
|
176
176
|
// `ecmaVersion` indicates the ECMAScript version to parse. Must be
|
|
177
177
|
// either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
|
|
178
178
|
// (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"`
|
|
@@ -271,8 +271,8 @@ var Jt = {
|
|
|
271
271
|
}, _e = !1;
|
|
272
272
|
function ji(t) {
|
|
273
273
|
var e = {};
|
|
274
|
-
for (var r in
|
|
275
|
-
e[r] = t &&
|
|
274
|
+
for (var r in zt)
|
|
275
|
+
e[r] = t && wt(t, r) ? t[r] : zt[r];
|
|
276
276
|
if (e.ecmaVersion === "latest" ? e.ecmaVersion = 1e8 : e.ecmaVersion == null ? (!_e && typeof console == "object" && console.warn && (_e = !0, console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
277
277
|
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), Ee(e.onToken)) {
|
|
278
278
|
var a = e.onToken;
|
|
@@ -283,37 +283,37 @@ Defaulting to 2020, but this will stop working in the future.`)), e.ecmaVersion
|
|
|
283
283
|
return Ee(e.onComment) && (e.onComment = Ui(e, e.onComment)), e;
|
|
284
284
|
}
|
|
285
285
|
function Ui(t, e) {
|
|
286
|
-
return function(r, a, u, f, d,
|
|
287
|
-
var
|
|
286
|
+
return function(r, a, u, f, d, g) {
|
|
287
|
+
var v = {
|
|
288
288
|
type: r ? "Block" : "Line",
|
|
289
289
|
value: a,
|
|
290
290
|
start: u,
|
|
291
291
|
end: f
|
|
292
292
|
};
|
|
293
|
-
t.locations && (
|
|
293
|
+
t.locations && (v.loc = new Ft(this, d, g)), t.ranges && (v.range = [u, f]), e.push(v);
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
|
-
var
|
|
296
|
+
var Vt = 1, Et = 2, ve = 4, Ke = 8, ge = 16, ze = 32, Yt = 64, Je = 128, Pt = 256, Bt = 512, Zt = Vt | Et | Pt;
|
|
297
297
|
function be(t, e) {
|
|
298
|
-
return
|
|
298
|
+
return Et | (t ? ve : 0) | (e ? Ke : 0);
|
|
299
299
|
}
|
|
300
|
-
var
|
|
300
|
+
var Jt = 0, Se = 1, xt = 2, Ge = 3, $e = 4, Xe = 5, K = function(e, r, a) {
|
|
301
301
|
this.options = e = ji(e), this.sourceFile = e.sourceFile, this.keywords = bt(Oi[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
|
|
302
302
|
var u = "";
|
|
303
303
|
e.allowReserved !== !0 && (u = oe[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (u += " await")), this.reservedWords = bt(u);
|
|
304
304
|
var f = (u ? u + " " : "") + oe.strict;
|
|
305
305
|
this.reservedWordsStrict = bt(f), this.reservedWordsStrictBind = bt(f + " " + oe.strictBind), this.input = String(r), this.containsEsc = !1, a ? (this.pos = a, this.lineStart = this.input.lastIndexOf(`
|
|
306
|
-
`, a - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(
|
|
306
|
+
`, a - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(Z).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = h.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(Vt), this.regexpState = null, this.privateNameStack = [];
|
|
307
307
|
}, lt = { 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 } };
|
|
308
308
|
K.prototype.parse = function() {
|
|
309
309
|
var e = this.options.program || this.startNode();
|
|
310
310
|
return this.nextToken(), this.parseTopLevel(e);
|
|
311
311
|
};
|
|
312
312
|
lt.inFunction.get = function() {
|
|
313
|
-
return (this.currentVarScope().flags &
|
|
313
|
+
return (this.currentVarScope().flags & Et) > 0;
|
|
314
314
|
};
|
|
315
315
|
lt.inGenerator.get = function() {
|
|
316
|
-
return (this.currentVarScope().flags &
|
|
316
|
+
return (this.currentVarScope().flags & Ke) > 0;
|
|
317
317
|
};
|
|
318
318
|
lt.inAsync.get = function() {
|
|
319
319
|
return (this.currentVarScope().flags & ve) > 0;
|
|
@@ -321,16 +321,16 @@ lt.inAsync.get = function() {
|
|
|
321
321
|
lt.canAwait.get = function() {
|
|
322
322
|
for (var t = this.scopeStack.length - 1; t >= 0; t--) {
|
|
323
323
|
var e = this.scopeStack[t], r = e.flags;
|
|
324
|
-
if (r & (Pt |
|
|
324
|
+
if (r & (Pt | Bt))
|
|
325
325
|
return !1;
|
|
326
|
-
if (r &
|
|
326
|
+
if (r & Et)
|
|
327
327
|
return (r & ve) > 0;
|
|
328
328
|
}
|
|
329
329
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
330
330
|
};
|
|
331
331
|
lt.allowSuper.get = function() {
|
|
332
332
|
var t = this.currentThisScope(), e = t.flags;
|
|
333
|
-
return (e &
|
|
333
|
+
return (e & Yt) > 0 || this.options.allowSuperOutsideMethod;
|
|
334
334
|
};
|
|
335
335
|
lt.allowDirectSuper.get = function() {
|
|
336
336
|
return (this.currentThisScope().flags & Je) > 0;
|
|
@@ -341,7 +341,7 @@ lt.treatFunctionsAsVar.get = function() {
|
|
|
341
341
|
lt.allowNewDotTarget.get = function() {
|
|
342
342
|
for (var t = this.scopeStack.length - 1; t >= 0; t--) {
|
|
343
343
|
var e = this.scopeStack[t], r = e.flags;
|
|
344
|
-
if (r & (Pt |
|
|
344
|
+
if (r & (Pt | Bt) || r & Et && !(r & ge))
|
|
345
345
|
return !0;
|
|
346
346
|
}
|
|
347
347
|
return !1;
|
|
@@ -366,66 +366,66 @@ K.tokenizer = function(e, r) {
|
|
|
366
366
|
return new this(r, e);
|
|
367
367
|
};
|
|
368
368
|
Object.defineProperties(K.prototype, lt);
|
|
369
|
-
var
|
|
370
|
-
|
|
369
|
+
var tt = K.prototype, qi = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
370
|
+
tt.strictDirective = function(t) {
|
|
371
371
|
if (this.options.ecmaVersion < 5)
|
|
372
372
|
return !1;
|
|
373
373
|
for (; ; ) {
|
|
374
|
-
|
|
374
|
+
X.lastIndex = t, t += X.exec(this.input)[0].length;
|
|
375
375
|
var e = qi.exec(this.input.slice(t));
|
|
376
376
|
if (!e)
|
|
377
377
|
return !1;
|
|
378
378
|
if ((e[1] || e[2]) === "use strict") {
|
|
379
|
-
|
|
380
|
-
var r =
|
|
381
|
-
return u === ";" || u === "}" ||
|
|
379
|
+
X.lastIndex = t + e[0].length;
|
|
380
|
+
var r = X.exec(this.input), a = r.index + r[0].length, u = this.input.charAt(a);
|
|
381
|
+
return u === ";" || u === "}" || Z.test(r[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(u) || u === "!" && this.input.charAt(a + 1) === "=");
|
|
382
382
|
}
|
|
383
|
-
t += e[0].length,
|
|
383
|
+
t += e[0].length, X.lastIndex = t, t += X.exec(this.input)[0].length, this.input[t] === ";" && t++;
|
|
384
384
|
}
|
|
385
385
|
};
|
|
386
|
-
|
|
386
|
+
tt.eat = function(t) {
|
|
387
387
|
return this.type === t ? (this.next(), !0) : !1;
|
|
388
388
|
};
|
|
389
|
-
|
|
389
|
+
tt.isContextual = function(t) {
|
|
390
390
|
return this.type === h.name && this.value === t && !this.containsEsc;
|
|
391
391
|
};
|
|
392
|
-
|
|
392
|
+
tt.eatContextual = function(t) {
|
|
393
393
|
return this.isContextual(t) ? (this.next(), !0) : !1;
|
|
394
394
|
};
|
|
395
|
-
|
|
395
|
+
tt.expectContextual = function(t) {
|
|
396
396
|
this.eatContextual(t) || this.unexpected();
|
|
397
397
|
};
|
|
398
|
-
|
|
399
|
-
return this.type === h.eof || this.type === h.braceR ||
|
|
398
|
+
tt.canInsertSemicolon = function() {
|
|
399
|
+
return this.type === h.eof || this.type === h.braceR || Z.test(this.input.slice(this.lastTokEnd, this.start));
|
|
400
400
|
};
|
|
401
|
-
|
|
401
|
+
tt.insertSemicolon = function() {
|
|
402
402
|
if (this.canInsertSemicolon())
|
|
403
403
|
return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
|
|
404
404
|
};
|
|
405
|
-
|
|
405
|
+
tt.semicolon = function() {
|
|
406
406
|
!this.eat(h.semi) && !this.insertSemicolon() && this.unexpected();
|
|
407
407
|
};
|
|
408
|
-
|
|
408
|
+
tt.afterTrailingComma = function(t, e) {
|
|
409
409
|
if (this.type === t)
|
|
410
410
|
return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), e || this.next(), !0;
|
|
411
411
|
};
|
|
412
|
-
|
|
412
|
+
tt.expect = function(t) {
|
|
413
413
|
this.eat(t) || this.unexpected();
|
|
414
414
|
};
|
|
415
|
-
|
|
415
|
+
tt.unexpected = function(t) {
|
|
416
416
|
this.raise(t ?? this.start, "Unexpected token");
|
|
417
417
|
};
|
|
418
|
-
var
|
|
418
|
+
var te = function() {
|
|
419
419
|
this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
420
420
|
};
|
|
421
|
-
|
|
421
|
+
tt.checkPatternErrors = function(t, e) {
|
|
422
422
|
if (t) {
|
|
423
423
|
t.trailingComma > -1 && this.raiseRecoverable(t.trailingComma, "Comma is not permitted after the rest element");
|
|
424
424
|
var r = e ? t.parenthesizedAssign : t.parenthesizedBind;
|
|
425
425
|
r > -1 && this.raiseRecoverable(r, e ? "Assigning to rvalue" : "Parenthesized pattern");
|
|
426
426
|
}
|
|
427
427
|
};
|
|
428
|
-
|
|
428
|
+
tt.checkExpressionErrors = function(t, e) {
|
|
429
429
|
if (!t)
|
|
430
430
|
return !1;
|
|
431
431
|
var r = t.shorthandAssign, a = t.doubleProto;
|
|
@@ -433,14 +433,14 @@ et.checkExpressionErrors = function(t, e) {
|
|
|
433
433
|
return r >= 0 || a >= 0;
|
|
434
434
|
r >= 0 && this.raise(r, "Shorthand property assignments are valid only in destructuring patterns"), a >= 0 && this.raiseRecoverable(a, "Redefinition of __proto__ property");
|
|
435
435
|
};
|
|
436
|
-
|
|
436
|
+
tt.checkYieldAwaitInDefaultParams = function() {
|
|
437
437
|
this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos) && this.raise(this.yieldPos, "Yield expression cannot be a default value"), this.awaitPos && this.raise(this.awaitPos, "Await expression cannot be a default value");
|
|
438
438
|
};
|
|
439
|
-
|
|
439
|
+
tt.isSimpleAssignTarget = function(t) {
|
|
440
440
|
return t.type === "ParenthesizedExpression" ? this.isSimpleAssignTarget(t.expression) : t.type === "Identifier" || t.type === "MemberExpression";
|
|
441
441
|
};
|
|
442
|
-
var
|
|
443
|
-
|
|
442
|
+
var A = K.prototype;
|
|
443
|
+
A.parseTopLevel = function(t) {
|
|
444
444
|
var e = /* @__PURE__ */ Object.create(null);
|
|
445
445
|
for (t.body || (t.body = []); this.type !== h.eof; ) {
|
|
446
446
|
var r = this.parseStatement(null, !0, e);
|
|
@@ -454,11 +454,11 @@ k.parseTopLevel = function(t) {
|
|
|
454
454
|
return this.adaptDirectivePrologue(t.body), this.next(), t.sourceType = this.options.sourceType, this.finishNode(t, "Program");
|
|
455
455
|
};
|
|
456
456
|
var Te = { kind: "loop" }, Hi = { kind: "switch" };
|
|
457
|
-
|
|
457
|
+
A.isLet = function(t) {
|
|
458
458
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let"))
|
|
459
459
|
return !1;
|
|
460
|
-
|
|
461
|
-
var e =
|
|
460
|
+
X.lastIndex = this.pos;
|
|
461
|
+
var e = X.exec(this.input), r = this.pos + e[0].length, a = this.input.charCodeAt(r);
|
|
462
462
|
if (a === 91 || a === 92)
|
|
463
463
|
return !0;
|
|
464
464
|
if (t)
|
|
@@ -476,44 +476,44 @@ k.isLet = function(t) {
|
|
|
476
476
|
}
|
|
477
477
|
return !1;
|
|
478
478
|
};
|
|
479
|
-
|
|
479
|
+
A.isAsyncFunction = function() {
|
|
480
480
|
if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
|
|
481
481
|
return !1;
|
|
482
|
-
|
|
483
|
-
var t =
|
|
484
|
-
return !
|
|
482
|
+
X.lastIndex = this.pos;
|
|
483
|
+
var t = X.exec(this.input), e = this.pos + t[0].length, r;
|
|
484
|
+
return !Z.test(this.input.slice(this.pos, e)) && this.input.slice(e, e + 8) === "function" && (e + 8 === this.input.length || !(dt(r = this.input.charCodeAt(e + 8)) || r > 55295 && r < 56320));
|
|
485
485
|
};
|
|
486
|
-
|
|
486
|
+
A.isUsingKeyword = function(t, e) {
|
|
487
487
|
if (this.options.ecmaVersion < 17 || !this.isContextual(t ? "await" : "using"))
|
|
488
488
|
return !1;
|
|
489
|
-
|
|
490
|
-
var r =
|
|
491
|
-
if (
|
|
489
|
+
X.lastIndex = this.pos;
|
|
490
|
+
var r = X.exec(this.input), a = this.pos + r[0].length;
|
|
491
|
+
if (Z.test(this.input.slice(this.pos, a)))
|
|
492
492
|
return !1;
|
|
493
493
|
if (t) {
|
|
494
494
|
var u = a + 5, f;
|
|
495
495
|
if (this.input.slice(a, u) !== "using" || u === this.input.length || dt(f = this.input.charCodeAt(u)) || f > 55295 && f < 56320)
|
|
496
496
|
return !1;
|
|
497
|
-
|
|
498
|
-
var d =
|
|
499
|
-
if (d &&
|
|
497
|
+
X.lastIndex = u;
|
|
498
|
+
var d = X.exec(this.input);
|
|
499
|
+
if (d && Z.test(this.input.slice(u, u + d[0].length)))
|
|
500
500
|
return !1;
|
|
501
501
|
}
|
|
502
502
|
if (e) {
|
|
503
|
-
var
|
|
504
|
-
if (this.input.slice(a,
|
|
503
|
+
var g = a + 2, v;
|
|
504
|
+
if (this.input.slice(a, g) === "of" && (g === this.input.length || !dt(v = this.input.charCodeAt(g)) && !(v > 55295 && v < 56320)))
|
|
505
505
|
return !1;
|
|
506
506
|
}
|
|
507
507
|
var o = this.input.charCodeAt(a);
|
|
508
508
|
return pt(o, !0) || o === 92;
|
|
509
509
|
};
|
|
510
|
-
|
|
510
|
+
A.isAwaitUsing = function(t) {
|
|
511
511
|
return this.isUsingKeyword(!0, t);
|
|
512
512
|
};
|
|
513
|
-
|
|
513
|
+
A.isUsing = function(t) {
|
|
514
514
|
return this.isUsingKeyword(!1, t);
|
|
515
515
|
};
|
|
516
|
-
|
|
516
|
+
A.parseStatement = function(t, e, r) {
|
|
517
517
|
var a = this.type, u = this.startNode(), f;
|
|
518
518
|
switch (this.isLet(t) && (a = h._var, f = "let"), a) {
|
|
519
519
|
case h._break:
|
|
@@ -553,9 +553,9 @@ k.parseStatement = function(t, e, r) {
|
|
|
553
553
|
case h._export:
|
|
554
554
|
case h._import:
|
|
555
555
|
if (this.options.ecmaVersion > 10 && a === h._import) {
|
|
556
|
-
|
|
557
|
-
var d =
|
|
558
|
-
if (
|
|
556
|
+
X.lastIndex = this.pos;
|
|
557
|
+
var d = X.exec(this.input), g = this.pos + d[0].length, v = this.input.charCodeAt(g);
|
|
558
|
+
if (v === 40 || v === 46)
|
|
559
559
|
return this.parseExpressionStatement(u, this.parseExpression());
|
|
560
560
|
}
|
|
561
561
|
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 === h._import ? this.parseImport(u) : this.parseExport(u, r);
|
|
@@ -570,11 +570,11 @@ k.parseStatement = function(t, e, r) {
|
|
|
570
570
|
var o = this.isAwaitUsing(!1) ? "await using" : this.isUsing(!1) ? "using" : null;
|
|
571
571
|
if (o)
|
|
572
572
|
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(u, !1, o), this.semicolon(), this.finishNode(u, "VariableDeclaration");
|
|
573
|
-
var
|
|
574
|
-
return a === h.name &&
|
|
573
|
+
var C = this.value, _ = this.parseExpression();
|
|
574
|
+
return a === h.name && _.type === "Identifier" && this.eat(h.colon) ? this.parseLabeledStatement(u, C, _, t) : this.parseExpressionStatement(u, _);
|
|
575
575
|
}
|
|
576
576
|
};
|
|
577
|
-
|
|
577
|
+
A.parseBreakContinueStatement = function(t, e) {
|
|
578
578
|
var r = e === "break";
|
|
579
579
|
this.next(), this.eat(h.semi) || this.insertSemicolon() ? t.label = null : this.type !== h.name ? this.unexpected() : (t.label = this.parseIdent(), this.semicolon());
|
|
580
580
|
for (var a = 0; a < this.labels.length; ++a) {
|
|
@@ -584,13 +584,13 @@ k.parseBreakContinueStatement = function(t, e) {
|
|
|
584
584
|
}
|
|
585
585
|
return a === this.labels.length && this.raise(t.start, "Unsyntactic " + e), this.finishNode(t, r ? "BreakStatement" : "ContinueStatement");
|
|
586
586
|
};
|
|
587
|
-
|
|
587
|
+
A.parseDebuggerStatement = function(t) {
|
|
588
588
|
return this.next(), this.semicolon(), this.finishNode(t, "DebuggerStatement");
|
|
589
589
|
};
|
|
590
|
-
|
|
590
|
+
A.parseDoStatement = function(t) {
|
|
591
591
|
return this.next(), this.labels.push(Te), t.body = this.parseStatement("do"), this.labels.pop(), this.expect(h._while), t.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(h.semi) : this.semicolon(), this.finishNode(t, "DoWhileStatement");
|
|
592
592
|
};
|
|
593
|
-
|
|
593
|
+
A.parseForStatement = function(t) {
|
|
594
594
|
this.next();
|
|
595
595
|
var e = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
|
|
596
596
|
if (this.labels.push(Te), this.enterScope(0), this.expect(h.parenL), this.type === h.semi)
|
|
@@ -600,27 +600,27 @@ k.parseForStatement = function(t) {
|
|
|
600
600
|
var a = this.startNode(), u = r ? "let" : this.value;
|
|
601
601
|
return this.next(), this.parseVar(a, !0, u), this.finishNode(a, "VariableDeclaration"), this.parseForAfterInit(t, a, e);
|
|
602
602
|
}
|
|
603
|
-
var f = this.isContextual("let"), d = !1,
|
|
604
|
-
if (
|
|
605
|
-
var
|
|
606
|
-
return this.next(),
|
|
603
|
+
var f = this.isContextual("let"), d = !1, g = this.isUsing(!0) ? "using" : this.isAwaitUsing(!0) ? "await using" : null;
|
|
604
|
+
if (g) {
|
|
605
|
+
var v = this.startNode();
|
|
606
|
+
return this.next(), g === "await using" && this.next(), this.parseVar(v, !0, g), this.finishNode(v, "VariableDeclaration"), this.parseForAfterInit(t, v, e);
|
|
607
607
|
}
|
|
608
|
-
var o = this.containsEsc,
|
|
609
|
-
return this.type === h._in || (d = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (e > -1 ? (this.type === h._in && this.unexpected(e), t.await = !0) : d && this.options.ecmaVersion >= 8 && (M.start ===
|
|
608
|
+
var o = this.containsEsc, C = new te(), _ = this.start, M = e > -1 ? this.parseExprSubscripts(C, "await") : this.parseExpression(!0, C);
|
|
609
|
+
return this.type === h._in || (d = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (e > -1 ? (this.type === h._in && this.unexpected(e), t.await = !0) : d && this.options.ecmaVersion >= 8 && (M.start === _ && !o && M.type === "Identifier" && M.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (t.await = !1)), f && d && this.raise(M.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(M, !1, C), this.checkLValPattern(M), this.parseForIn(t, M)) : (this.checkExpressionErrors(C, !0), e > -1 && this.unexpected(e), this.parseFor(t, M));
|
|
610
610
|
};
|
|
611
|
-
|
|
611
|
+
A.parseForAfterInit = function(t, e, r) {
|
|
612
612
|
return (this.type === h._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && e.declarations.length === 1 ? (this.options.ecmaVersion >= 9 && (this.type === h._in ? r > -1 && this.unexpected(r) : t.await = r > -1), this.parseForIn(t, e)) : (r > -1 && this.unexpected(r), this.parseFor(t, e));
|
|
613
613
|
};
|
|
614
|
-
|
|
615
|
-
return this.next(), this.parseFunction(t,
|
|
614
|
+
A.parseFunctionStatement = function(t, e, r) {
|
|
615
|
+
return this.next(), this.parseFunction(t, Rt | (r ? 0 : fe), !1, e);
|
|
616
616
|
};
|
|
617
|
-
|
|
617
|
+
A.parseIfStatement = function(t) {
|
|
618
618
|
return this.next(), t.test = this.parseParenExpression(), t.consequent = this.parseStatement("if"), t.alternate = this.eat(h._else) ? this.parseStatement("if") : null, this.finishNode(t, "IfStatement");
|
|
619
619
|
};
|
|
620
|
-
|
|
620
|
+
A.parseReturnStatement = function(t) {
|
|
621
621
|
return !this.inFunction && !this.options.allowReturnOutsideFunction && this.raise(this.start, "'return' outside of function"), this.next(), this.eat(h.semi) || this.insertSemicolon() ? t.argument = null : (t.argument = this.parseExpression(), this.semicolon()), this.finishNode(t, "ReturnStatement");
|
|
622
622
|
};
|
|
623
|
-
|
|
623
|
+
A.parseSwitchStatement = function(t) {
|
|
624
624
|
this.next(), t.discriminant = this.parseParenExpression(), t.cases = [], this.expect(h.braceL), this.labels.push(Hi), this.enterScope(0);
|
|
625
625
|
for (var e, r = !1; this.type !== h.braceR; )
|
|
626
626
|
if (this.type === h._case || this.type === h._default) {
|
|
@@ -630,68 +630,68 @@ k.parseSwitchStatement = function(t) {
|
|
|
630
630
|
e || this.unexpected(), e.consequent.push(this.parseStatement(null));
|
|
631
631
|
return this.exitScope(), e && this.finishNode(e, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(t, "SwitchStatement");
|
|
632
632
|
};
|
|
633
|
-
|
|
634
|
-
return this.next(),
|
|
633
|
+
A.parseThrowStatement = function(t) {
|
|
634
|
+
return this.next(), Z.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), t.argument = this.parseExpression(), this.semicolon(), this.finishNode(t, "ThrowStatement");
|
|
635
635
|
};
|
|
636
|
-
var
|
|
637
|
-
|
|
636
|
+
var Wi = [];
|
|
637
|
+
A.parseCatchClauseParam = function() {
|
|
638
638
|
var t = this.parseBindingAtom(), e = t.type === "Identifier";
|
|
639
|
-
return this.enterScope(e ?
|
|
639
|
+
return this.enterScope(e ? ze : 0), this.checkLValPattern(t, e ? $e : xt), this.expect(h.parenR), t;
|
|
640
640
|
};
|
|
641
|
-
|
|
641
|
+
A.parseTryStatement = function(t) {
|
|
642
642
|
if (this.next(), t.block = this.parseBlock(), t.handler = null, this.type === h._catch) {
|
|
643
643
|
var e = this.startNode();
|
|
644
644
|
this.next(), this.eat(h.parenL) ? e.param = this.parseCatchClauseParam() : (this.options.ecmaVersion < 10 && this.unexpected(), e.param = null, this.enterScope(0)), e.body = this.parseBlock(!1), this.exitScope(), t.handler = this.finishNode(e, "CatchClause");
|
|
645
645
|
}
|
|
646
646
|
return t.finalizer = this.eat(h._finally) ? this.parseBlock() : null, !t.handler && !t.finalizer && this.raise(t.start, "Missing catch or finally clause"), this.finishNode(t, "TryStatement");
|
|
647
647
|
};
|
|
648
|
-
|
|
648
|
+
A.parseVarStatement = function(t, e, r) {
|
|
649
649
|
return this.next(), this.parseVar(t, !1, e, r), this.semicolon(), this.finishNode(t, "VariableDeclaration");
|
|
650
650
|
};
|
|
651
|
-
|
|
651
|
+
A.parseWhileStatement = function(t) {
|
|
652
652
|
return this.next(), t.test = this.parseParenExpression(), this.labels.push(Te), t.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(t, "WhileStatement");
|
|
653
653
|
};
|
|
654
|
-
|
|
654
|
+
A.parseWithStatement = function(t) {
|
|
655
655
|
return this.strict && this.raise(this.start, "'with' in strict mode"), this.next(), t.object = this.parseParenExpression(), t.body = this.parseStatement("with"), this.finishNode(t, "WithStatement");
|
|
656
656
|
};
|
|
657
|
-
|
|
657
|
+
A.parseEmptyStatement = function(t) {
|
|
658
658
|
return this.next(), this.finishNode(t, "EmptyStatement");
|
|
659
659
|
};
|
|
660
|
-
|
|
660
|
+
A.parseLabeledStatement = function(t, e, r, a) {
|
|
661
661
|
for (var u = 0, f = this.labels; u < f.length; u += 1) {
|
|
662
662
|
var d = f[u];
|
|
663
663
|
d.name === e && this.raise(r.start, "Label '" + e + "' is already declared");
|
|
664
664
|
}
|
|
665
|
-
for (var
|
|
666
|
-
var o = this.labels[
|
|
665
|
+
for (var g = this.type.isLoop ? "loop" : this.type === h._switch ? "switch" : null, v = this.labels.length - 1; v >= 0; v--) {
|
|
666
|
+
var o = this.labels[v];
|
|
667
667
|
if (o.statementStart === t.start)
|
|
668
|
-
o.statementStart = this.start, o.kind =
|
|
668
|
+
o.statementStart = this.start, o.kind = g;
|
|
669
669
|
else
|
|
670
670
|
break;
|
|
671
671
|
}
|
|
672
|
-
return this.labels.push({ name: e, kind:
|
|
672
|
+
return this.labels.push({ name: e, kind: g, statementStart: this.start }), t.body = this.parseStatement(a ? a.indexOf("label") === -1 ? a + "label" : a : "label"), this.labels.pop(), t.label = r, this.finishNode(t, "LabeledStatement");
|
|
673
673
|
};
|
|
674
|
-
|
|
674
|
+
A.parseExpressionStatement = function(t, e) {
|
|
675
675
|
return t.expression = e, this.semicolon(), this.finishNode(t, "ExpressionStatement");
|
|
676
676
|
};
|
|
677
|
-
|
|
677
|
+
A.parseBlock = function(t, e, r) {
|
|
678
678
|
for (t === void 0 && (t = !0), e === void 0 && (e = this.startNode()), e.body = [], this.expect(h.braceL), t && this.enterScope(0); this.type !== h.braceR; ) {
|
|
679
679
|
var a = this.parseStatement(null);
|
|
680
680
|
e.body.push(a);
|
|
681
681
|
}
|
|
682
682
|
return r && (this.strict = !1), this.next(), t && this.exitScope(), this.finishNode(e, "BlockStatement");
|
|
683
683
|
};
|
|
684
|
-
|
|
684
|
+
A.parseFor = function(t, e) {
|
|
685
685
|
return t.init = e, this.expect(h.semi), t.test = this.type === h.semi ? null : this.parseExpression(), this.expect(h.semi), t.update = this.type === h.parenR ? null : this.parseExpression(), this.expect(h.parenR), t.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(t, "ForStatement");
|
|
686
686
|
};
|
|
687
|
-
|
|
687
|
+
A.parseForIn = function(t, e) {
|
|
688
688
|
var r = this.type === h._in;
|
|
689
689
|
return this.next(), e.type === "VariableDeclaration" && e.declarations[0].init != null && (!r || this.options.ecmaVersion < 8 || this.strict || e.kind !== "var" || e.declarations[0].id.type !== "Identifier") && this.raise(
|
|
690
690
|
e.start,
|
|
691
691
|
(r ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"
|
|
692
692
|
), t.left = e, t.right = r ? this.parseExpression() : this.parseMaybeAssign(), this.expect(h.parenR), t.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(t, r ? "ForInStatement" : "ForOfStatement");
|
|
693
693
|
};
|
|
694
|
-
|
|
694
|
+
A.parseVar = function(t, e, r, a) {
|
|
695
695
|
for (t.declarations = [], t.kind = r; ; ) {
|
|
696
696
|
var u = this.startNode();
|
|
697
697
|
if (this.parseVarId(u, r), this.eat(h.eq) ? u.init = this.parseMaybeAssign(e) : !a && r === "const" && !(this.type === h._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !a && (r === "using" || r === "await using") && this.options.ecmaVersion >= 17 && this.type !== h._in && !this.isContextual("of") ? this.raise(this.lastTokEnd, "Missing initializer in " + r + " declaration") : !a && u.id.type !== "Identifier" && !(e && (this.type === h._in || this.isContextual("of"))) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : u.init = null, t.declarations.push(this.finishNode(u, "VariableDeclarator")), !this.eat(h.comma))
|
|
@@ -699,103 +699,103 @@ k.parseVar = function(t, e, r, a) {
|
|
|
699
699
|
}
|
|
700
700
|
return t;
|
|
701
701
|
};
|
|
702
|
-
|
|
702
|
+
A.parseVarId = function(t, e) {
|
|
703
703
|
t.id = e === "using" || e === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(t.id, e === "var" ? Se : xt, !1);
|
|
704
704
|
};
|
|
705
|
-
var
|
|
706
|
-
|
|
707
|
-
this.initFunction(t), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !a) && (this.type === h.star && e & fe && this.unexpected(), t.generator = this.eat(h.star)), this.options.ecmaVersion >= 8 && (t.async = !!a), e &
|
|
708
|
-
var f = this.yieldPos, d = this.awaitPos,
|
|
709
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(be(t.async, t.generator)), e &
|
|
705
|
+
var Rt = 1, fe = 2, Qe = 4;
|
|
706
|
+
A.parseFunction = function(t, e, r, a, u) {
|
|
707
|
+
this.initFunction(t), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !a) && (this.type === h.star && e & fe && this.unexpected(), t.generator = this.eat(h.star)), this.options.ecmaVersion >= 8 && (t.async = !!a), e & Rt && (t.id = e & Qe && this.type !== h.name ? null : this.parseIdent(), t.id && !(e & fe) && this.checkLValSimple(t.id, this.strict || t.generator || t.async ? this.treatFunctionsAsVar ? Se : xt : Ge));
|
|
708
|
+
var f = this.yieldPos, d = this.awaitPos, g = this.awaitIdentPos;
|
|
709
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(be(t.async, t.generator)), e & Rt || (t.id = this.type === h.name ? this.parseIdent() : null), this.parseFunctionParams(t), this.parseFunctionBody(t, r, !1, u), this.yieldPos = f, this.awaitPos = d, this.awaitIdentPos = g, this.finishNode(t, e & Rt ? "FunctionDeclaration" : "FunctionExpression");
|
|
710
710
|
};
|
|
711
|
-
|
|
711
|
+
A.parseFunctionParams = function(t) {
|
|
712
712
|
this.expect(h.parenL), t.params = this.parseBindingList(h.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
713
713
|
};
|
|
714
|
-
|
|
714
|
+
A.parseClass = function(t, e) {
|
|
715
715
|
this.next();
|
|
716
716
|
var r = this.strict;
|
|
717
717
|
this.strict = !0, this.parseClassId(t, e), this.parseClassSuper(t);
|
|
718
718
|
var a = this.enterClassBody(), u = this.startNode(), f = !1;
|
|
719
719
|
for (u.body = [], this.expect(h.braceL); this.type !== h.braceR; ) {
|
|
720
720
|
var d = this.parseClassElement(t.superClass !== null);
|
|
721
|
-
d && (u.body.push(d), d.type === "MethodDefinition" && d.kind === "constructor" ? (f && this.raiseRecoverable(d.start, "Duplicate constructor in the same class"), f = !0) : d.key && d.key.type === "PrivateIdentifier" &&
|
|
721
|
+
d && (u.body.push(d), d.type === "MethodDefinition" && d.kind === "constructor" ? (f && this.raiseRecoverable(d.start, "Duplicate constructor in the same class"), f = !0) : d.key && d.key.type === "PrivateIdentifier" && Ki(a, d) && this.raiseRecoverable(d.key.start, "Identifier '#" + d.key.name + "' has already been declared"));
|
|
722
722
|
}
|
|
723
723
|
return this.strict = r, this.next(), t.body = this.finishNode(u, "ClassBody"), this.exitClassBody(), this.finishNode(t, e ? "ClassDeclaration" : "ClassExpression");
|
|
724
724
|
};
|
|
725
|
-
|
|
725
|
+
A.parseClassElement = function(t) {
|
|
726
726
|
if (this.eat(h.semi))
|
|
727
727
|
return null;
|
|
728
|
-
var e = this.options.ecmaVersion, r = this.startNode(), a = "", u = !1, f = !1, d = "method",
|
|
728
|
+
var e = this.options.ecmaVersion, r = this.startNode(), a = "", u = !1, f = !1, d = "method", g = !1;
|
|
729
729
|
if (this.eatContextual("static")) {
|
|
730
730
|
if (e >= 13 && this.eat(h.braceL))
|
|
731
731
|
return this.parseClassStaticBlock(r), r;
|
|
732
|
-
this.isClassElementNameStart() || this.type === h.star ?
|
|
732
|
+
this.isClassElementNameStart() || this.type === h.star ? g = !0 : a = "static";
|
|
733
733
|
}
|
|
734
|
-
if (r.static =
|
|
735
|
-
var
|
|
736
|
-
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? d =
|
|
734
|
+
if (r.static = g, !a && e >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === h.star) && !this.canInsertSemicolon() ? f = !0 : a = "async"), !a && (e >= 9 || !f) && this.eat(h.star) && (u = !0), !a && !f && !u) {
|
|
735
|
+
var v = this.value;
|
|
736
|
+
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? d = v : a = v);
|
|
737
737
|
}
|
|
738
738
|
if (a ? (r.computed = !1, r.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), r.key.name = a, this.finishNode(r.key, "Identifier")) : this.parseClassElementName(r), e < 13 || this.type === h.parenL || d !== "method" || u || f) {
|
|
739
|
-
var o = !r.static &&
|
|
740
|
-
o && d !== "method" && this.raise(r.key.start, "Constructor can't have get/set modifier"), r.kind = o ? "constructor" : d, this.parseClassMethod(r, u, f,
|
|
739
|
+
var o = !r.static && Gt(r, "constructor"), C = o && t;
|
|
740
|
+
o && d !== "method" && this.raise(r.key.start, "Constructor can't have get/set modifier"), r.kind = o ? "constructor" : d, this.parseClassMethod(r, u, f, C);
|
|
741
741
|
} else
|
|
742
742
|
this.parseClassField(r);
|
|
743
743
|
return r;
|
|
744
744
|
};
|
|
745
|
-
|
|
745
|
+
A.isClassElementNameStart = function() {
|
|
746
746
|
return this.type === h.name || this.type === h.privateId || this.type === h.num || this.type === h.string || this.type === h.bracketL || this.type.keyword;
|
|
747
747
|
};
|
|
748
|
-
|
|
748
|
+
A.parseClassElementName = function(t) {
|
|
749
749
|
this.type === h.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);
|
|
750
750
|
};
|
|
751
|
-
|
|
751
|
+
A.parseClassMethod = function(t, e, r, a) {
|
|
752
752
|
var u = t.key;
|
|
753
|
-
t.kind === "constructor" ? (e && this.raise(u.start, "Constructor can't be a generator"), r && this.raise(u.start, "Constructor can't be an async method")) : t.static &&
|
|
753
|
+
t.kind === "constructor" ? (e && this.raise(u.start, "Constructor can't be a generator"), r && this.raise(u.start, "Constructor can't be an async method")) : t.static && Gt(t, "prototype") && this.raise(u.start, "Classes may not have a static property named prototype");
|
|
754
754
|
var f = t.value = this.parseMethod(e, r, a);
|
|
755
755
|
return t.kind === "get" && f.params.length !== 0 && this.raiseRecoverable(f.start, "getter should have no params"), t.kind === "set" && f.params.length !== 1 && this.raiseRecoverable(f.start, "setter should have exactly one param"), t.kind === "set" && f.params[0].type === "RestElement" && this.raiseRecoverable(f.params[0].start, "Setter cannot use rest params"), this.finishNode(t, "MethodDefinition");
|
|
756
756
|
};
|
|
757
|
-
|
|
758
|
-
return
|
|
757
|
+
A.parseClassField = function(t) {
|
|
758
|
+
return Gt(t, "constructor") ? this.raise(t.key.start, "Classes can't have a field named 'constructor'") : t.static && Gt(t, "prototype") && this.raise(t.key.start, "Classes can't have a static field named 'prototype'"), this.eat(h.eq) ? (this.enterScope(Bt | Yt), t.value = this.parseMaybeAssign(), this.exitScope()) : t.value = null, this.semicolon(), this.finishNode(t, "PropertyDefinition");
|
|
759
759
|
};
|
|
760
|
-
|
|
760
|
+
A.parseClassStaticBlock = function(t) {
|
|
761
761
|
t.body = [];
|
|
762
762
|
var e = this.labels;
|
|
763
|
-
for (this.labels = [], this.enterScope(Pt |
|
|
763
|
+
for (this.labels = [], this.enterScope(Pt | Yt); this.type !== h.braceR; ) {
|
|
764
764
|
var r = this.parseStatement(null);
|
|
765
765
|
t.body.push(r);
|
|
766
766
|
}
|
|
767
767
|
return this.next(), this.exitScope(), this.labels = e, this.finishNode(t, "StaticBlock");
|
|
768
768
|
};
|
|
769
|
-
|
|
769
|
+
A.parseClassId = function(t, e) {
|
|
770
770
|
this.type === h.name ? (t.id = this.parseIdent(), e && this.checkLValSimple(t.id, xt, !1)) : (e === !0 && this.unexpected(), t.id = null);
|
|
771
771
|
};
|
|
772
|
-
|
|
772
|
+
A.parseClassSuper = function(t) {
|
|
773
773
|
t.superClass = this.eat(h._extends) ? this.parseExprSubscripts(null, !1) : null;
|
|
774
774
|
};
|
|
775
|
-
|
|
775
|
+
A.enterClassBody = function() {
|
|
776
776
|
var t = { declared: /* @__PURE__ */ Object.create(null), used: [] };
|
|
777
777
|
return this.privateNameStack.push(t), t.declared;
|
|
778
778
|
};
|
|
779
|
-
|
|
779
|
+
A.exitClassBody = function() {
|
|
780
780
|
var t = this.privateNameStack.pop(), e = t.declared, r = t.used;
|
|
781
781
|
if (this.options.checkPrivateFields)
|
|
782
782
|
for (var a = this.privateNameStack.length, u = a === 0 ? null : this.privateNameStack[a - 1], f = 0; f < r.length; ++f) {
|
|
783
783
|
var d = r[f];
|
|
784
|
-
|
|
784
|
+
wt(e, d.name) || (u ? u.used.push(d) : this.raiseRecoverable(d.start, "Private field '#" + d.name + "' must be declared in an enclosing class"));
|
|
785
785
|
}
|
|
786
786
|
};
|
|
787
|
-
function
|
|
787
|
+
function Ki(t, e) {
|
|
788
788
|
var r = e.key.name, a = t[r], u = "true";
|
|
789
789
|
return e.type === "MethodDefinition" && (e.kind === "get" || e.kind === "set") && (u = (e.static ? "s" : "i") + e.kind), a === "iget" && u === "iset" || a === "iset" && u === "iget" || a === "sget" && u === "sset" || a === "sset" && u === "sget" ? (t[r] = "true", !1) : a ? !0 : (t[r] = u, !1);
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function Gt(t, e) {
|
|
792
792
|
var r = t.computed, a = t.key;
|
|
793
793
|
return !r && (a.type === "Identifier" && a.name === e || a.type === "Literal" && a.value === e);
|
|
794
794
|
}
|
|
795
|
-
|
|
795
|
+
A.parseExportAllDeclaration = function(t, e) {
|
|
796
796
|
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (t.exported = this.parseModuleExportName(), this.checkExport(e, t.exported, this.lastTokStart)) : t.exported = null), this.expectContextual("from"), this.type !== h.string && this.unexpected(), t.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (t.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(t, "ExportAllDeclaration");
|
|
797
797
|
};
|
|
798
|
-
|
|
798
|
+
A.parseExport = function(t, e) {
|
|
799
799
|
if (this.next(), this.eat(h.star))
|
|
800
800
|
return this.parseExportAllDeclaration(t, e);
|
|
801
801
|
if (this.eat(h._default))
|
|
@@ -816,14 +816,14 @@ k.parseExport = function(t, e) {
|
|
|
816
816
|
}
|
|
817
817
|
return this.finishNode(t, "ExportNamedDeclaration");
|
|
818
818
|
};
|
|
819
|
-
|
|
819
|
+
A.parseExportDeclaration = function(t) {
|
|
820
820
|
return this.parseStatement(null);
|
|
821
821
|
};
|
|
822
|
-
|
|
822
|
+
A.parseExportDefaultDeclaration = function() {
|
|
823
823
|
var t;
|
|
824
824
|
if (this.type === h._function || (t = this.isAsyncFunction())) {
|
|
825
825
|
var e = this.startNode();
|
|
826
|
-
return this.next(), t && this.next(), this.parseFunction(e,
|
|
826
|
+
return this.next(), t && this.next(), this.parseFunction(e, Rt | Qe, !1, t);
|
|
827
827
|
} else if (this.type === h._class) {
|
|
828
828
|
var r = this.startNode();
|
|
829
829
|
return this.parseClass(r, "nullableID");
|
|
@@ -832,10 +832,10 @@ k.parseExportDefaultDeclaration = function() {
|
|
|
832
832
|
return this.semicolon(), a;
|
|
833
833
|
}
|
|
834
834
|
};
|
|
835
|
-
|
|
836
|
-
t && (typeof e != "string" && (e = e.type === "Identifier" ? e.name : e.value),
|
|
835
|
+
A.checkExport = function(t, e, r) {
|
|
836
|
+
t && (typeof e != "string" && (e = e.type === "Identifier" ? e.name : e.value), wt(t, e) && this.raiseRecoverable(r, "Duplicate export '" + e + "'"), t[e] = !0);
|
|
837
837
|
};
|
|
838
|
-
|
|
838
|
+
A.checkPatternExport = function(t, e) {
|
|
839
839
|
var r = e.type;
|
|
840
840
|
if (r === "Identifier")
|
|
841
841
|
this.checkExport(t, e, e.start);
|
|
@@ -845,23 +845,23 @@ k.checkPatternExport = function(t, e) {
|
|
|
845
845
|
this.checkPatternExport(t, f);
|
|
846
846
|
}
|
|
847
847
|
else if (r === "ArrayPattern")
|
|
848
|
-
for (var d = 0,
|
|
849
|
-
var
|
|
850
|
-
|
|
848
|
+
for (var d = 0, g = e.elements; d < g.length; d += 1) {
|
|
849
|
+
var v = g[d];
|
|
850
|
+
v && this.checkPatternExport(t, v);
|
|
851
851
|
}
|
|
852
852
|
else r === "Property" ? this.checkPatternExport(t, e.value) : r === "AssignmentPattern" ? this.checkPatternExport(t, e.left) : r === "RestElement" && this.checkPatternExport(t, e.argument);
|
|
853
853
|
};
|
|
854
|
-
|
|
854
|
+
A.checkVariableExport = function(t, e) {
|
|
855
855
|
if (t)
|
|
856
856
|
for (var r = 0, a = e; r < a.length; r += 1) {
|
|
857
857
|
var u = a[r];
|
|
858
858
|
this.checkPatternExport(t, u.id);
|
|
859
859
|
}
|
|
860
860
|
};
|
|
861
|
-
|
|
861
|
+
A.shouldParseExportStatement = function() {
|
|
862
862
|
return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
|
|
863
863
|
};
|
|
864
|
-
|
|
864
|
+
A.parseExportSpecifier = function(t) {
|
|
865
865
|
var e = this.startNode();
|
|
866
866
|
return e.local = this.parseModuleExportName(), e.exported = this.eatContextual("as") ? this.parseModuleExportName() : e.local, this.checkExport(
|
|
867
867
|
t,
|
|
@@ -869,7 +869,7 @@ k.parseExportSpecifier = function(t) {
|
|
|
869
869
|
e.exported.start
|
|
870
870
|
), this.finishNode(e, "ExportSpecifier");
|
|
871
871
|
};
|
|
872
|
-
|
|
872
|
+
A.parseExportSpecifiers = function(t) {
|
|
873
873
|
var e = [], r = !0;
|
|
874
874
|
for (this.expect(h.braceL); !this.eat(h.braceR); ) {
|
|
875
875
|
if (r)
|
|
@@ -880,22 +880,22 @@ k.parseExportSpecifiers = function(t) {
|
|
|
880
880
|
}
|
|
881
881
|
return e;
|
|
882
882
|
};
|
|
883
|
-
|
|
884
|
-
return this.next(), this.type === h.string ? (t.specifiers =
|
|
883
|
+
A.parseImport = function(t) {
|
|
884
|
+
return this.next(), this.type === h.string ? (t.specifiers = Wi, t.source = this.parseExprAtom()) : (t.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), t.source = this.type === h.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (t.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(t, "ImportDeclaration");
|
|
885
885
|
};
|
|
886
|
-
|
|
886
|
+
A.parseImportSpecifier = function() {
|
|
887
887
|
var t = this.startNode();
|
|
888
888
|
return t.imported = this.parseModuleExportName(), this.eatContextual("as") ? t.local = this.parseIdent() : (this.checkUnreserved(t.imported), t.local = t.imported), this.checkLValSimple(t.local, xt), this.finishNode(t, "ImportSpecifier");
|
|
889
889
|
};
|
|
890
|
-
|
|
890
|
+
A.parseImportDefaultSpecifier = function() {
|
|
891
891
|
var t = this.startNode();
|
|
892
892
|
return t.local = this.parseIdent(), this.checkLValSimple(t.local, xt), this.finishNode(t, "ImportDefaultSpecifier");
|
|
893
893
|
};
|
|
894
|
-
|
|
894
|
+
A.parseImportNamespaceSpecifier = function() {
|
|
895
895
|
var t = this.startNode();
|
|
896
896
|
return this.next(), this.expectContextual("as"), t.local = this.parseIdent(), this.checkLValSimple(t.local, xt), this.finishNode(t, "ImportNamespaceSpecifier");
|
|
897
897
|
};
|
|
898
|
-
|
|
898
|
+
A.parseImportSpecifiers = function() {
|
|
899
899
|
var t = [], e = !0;
|
|
900
900
|
if (this.type === h.name && (t.push(this.parseImportDefaultSpecifier()), !this.eat(h.comma)))
|
|
901
901
|
return t;
|
|
@@ -910,7 +910,7 @@ k.parseImportSpecifiers = function() {
|
|
|
910
910
|
}
|
|
911
911
|
return t;
|
|
912
912
|
};
|
|
913
|
-
|
|
913
|
+
A.parseWithClause = function() {
|
|
914
914
|
var t = [];
|
|
915
915
|
if (!this.eat(h._with))
|
|
916
916
|
return t;
|
|
@@ -921,26 +921,26 @@ k.parseWithClause = function() {
|
|
|
921
921
|
else if (this.expect(h.comma), this.afterTrailingComma(h.braceR))
|
|
922
922
|
break;
|
|
923
923
|
var a = this.parseImportAttribute(), u = a.key.type === "Identifier" ? a.key.name : a.key.value;
|
|
924
|
-
|
|
924
|
+
wt(e, u) && this.raiseRecoverable(a.key.start, "Duplicate attribute key '" + u + "'"), e[u] = !0, t.push(a);
|
|
925
925
|
}
|
|
926
926
|
return t;
|
|
927
927
|
};
|
|
928
|
-
|
|
928
|
+
A.parseImportAttribute = function() {
|
|
929
929
|
var t = this.startNode();
|
|
930
930
|
return t.key = this.type === h.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"), this.expect(h.colon), this.type !== h.string && this.unexpected(), t.value = this.parseExprAtom(), this.finishNode(t, "ImportAttribute");
|
|
931
931
|
};
|
|
932
|
-
|
|
932
|
+
A.parseModuleExportName = function() {
|
|
933
933
|
if (this.options.ecmaVersion >= 13 && this.type === h.string) {
|
|
934
934
|
var t = this.parseLiteral(this.value);
|
|
935
935
|
return Bi.test(t.value) && this.raise(t.start, "An export name cannot include a lone surrogate."), t;
|
|
936
936
|
}
|
|
937
937
|
return this.parseIdent(!0);
|
|
938
938
|
};
|
|
939
|
-
|
|
939
|
+
A.adaptDirectivePrologue = function(t) {
|
|
940
940
|
for (var e = 0; e < t.length && this.isDirectiveCandidate(t[e]); ++e)
|
|
941
941
|
t[e].directive = t[e].expression.raw.slice(1, -1);
|
|
942
942
|
};
|
|
943
|
-
|
|
943
|
+
A.isDirectiveCandidate = function(t) {
|
|
944
944
|
return this.options.ecmaVersion >= 5 && t.type === "ExpressionStatement" && t.expression.type === "Literal" && typeof t.expression.value == "string" && // Reject parenthesized strings.
|
|
945
945
|
(this.input[t.start] === '"' || this.input[t.start] === "'");
|
|
946
946
|
};
|
|
@@ -1050,11 +1050,11 @@ ct.parseMaybeDefault = function(t, e, r) {
|
|
|
1050
1050
|
return a.left = r, a.right = this.parseMaybeAssign(), this.finishNode(a, "AssignmentPattern");
|
|
1051
1051
|
};
|
|
1052
1052
|
ct.checkLValSimple = function(t, e, r) {
|
|
1053
|
-
e === void 0 && (e =
|
|
1054
|
-
var a = e !==
|
|
1053
|
+
e === void 0 && (e = Jt);
|
|
1054
|
+
var a = e !== Jt;
|
|
1055
1055
|
switch (t.type) {
|
|
1056
1056
|
case "Identifier":
|
|
1057
|
-
this.strict && this.reservedWordsStrictBind.test(t.name) && this.raiseRecoverable(t.start, (a ? "Binding " : "Assigning to ") + t.name + " in strict mode"), a && (e === xt && t.name === "let" && this.raiseRecoverable(t.start, "let is disallowed as a lexically bound name"), r && (
|
|
1057
|
+
this.strict && this.reservedWordsStrictBind.test(t.name) && this.raiseRecoverable(t.start, (a ? "Binding " : "Assigning to ") + t.name + " in strict mode"), a && (e === xt && t.name === "let" && this.raiseRecoverable(t.start, "let is disallowed as a lexically bound name"), r && (wt(r, t.name) && this.raiseRecoverable(t.start, "Argument name clash"), r[t.name] = !0), e !== Xe && this.declareName(t.name, e, t.start));
|
|
1058
1058
|
break;
|
|
1059
1059
|
case "ChainExpression":
|
|
1060
1060
|
this.raiseRecoverable(t.start, "Optional chaining cannot appear in left-hand side");
|
|
@@ -1069,7 +1069,7 @@ ct.checkLValSimple = function(t, e, r) {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
};
|
|
1071
1071
|
ct.checkLValPattern = function(t, e, r) {
|
|
1072
|
-
switch (e === void 0 && (e =
|
|
1072
|
+
switch (e === void 0 && (e = Jt), t.type) {
|
|
1073
1073
|
case "ObjectPattern":
|
|
1074
1074
|
for (var a = 0, u = t.properties; a < u.length; a += 1) {
|
|
1075
1075
|
var f = u[a];
|
|
@@ -1077,9 +1077,9 @@ ct.checkLValPattern = function(t, e, r) {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
break;
|
|
1079
1079
|
case "ArrayPattern":
|
|
1080
|
-
for (var d = 0,
|
|
1081
|
-
var
|
|
1082
|
-
|
|
1080
|
+
for (var d = 0, g = t.elements; d < g.length; d += 1) {
|
|
1081
|
+
var v = g[d];
|
|
1082
|
+
v && this.checkLValInnerPattern(v, e, r);
|
|
1083
1083
|
}
|
|
1084
1084
|
break;
|
|
1085
1085
|
default:
|
|
@@ -1087,7 +1087,7 @@ ct.checkLValPattern = function(t, e, r) {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
};
|
|
1089
1089
|
ct.checkLValInnerPattern = function(t, e, r) {
|
|
1090
|
-
switch (e === void 0 && (e =
|
|
1090
|
+
switch (e === void 0 && (e = Jt), t.type) {
|
|
1091
1091
|
case "Property":
|
|
1092
1092
|
this.checkLValInnerPattern(t.value, e, r);
|
|
1093
1093
|
break;
|
|
@@ -1101,33 +1101,33 @@ ct.checkLValInnerPattern = function(t, e, r) {
|
|
|
1101
1101
|
this.checkLValPattern(t, e, r);
|
|
1102
1102
|
}
|
|
1103
1103
|
};
|
|
1104
|
-
var
|
|
1104
|
+
var Y = function(e, r, a, u, f) {
|
|
1105
1105
|
this.token = e, this.isExpr = !!r, this.preserveSpace = !!a, this.override = u, this.generator = !!f;
|
|
1106
|
-
},
|
|
1107
|
-
b_stat: new
|
|
1108
|
-
b_expr: new
|
|
1109
|
-
b_tmpl: new
|
|
1110
|
-
p_stat: new
|
|
1111
|
-
p_expr: new
|
|
1112
|
-
q_tmpl: new
|
|
1106
|
+
}, j = {
|
|
1107
|
+
b_stat: new Y("{", !1),
|
|
1108
|
+
b_expr: new Y("{", !0),
|
|
1109
|
+
b_tmpl: new Y("${", !1),
|
|
1110
|
+
p_stat: new Y("(", !1),
|
|
1111
|
+
p_expr: new Y("(", !0),
|
|
1112
|
+
q_tmpl: new Y("`", !0, !0, function(t) {
|
|
1113
1113
|
return t.tryReadTemplateToken();
|
|
1114
1114
|
}),
|
|
1115
|
-
f_stat: new
|
|
1116
|
-
f_expr: new
|
|
1117
|
-
f_expr_gen: new
|
|
1118
|
-
f_gen: new
|
|
1119
|
-
},
|
|
1120
|
-
|
|
1121
|
-
return [
|
|
1122
|
-
};
|
|
1123
|
-
|
|
1115
|
+
f_stat: new Y("function", !1),
|
|
1116
|
+
f_expr: new Y("function", !0),
|
|
1117
|
+
f_expr_gen: new Y("function", !0, !1, null, !0),
|
|
1118
|
+
f_gen: new Y("function", !1, !1, null, !0)
|
|
1119
|
+
}, It = K.prototype;
|
|
1120
|
+
It.initialContext = function() {
|
|
1121
|
+
return [j.b_stat];
|
|
1122
|
+
};
|
|
1123
|
+
It.curContext = function() {
|
|
1124
1124
|
return this.context[this.context.length - 1];
|
|
1125
1125
|
};
|
|
1126
|
-
|
|
1126
|
+
It.braceIsBlock = function(t) {
|
|
1127
1127
|
var e = this.curContext();
|
|
1128
|
-
return e ===
|
|
1128
|
+
return e === j.f_expr || e === j.f_stat ? !0 : t === h.colon && (e === j.b_stat || e === j.b_expr) ? !e.isExpr : t === h._return || t === h.name && this.exprAllowed ? Z.test(this.input.slice(this.lastTokEnd, this.start)) : t === h._else || t === h.semi || t === h.eof || t === h.parenR || t === h.arrow ? !0 : t === h.braceL ? e === j.b_stat : t === h._var || t === h._const || t === h.name ? !1 : !this.exprAllowed;
|
|
1129
1129
|
};
|
|
1130
|
-
|
|
1130
|
+
It.inGeneratorContext = function() {
|
|
1131
1131
|
for (var t = this.context.length - 1; t >= 1; t--) {
|
|
1132
1132
|
var e = this.context[t];
|
|
1133
1133
|
if (e.token === "function")
|
|
@@ -1135,11 +1135,11 @@ _t.inGeneratorContext = function() {
|
|
|
1135
1135
|
}
|
|
1136
1136
|
return !1;
|
|
1137
1137
|
};
|
|
1138
|
-
|
|
1138
|
+
It.updateContext = function(t) {
|
|
1139
1139
|
var e, r = this.type;
|
|
1140
1140
|
r.keyword && t === h.dot ? this.exprAllowed = !1 : (e = r.updateContext) ? e.call(this, t) : this.exprAllowed = r.beforeExpr;
|
|
1141
1141
|
};
|
|
1142
|
-
|
|
1142
|
+
It.overrideContext = function(t) {
|
|
1143
1143
|
this.curContext() !== t && (this.context[this.context.length - 1] = t);
|
|
1144
1144
|
};
|
|
1145
1145
|
h.parenR.updateContext = h.braceR.updateContext = function() {
|
|
@@ -1148,33 +1148,33 @@ h.parenR.updateContext = h.braceR.updateContext = function() {
|
|
|
1148
1148
|
return;
|
|
1149
1149
|
}
|
|
1150
1150
|
var t = this.context.pop();
|
|
1151
|
-
t ===
|
|
1151
|
+
t === j.b_stat && this.curContext().token === "function" && (t = this.context.pop()), this.exprAllowed = !t.isExpr;
|
|
1152
1152
|
};
|
|
1153
1153
|
h.braceL.updateContext = function(t) {
|
|
1154
|
-
this.context.push(this.braceIsBlock(t) ?
|
|
1154
|
+
this.context.push(this.braceIsBlock(t) ? j.b_stat : j.b_expr), this.exprAllowed = !0;
|
|
1155
1155
|
};
|
|
1156
1156
|
h.dollarBraceL.updateContext = function() {
|
|
1157
|
-
this.context.push(
|
|
1157
|
+
this.context.push(j.b_tmpl), this.exprAllowed = !0;
|
|
1158
1158
|
};
|
|
1159
1159
|
h.parenL.updateContext = function(t) {
|
|
1160
1160
|
var e = t === h._if || t === h._for || t === h._with || t === h._while;
|
|
1161
|
-
this.context.push(e ?
|
|
1161
|
+
this.context.push(e ? j.p_stat : j.p_expr), this.exprAllowed = !0;
|
|
1162
1162
|
};
|
|
1163
1163
|
h.incDec.updateContext = function() {
|
|
1164
1164
|
};
|
|
1165
1165
|
h._function.updateContext = h._class.updateContext = function(t) {
|
|
1166
|
-
t.beforeExpr && t !== h._else && !(t === h.semi && this.curContext() !==
|
|
1166
|
+
t.beforeExpr && t !== h._else && !(t === h.semi && this.curContext() !== j.p_stat) && !(t === h._return && Z.test(this.input.slice(this.lastTokEnd, this.start))) && !((t === h.colon || t === h.braceL) && this.curContext() === j.b_stat) ? this.context.push(j.f_expr) : this.context.push(j.f_stat), this.exprAllowed = !1;
|
|
1167
1167
|
};
|
|
1168
1168
|
h.colon.updateContext = function() {
|
|
1169
1169
|
this.curContext().token === "function" && this.context.pop(), this.exprAllowed = !0;
|
|
1170
1170
|
};
|
|
1171
1171
|
h.backQuote.updateContext = function() {
|
|
1172
|
-
this.curContext() ===
|
|
1172
|
+
this.curContext() === j.q_tmpl ? this.context.pop() : this.context.push(j.q_tmpl), this.exprAllowed = !1;
|
|
1173
1173
|
};
|
|
1174
1174
|
h.star.updateContext = function(t) {
|
|
1175
1175
|
if (t === h._function) {
|
|
1176
1176
|
var e = this.context.length - 1;
|
|
1177
|
-
this.context[e] ===
|
|
1177
|
+
this.context[e] === j.f_expr ? this.context[e] = j.f_expr_gen : this.context[e] = j.f_gen;
|
|
1178
1178
|
}
|
|
1179
1179
|
this.exprAllowed = !0;
|
|
1180
1180
|
};
|
|
@@ -1182,8 +1182,8 @@ h.name.updateContext = function(t) {
|
|
|
1182
1182
|
var e = !1;
|
|
1183
1183
|
this.options.ecmaVersion >= 6 && t !== h.dot && (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) && (e = !0), this.exprAllowed = e;
|
|
1184
1184
|
};
|
|
1185
|
-
var
|
|
1186
|
-
|
|
1185
|
+
var N = K.prototype;
|
|
1186
|
+
N.checkPropClash = function(t, e, r) {
|
|
1187
1187
|
if (!(this.options.ecmaVersion >= 9 && t.type === "SpreadElement") && !(this.options.ecmaVersion >= 6 && (t.computed || t.method || t.shorthand))) {
|
|
1188
1188
|
var a = t.key, u;
|
|
1189
1189
|
switch (a.type) {
|
|
@@ -1204,8 +1204,8 @@ _.checkPropClash = function(t, e, r) {
|
|
|
1204
1204
|
u = "$" + u;
|
|
1205
1205
|
var d = e[u];
|
|
1206
1206
|
if (d) {
|
|
1207
|
-
var
|
|
1208
|
-
f === "init" ?
|
|
1207
|
+
var g;
|
|
1208
|
+
f === "init" ? g = this.strict && d.init || d.get || d.set : g = d.init || d[f], g && this.raiseRecoverable(a.start, "Redefinition of property");
|
|
1209
1209
|
} else
|
|
1210
1210
|
d = e[u] = {
|
|
1211
1211
|
init: !1,
|
|
@@ -1215,7 +1215,7 @@ _.checkPropClash = function(t, e, r) {
|
|
|
1215
1215
|
d[f] = !0;
|
|
1216
1216
|
}
|
|
1217
1217
|
};
|
|
1218
|
-
|
|
1218
|
+
N.parseExpression = function(t, e) {
|
|
1219
1219
|
var r = this.start, a = this.startLoc, u = this.parseMaybeAssign(t, e);
|
|
1220
1220
|
if (this.type === h.comma) {
|
|
1221
1221
|
var f = this.startNodeAt(r, a);
|
|
@@ -1225,25 +1225,25 @@ _.parseExpression = function(t, e) {
|
|
|
1225
1225
|
}
|
|
1226
1226
|
return u;
|
|
1227
1227
|
};
|
|
1228
|
-
|
|
1228
|
+
N.parseMaybeAssign = function(t, e, r) {
|
|
1229
1229
|
if (this.isContextual("yield")) {
|
|
1230
1230
|
if (this.inGenerator)
|
|
1231
1231
|
return this.parseYield(t);
|
|
1232
1232
|
this.exprAllowed = !1;
|
|
1233
1233
|
}
|
|
1234
1234
|
var a = !1, u = -1, f = -1, d = -1;
|
|
1235
|
-
e ? (u = e.parenthesizedAssign, f = e.trailingComma, d = e.doubleProto, e.parenthesizedAssign = e.trailingComma = -1) : (e = new
|
|
1236
|
-
var
|
|
1235
|
+
e ? (u = e.parenthesizedAssign, f = e.trailingComma, d = e.doubleProto, e.parenthesizedAssign = e.trailingComma = -1) : (e = new te(), a = !0);
|
|
1236
|
+
var g = this.start, v = this.startLoc;
|
|
1237
1237
|
(this.type === h.parenL || this.type === h.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = t === "await");
|
|
1238
1238
|
var o = this.parseMaybeConditional(t, e);
|
|
1239
|
-
if (r && (o = r.call(this, o,
|
|
1240
|
-
var
|
|
1241
|
-
return
|
|
1239
|
+
if (r && (o = r.call(this, o, g, v)), this.type.isAssign) {
|
|
1240
|
+
var C = this.startNodeAt(g, v);
|
|
1241
|
+
return C.operator = this.value, this.type === h.eq && (o = this.toAssignable(o, !1, e)), a || (e.parenthesizedAssign = e.trailingComma = e.doubleProto = -1), e.shorthandAssign >= o.start && (e.shorthandAssign = -1), this.type === h.eq ? this.checkLValPattern(o) : this.checkLValSimple(o), C.left = o, this.next(), C.right = this.parseMaybeAssign(t), d > -1 && (e.doubleProto = d), this.finishNode(C, "AssignmentExpression");
|
|
1242
1242
|
} else
|
|
1243
1243
|
a && this.checkExpressionErrors(e, !0);
|
|
1244
1244
|
return u > -1 && (e.parenthesizedAssign = u), f > -1 && (e.trailingComma = f), o;
|
|
1245
1245
|
};
|
|
1246
|
-
|
|
1246
|
+
N.parseMaybeConditional = function(t, e) {
|
|
1247
1247
|
var r = this.start, a = this.startLoc, u = this.parseExprOps(t, e);
|
|
1248
1248
|
if (this.checkExpressionErrors(e))
|
|
1249
1249
|
return u;
|
|
@@ -1253,34 +1253,34 @@ _.parseMaybeConditional = function(t, e) {
|
|
|
1253
1253
|
}
|
|
1254
1254
|
return u;
|
|
1255
1255
|
};
|
|
1256
|
-
|
|
1256
|
+
N.parseExprOps = function(t, e) {
|
|
1257
1257
|
var r = this.start, a = this.startLoc, u = this.parseMaybeUnary(e, !1, !1, t);
|
|
1258
1258
|
return this.checkExpressionErrors(e) || u.start === r && u.type === "ArrowFunctionExpression" ? u : this.parseExprOp(u, r, a, -1, t);
|
|
1259
1259
|
};
|
|
1260
|
-
|
|
1260
|
+
N.parseExprOp = function(t, e, r, a, u) {
|
|
1261
1261
|
var f = this.type.binop;
|
|
1262
1262
|
if (f != null && (!u || this.type !== h._in) && f > a) {
|
|
1263
|
-
var d = this.type === h.logicalOR || this.type === h.logicalAND,
|
|
1264
|
-
|
|
1265
|
-
var
|
|
1263
|
+
var d = this.type === h.logicalOR || this.type === h.logicalAND, g = this.type === h.coalesce;
|
|
1264
|
+
g && (f = h.logicalAND.binop);
|
|
1265
|
+
var v = this.value;
|
|
1266
1266
|
this.next();
|
|
1267
|
-
var o = this.start,
|
|
1268
|
-
return (d && this.type === h.coalesce ||
|
|
1267
|
+
var o = this.start, C = this.startLoc, _ = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, u), o, C, f, u), M = this.buildBinary(e, r, t, _, v, d || g);
|
|
1268
|
+
return (d && this.type === h.coalesce || g && (this.type === h.logicalOR || this.type === h.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(M, e, r, a, u);
|
|
1269
1269
|
}
|
|
1270
1270
|
return t;
|
|
1271
1271
|
};
|
|
1272
|
-
|
|
1272
|
+
N.buildBinary = function(t, e, r, a, u, f) {
|
|
1273
1273
|
a.type === "PrivateIdentifier" && this.raise(a.start, "Private identifier can only be left side of binary expression");
|
|
1274
1274
|
var d = this.startNodeAt(t, e);
|
|
1275
1275
|
return d.left = r, d.operator = u, d.right = a, this.finishNode(d, f ? "LogicalExpression" : "BinaryExpression");
|
|
1276
1276
|
};
|
|
1277
|
-
|
|
1277
|
+
N.parseMaybeUnary = function(t, e, r, a) {
|
|
1278
1278
|
var u = this.start, f = this.startLoc, d;
|
|
1279
1279
|
if (this.isContextual("await") && this.canAwait)
|
|
1280
1280
|
d = this.parseAwait(a), e = !0;
|
|
1281
1281
|
else if (this.type.prefix) {
|
|
1282
|
-
var
|
|
1283
|
-
|
|
1282
|
+
var g = this.startNode(), v = this.type === h.incDec;
|
|
1283
|
+
g.operator = this.value, g.prefix = !0, this.next(), g.argument = this.parseMaybeUnary(null, !0, v, a), this.checkExpressionErrors(t, !0), v ? this.checkLValSimple(g.argument) : this.strict && g.operator === "delete" && Ye(g.argument) ? this.raiseRecoverable(g.start, "Deleting local variable in strict mode") : g.operator === "delete" && de(g.argument) ? this.raiseRecoverable(g.start, "Private fields can not be deleted") : e = !0, d = this.finishNode(g, v ? "UpdateExpression" : "UnaryExpression");
|
|
1284
1284
|
} else if (!e && this.type === h.privateId)
|
|
1285
1285
|
(a || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), d = this.parsePrivateIdent(), this.type !== h._in && this.unexpected();
|
|
1286
1286
|
else {
|
|
@@ -1305,56 +1305,56 @@ function Ye(t) {
|
|
|
1305
1305
|
function de(t) {
|
|
1306
1306
|
return t.type === "MemberExpression" && t.property.type === "PrivateIdentifier" || t.type === "ChainExpression" && de(t.expression) || t.type === "ParenthesizedExpression" && de(t.expression);
|
|
1307
1307
|
}
|
|
1308
|
-
|
|
1308
|
+
N.parseExprSubscripts = function(t, e) {
|
|
1309
1309
|
var r = this.start, a = this.startLoc, u = this.parseExprAtom(t, e);
|
|
1310
1310
|
if (u.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
|
|
1311
1311
|
return u;
|
|
1312
1312
|
var f = this.parseSubscripts(u, r, a, !1, e);
|
|
1313
1313
|
return t && f.type === "MemberExpression" && (t.parenthesizedAssign >= f.start && (t.parenthesizedAssign = -1), t.parenthesizedBind >= f.start && (t.parenthesizedBind = -1), t.trailingComma >= f.start && (t.trailingComma = -1)), f;
|
|
1314
1314
|
};
|
|
1315
|
-
|
|
1315
|
+
N.parseSubscripts = function(t, e, r, a, u) {
|
|
1316
1316
|
for (var f = 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; ; ) {
|
|
1317
|
-
var
|
|
1318
|
-
if (
|
|
1317
|
+
var g = this.parseSubscript(t, e, r, a, f, d, u);
|
|
1318
|
+
if (g.optional && (d = !0), g === t || g.type === "ArrowFunctionExpression") {
|
|
1319
1319
|
if (d) {
|
|
1320
|
-
var
|
|
1321
|
-
|
|
1320
|
+
var v = this.startNodeAt(e, r);
|
|
1321
|
+
v.expression = g, g = this.finishNode(v, "ChainExpression");
|
|
1322
1322
|
}
|
|
1323
|
-
return
|
|
1323
|
+
return g;
|
|
1324
1324
|
}
|
|
1325
|
-
t =
|
|
1325
|
+
t = g;
|
|
1326
1326
|
}
|
|
1327
1327
|
};
|
|
1328
|
-
|
|
1328
|
+
N.shouldParseAsyncArrow = function() {
|
|
1329
1329
|
return !this.canInsertSemicolon() && this.eat(h.arrow);
|
|
1330
1330
|
};
|
|
1331
|
-
|
|
1331
|
+
N.parseSubscriptAsyncArrow = function(t, e, r, a) {
|
|
1332
1332
|
return this.parseArrowExpression(this.startNodeAt(t, e), r, !0, a);
|
|
1333
1333
|
};
|
|
1334
|
-
|
|
1335
|
-
var
|
|
1336
|
-
a &&
|
|
1334
|
+
N.parseSubscript = function(t, e, r, a, u, f, d) {
|
|
1335
|
+
var g = this.options.ecmaVersion >= 11, v = g && this.eat(h.questionDot);
|
|
1336
|
+
a && v && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
1337
1337
|
var o = this.eat(h.bracketL);
|
|
1338
|
-
if (o ||
|
|
1339
|
-
var
|
|
1340
|
-
|
|
1338
|
+
if (o || v && this.type !== h.parenL && this.type !== h.backQuote || this.eat(h.dot)) {
|
|
1339
|
+
var C = this.startNodeAt(e, r);
|
|
1340
|
+
C.object = t, o ? (C.property = this.parseExpression(), this.expect(h.bracketR)) : this.type === h.privateId && t.type !== "Super" ? C.property = this.parsePrivateIdent() : C.property = this.parseIdent(this.options.allowReserved !== "never"), C.computed = !!o, g && (C.optional = v), t = this.finishNode(C, "MemberExpression");
|
|
1341
1341
|
} else if (!a && this.eat(h.parenL)) {
|
|
1342
|
-
var
|
|
1342
|
+
var _ = new te(), M = this.yieldPos, q = this.awaitPos, z = this.awaitIdentPos;
|
|
1343
1343
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
1344
|
-
var
|
|
1345
|
-
if (u && !
|
|
1346
|
-
return this.checkPatternErrors(
|
|
1347
|
-
this.checkExpressionErrors(
|
|
1344
|
+
var $ = this.parseExprList(h.parenR, this.options.ecmaVersion >= 8, !1, _);
|
|
1345
|
+
if (u && !v && this.shouldParseAsyncArrow())
|
|
1346
|
+
return this.checkPatternErrors(_, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = M, this.awaitPos = q, this.awaitIdentPos = z, this.parseSubscriptAsyncArrow(e, r, $, d);
|
|
1347
|
+
this.checkExpressionErrors(_, !0), this.yieldPos = M || this.yieldPos, this.awaitPos = q || this.awaitPos, this.awaitIdentPos = z || this.awaitIdentPos;
|
|
1348
1348
|
var I = this.startNodeAt(e, r);
|
|
1349
|
-
I.callee = t, I.arguments =
|
|
1349
|
+
I.callee = t, I.arguments = $, g && (I.optional = v), t = this.finishNode(I, "CallExpression");
|
|
1350
1350
|
} else if (this.type === h.backQuote) {
|
|
1351
|
-
(
|
|
1352
|
-
var
|
|
1353
|
-
|
|
1351
|
+
(v || f) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
1352
|
+
var et = this.startNodeAt(e, r);
|
|
1353
|
+
et.tag = t, et.quasi = this.parseTemplate({ isTagged: !0 }), t = this.finishNode(et, "TaggedTemplateExpression");
|
|
1354
1354
|
}
|
|
1355
1355
|
return t;
|
|
1356
1356
|
};
|
|
1357
|
-
|
|
1357
|
+
N.parseExprAtom = function(t, e, r) {
|
|
1358
1358
|
this.type === h.slash && this.readRegexp();
|
|
1359
1359
|
var a, u = this.potentialArrowAt === this.start;
|
|
1360
1360
|
switch (this.type) {
|
|
@@ -1363,16 +1363,16 @@ _.parseExprAtom = function(t, e, r) {
|
|
|
1363
1363
|
case h._this:
|
|
1364
1364
|
return a = this.startNode(), this.next(), this.finishNode(a, "ThisExpression");
|
|
1365
1365
|
case h.name:
|
|
1366
|
-
var f = this.start, d = this.startLoc,
|
|
1367
|
-
if (this.options.ecmaVersion >= 8 && !
|
|
1368
|
-
return this.overrideContext(
|
|
1366
|
+
var f = this.start, d = this.startLoc, g = this.containsEsc, v = this.parseIdent(!1);
|
|
1367
|
+
if (this.options.ecmaVersion >= 8 && !g && v.name === "async" && !this.canInsertSemicolon() && this.eat(h._function))
|
|
1368
|
+
return this.overrideContext(j.f_expr), this.parseFunction(this.startNodeAt(f, d), 0, !1, !0, e);
|
|
1369
1369
|
if (u && !this.canInsertSemicolon()) {
|
|
1370
1370
|
if (this.eat(h.arrow))
|
|
1371
|
-
return this.parseArrowExpression(this.startNodeAt(f, d), [
|
|
1372
|
-
if (this.options.ecmaVersion >= 8 &&
|
|
1373
|
-
return
|
|
1371
|
+
return this.parseArrowExpression(this.startNodeAt(f, d), [v], !1, e);
|
|
1372
|
+
if (this.options.ecmaVersion >= 8 && v.name === "async" && this.type === h.name && !g && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc))
|
|
1373
|
+
return v = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(h.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(f, d), [v], !0, e);
|
|
1374
1374
|
}
|
|
1375
|
-
return
|
|
1375
|
+
return v;
|
|
1376
1376
|
case h.regexp:
|
|
1377
1377
|
var o = this.value;
|
|
1378
1378
|
return a = this.parseLiteral(o.value), a.regex = { pattern: o.pattern, flags: o.flags }, a;
|
|
@@ -1384,12 +1384,12 @@ _.parseExprAtom = function(t, e, r) {
|
|
|
1384
1384
|
case h._false:
|
|
1385
1385
|
return a = this.startNode(), a.value = this.type === h._null ? null : this.type === h._true, a.raw = this.type.keyword, this.next(), this.finishNode(a, "Literal");
|
|
1386
1386
|
case h.parenL:
|
|
1387
|
-
var
|
|
1388
|
-
return t && (t.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(
|
|
1387
|
+
var C = this.start, _ = this.parseParenAndDistinguishExpression(u, e);
|
|
1388
|
+
return t && (t.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(_) && (t.parenthesizedAssign = C), t.parenthesizedBind < 0 && (t.parenthesizedBind = C)), _;
|
|
1389
1389
|
case h.bracketL:
|
|
1390
1390
|
return a = this.startNode(), this.next(), a.elements = this.parseExprList(h.bracketR, !0, !0, t), this.finishNode(a, "ArrayExpression");
|
|
1391
1391
|
case h.braceL:
|
|
1392
|
-
return this.overrideContext(
|
|
1392
|
+
return this.overrideContext(j.b_expr), this.parseObj(!1, t);
|
|
1393
1393
|
case h._function:
|
|
1394
1394
|
return a = this.startNode(), this.next(), this.parseFunction(a, 0);
|
|
1395
1395
|
case h._class:
|
|
@@ -1404,10 +1404,10 @@ _.parseExprAtom = function(t, e, r) {
|
|
|
1404
1404
|
return this.parseExprAtomDefault();
|
|
1405
1405
|
}
|
|
1406
1406
|
};
|
|
1407
|
-
|
|
1407
|
+
N.parseExprAtomDefault = function() {
|
|
1408
1408
|
this.unexpected();
|
|
1409
1409
|
};
|
|
1410
|
-
|
|
1410
|
+
N.parseExprImport = function(t) {
|
|
1411
1411
|
var e = this.startNode();
|
|
1412
1412
|
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type === h.parenL && !t)
|
|
1413
1413
|
return this.parseDynamicImport(e);
|
|
@@ -1417,7 +1417,7 @@ _.parseExprImport = function(t) {
|
|
|
1417
1417
|
} else
|
|
1418
1418
|
this.unexpected();
|
|
1419
1419
|
};
|
|
1420
|
-
|
|
1420
|
+
N.parseDynamicImport = function(t) {
|
|
1421
1421
|
if (this.next(), t.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16)
|
|
1422
1422
|
this.eat(h.parenR) ? t.options = null : (this.expect(h.comma), this.afterTrailingComma(h.parenR) ? t.options = null : (t.options = this.parseMaybeAssign(), this.eat(h.parenR) || (this.expect(h.comma), this.afterTrailingComma(h.parenR) || this.unexpected())));
|
|
1423
1423
|
else if (!this.eat(h.parenR)) {
|
|
@@ -1426,60 +1426,60 @@ _.parseDynamicImport = function(t) {
|
|
|
1426
1426
|
}
|
|
1427
1427
|
return this.finishNode(t, "ImportExpression");
|
|
1428
1428
|
};
|
|
1429
|
-
|
|
1429
|
+
N.parseImportMeta = function(t) {
|
|
1430
1430
|
this.next();
|
|
1431
1431
|
var e = this.containsEsc;
|
|
1432
1432
|
return t.property = this.parseIdent(!0), t.property.name !== "meta" && this.raiseRecoverable(t.property.start, "The only valid meta property for import is 'import.meta'"), e && this.raiseRecoverable(t.start, "'import.meta' must not contain escaped characters"), this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere && this.raiseRecoverable(t.start, "Cannot use 'import.meta' outside a module"), this.finishNode(t, "MetaProperty");
|
|
1433
1433
|
};
|
|
1434
|
-
|
|
1434
|
+
N.parseLiteral = function(t) {
|
|
1435
1435
|
var e = this.startNode();
|
|
1436
1436
|
return e.value = t, e.raw = this.input.slice(this.start, this.end), e.raw.charCodeAt(e.raw.length - 1) === 110 && (e.bigint = e.value != null ? e.value.toString() : e.raw.slice(0, -1).replace(/_/g, "")), this.next(), this.finishNode(e, "Literal");
|
|
1437
1437
|
};
|
|
1438
|
-
|
|
1438
|
+
N.parseParenExpression = function() {
|
|
1439
1439
|
this.expect(h.parenL);
|
|
1440
1440
|
var t = this.parseExpression();
|
|
1441
1441
|
return this.expect(h.parenR), t;
|
|
1442
1442
|
};
|
|
1443
|
-
|
|
1443
|
+
N.shouldParseArrow = function(t) {
|
|
1444
1444
|
return !this.canInsertSemicolon();
|
|
1445
1445
|
};
|
|
1446
|
-
|
|
1446
|
+
N.parseParenAndDistinguishExpression = function(t, e) {
|
|
1447
1447
|
var r = this.start, a = this.startLoc, u, f = this.options.ecmaVersion >= 8;
|
|
1448
1448
|
if (this.options.ecmaVersion >= 6) {
|
|
1449
1449
|
this.next();
|
|
1450
|
-
var d = this.start,
|
|
1450
|
+
var d = this.start, g = this.startLoc, v = [], o = !0, C = !1, _ = new te(), M = this.yieldPos, q = this.awaitPos, z;
|
|
1451
1451
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== h.parenR; )
|
|
1452
1452
|
if (o ? o = !1 : this.expect(h.comma), f && this.afterTrailingComma(h.parenR, !0)) {
|
|
1453
|
-
|
|
1453
|
+
C = !0;
|
|
1454
1454
|
break;
|
|
1455
1455
|
} else if (this.type === h.ellipsis) {
|
|
1456
|
-
|
|
1456
|
+
z = this.start, v.push(this.parseParenItem(this.parseRestBinding())), this.type === h.comma && this.raiseRecoverable(
|
|
1457
1457
|
this.start,
|
|
1458
1458
|
"Comma is not permitted after the rest element"
|
|
1459
1459
|
);
|
|
1460
1460
|
break;
|
|
1461
1461
|
} else
|
|
1462
|
-
|
|
1463
|
-
var
|
|
1464
|
-
if (this.expect(h.parenR), t && this.shouldParseArrow(
|
|
1465
|
-
return this.checkPatternErrors(
|
|
1466
|
-
(!
|
|
1462
|
+
v.push(this.parseMaybeAssign(!1, _, this.parseParenItem));
|
|
1463
|
+
var $ = this.lastTokEnd, I = this.lastTokEndLoc;
|
|
1464
|
+
if (this.expect(h.parenR), t && this.shouldParseArrow(v) && this.eat(h.arrow))
|
|
1465
|
+
return this.checkPatternErrors(_, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = M, this.awaitPos = q, this.parseParenArrowList(r, a, v, e);
|
|
1466
|
+
(!v.length || C) && this.unexpected(this.lastTokStart), z && this.unexpected(z), this.checkExpressionErrors(_, !0), this.yieldPos = M || this.yieldPos, this.awaitPos = q || this.awaitPos, v.length > 1 ? (u = this.startNodeAt(d, g), u.expressions = v, this.finishNodeAt(u, "SequenceExpression", $, I)) : u = v[0];
|
|
1467
1467
|
} else
|
|
1468
1468
|
u = this.parseParenExpression();
|
|
1469
1469
|
if (this.options.preserveParens) {
|
|
1470
|
-
var
|
|
1471
|
-
return
|
|
1470
|
+
var et = this.startNodeAt(r, a);
|
|
1471
|
+
return et.expression = u, this.finishNode(et, "ParenthesizedExpression");
|
|
1472
1472
|
} else
|
|
1473
1473
|
return u;
|
|
1474
1474
|
};
|
|
1475
|
-
|
|
1475
|
+
N.parseParenItem = function(t) {
|
|
1476
1476
|
return t;
|
|
1477
1477
|
};
|
|
1478
|
-
|
|
1478
|
+
N.parseParenArrowList = function(t, e, r, a) {
|
|
1479
1479
|
return this.parseArrowExpression(this.startNodeAt(t, e), r, !1, a);
|
|
1480
1480
|
};
|
|
1481
|
-
var
|
|
1482
|
-
|
|
1481
|
+
var zi = [];
|
|
1482
|
+
N.parseNew = function() {
|
|
1483
1483
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
1484
1484
|
var t = this.startNode();
|
|
1485
1485
|
if (this.next(), this.options.ecmaVersion >= 6 && this.type === h.dot) {
|
|
@@ -1489,9 +1489,9 @@ _.parseNew = function() {
|
|
|
1489
1489
|
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'"), r && 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");
|
|
1490
1490
|
}
|
|
1491
1491
|
var a = this.start, u = this.startLoc;
|
|
1492
|
-
return t.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), a, u, !0, !1), this.eat(h.parenL) ? t.arguments = this.parseExprList(h.parenR, this.options.ecmaVersion >= 8, !1) : t.arguments =
|
|
1492
|
+
return t.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), a, u, !0, !1), this.eat(h.parenL) ? t.arguments = this.parseExprList(h.parenR, this.options.ecmaVersion >= 8, !1) : t.arguments = zi, this.finishNode(t, "NewExpression");
|
|
1493
1493
|
};
|
|
1494
|
-
|
|
1494
|
+
N.parseTemplateElement = function(t) {
|
|
1495
1495
|
var e = t.isTagged, r = this.startNode();
|
|
1496
1496
|
return this.type === h.invalidTemplate ? (e || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), r.value = {
|
|
1497
1497
|
raw: this.value.replace(/\r\n?/g, `
|
|
@@ -1503,7 +1503,7 @@ _.parseTemplateElement = function(t) {
|
|
|
1503
1503
|
cooked: this.value
|
|
1504
1504
|
}, this.next(), r.tail = this.type === h.backQuote, this.finishNode(r, "TemplateElement");
|
|
1505
1505
|
};
|
|
1506
|
-
|
|
1506
|
+
N.parseTemplate = function(t) {
|
|
1507
1507
|
t === void 0 && (t = {});
|
|
1508
1508
|
var e = t.isTagged;
|
|
1509
1509
|
e === void 0 && (e = !1);
|
|
@@ -1514,10 +1514,10 @@ _.parseTemplate = function(t) {
|
|
|
1514
1514
|
this.type === h.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(h.dollarBraceL), r.expressions.push(this.parseExpression()), this.expect(h.braceR), r.quasis.push(a = this.parseTemplateElement({ isTagged: e }));
|
|
1515
1515
|
return this.next(), this.finishNode(r, "TemplateLiteral");
|
|
1516
1516
|
};
|
|
1517
|
-
|
|
1518
|
-
return !t.computed && t.key.type === "Identifier" && t.key.name === "async" && (this.type === h.name || this.type === h.num || this.type === h.string || this.type === h.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === h.star) && !
|
|
1517
|
+
N.isAsyncProp = function(t) {
|
|
1518
|
+
return !t.computed && t.key.type === "Identifier" && t.key.name === "async" && (this.type === h.name || this.type === h.num || this.type === h.string || this.type === h.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === h.star) && !Z.test(this.input.slice(this.lastTokEnd, this.start));
|
|
1519
1519
|
};
|
|
1520
|
-
|
|
1520
|
+
N.parseObj = function(t, e) {
|
|
1521
1521
|
var r = this.startNode(), a = !0, u = {};
|
|
1522
1522
|
for (r.properties = [], this.next(); !this.eat(h.braceR); ) {
|
|
1523
1523
|
if (a)
|
|
@@ -1529,15 +1529,15 @@ _.parseObj = function(t, e) {
|
|
|
1529
1529
|
}
|
|
1530
1530
|
return this.finishNode(r, t ? "ObjectPattern" : "ObjectExpression");
|
|
1531
1531
|
};
|
|
1532
|
-
|
|
1532
|
+
N.parseProperty = function(t, e) {
|
|
1533
1533
|
var r = this.startNode(), a, u, f, d;
|
|
1534
1534
|
if (this.options.ecmaVersion >= 9 && this.eat(h.ellipsis))
|
|
1535
1535
|
return t ? (r.argument = this.parseIdent(!1), this.type === h.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(r, "RestElement")) : (r.argument = this.parseMaybeAssign(!1, e), this.type === h.comma && e && e.trailingComma < 0 && (e.trailingComma = this.start), this.finishNode(r, "SpreadElement"));
|
|
1536
1536
|
this.options.ecmaVersion >= 6 && (r.method = !1, r.shorthand = !1, (t || e) && (f = this.start, d = this.startLoc), t || (a = this.eat(h.star)));
|
|
1537
|
-
var
|
|
1538
|
-
return this.parsePropertyName(r), !t && !
|
|
1537
|
+
var g = this.containsEsc;
|
|
1538
|
+
return this.parsePropertyName(r), !t && !g && this.options.ecmaVersion >= 8 && !a && this.isAsyncProp(r) ? (u = !0, a = this.options.ecmaVersion >= 9 && this.eat(h.star), this.parsePropertyName(r)) : u = !1, this.parsePropertyValue(r, t, a, u, f, d, e, g), this.finishNode(r, "Property");
|
|
1539
1539
|
};
|
|
1540
|
-
|
|
1540
|
+
N.parseGetterSetter = function(t) {
|
|
1541
1541
|
var e = t.key.name;
|
|
1542
1542
|
this.parsePropertyName(t), t.value = this.parseMethod(!1), t.kind = e;
|
|
1543
1543
|
var r = t.kind === "get" ? 0 : 1;
|
|
@@ -1547,10 +1547,10 @@ _.parseGetterSetter = function(t) {
|
|
|
1547
1547
|
} else
|
|
1548
1548
|
t.kind === "set" && t.value.params[0].type === "RestElement" && this.raiseRecoverable(t.value.params[0].start, "Setter cannot use rest params");
|
|
1549
1549
|
};
|
|
1550
|
-
|
|
1551
|
-
(r || a) && this.type === h.colon && this.unexpected(), this.eat(h.colon) ? (t.value = e ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, d), t.kind = "init") : this.options.ecmaVersion >= 6 && this.type === h.parenL ? (e && this.unexpected(), t.method = !0, t.value = this.parseMethod(r, a), t.kind = "init") : !e && !
|
|
1550
|
+
N.parsePropertyValue = function(t, e, r, a, u, f, d, g) {
|
|
1551
|
+
(r || a) && this.type === h.colon && this.unexpected(), this.eat(h.colon) ? (t.value = e ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, d), t.kind = "init") : this.options.ecmaVersion >= 6 && this.type === h.parenL ? (e && this.unexpected(), t.method = !0, t.value = this.parseMethod(r, a), t.kind = "init") : !e && !g && this.options.ecmaVersion >= 5 && !t.computed && t.key.type === "Identifier" && (t.key.name === "get" || t.key.name === "set") && this.type !== h.comma && this.type !== h.braceR && this.type !== h.eq ? ((r || a) && this.unexpected(), this.parseGetterSetter(t)) : this.options.ecmaVersion >= 6 && !t.computed && t.key.type === "Identifier" ? ((r || a) && this.unexpected(), this.checkUnreserved(t.key), t.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = u), e ? t.value = this.parseMaybeDefault(u, f, this.copyNode(t.key)) : this.type === h.eq && d ? (d.shorthandAssign < 0 && (d.shorthandAssign = this.start), t.value = this.parseMaybeDefault(u, f, this.copyNode(t.key))) : t.value = this.copyNode(t.key), t.kind = "init", t.shorthand = !0) : this.unexpected();
|
|
1552
1552
|
};
|
|
1553
|
-
|
|
1553
|
+
N.parsePropertyName = function(t) {
|
|
1554
1554
|
if (this.options.ecmaVersion >= 6) {
|
|
1555
1555
|
if (this.eat(h.bracketL))
|
|
1556
1556
|
return t.computed = !0, t.key = this.parseMaybeAssign(), this.expect(h.bracketR), t.key;
|
|
@@ -1558,30 +1558,30 @@ _.parsePropertyName = function(t) {
|
|
|
1558
1558
|
}
|
|
1559
1559
|
return t.key = this.type === h.num || this.type === h.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
|
|
1560
1560
|
};
|
|
1561
|
-
|
|
1561
|
+
N.initFunction = function(t) {
|
|
1562
1562
|
t.id = null, this.options.ecmaVersion >= 6 && (t.generator = t.expression = !1), this.options.ecmaVersion >= 8 && (t.async = !1);
|
|
1563
1563
|
};
|
|
1564
|
-
|
|
1564
|
+
N.parseMethod = function(t, e, r) {
|
|
1565
1565
|
var a = this.startNode(), u = this.yieldPos, f = this.awaitPos, d = this.awaitIdentPos;
|
|
1566
|
-
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(be(e, a.generator) |
|
|
1566
|
+
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(be(e, a.generator) | Yt | (r ? Je : 0)), this.expect(h.parenL), a.params = this.parseBindingList(h.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(a, !1, !0, !1), this.yieldPos = u, this.awaitPos = f, this.awaitIdentPos = d, this.finishNode(a, "FunctionExpression");
|
|
1567
1567
|
};
|
|
1568
|
-
|
|
1568
|
+
N.parseArrowExpression = function(t, e, r, a) {
|
|
1569
1569
|
var u = this.yieldPos, f = this.awaitPos, d = this.awaitIdentPos;
|
|
1570
1570
|
return this.enterScope(be(r, !1) | ge), this.initFunction(t), this.options.ecmaVersion >= 8 && (t.async = !!r), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, t.params = this.toAssignableList(e, !0), this.parseFunctionBody(t, !0, !1, a), this.yieldPos = u, this.awaitPos = f, this.awaitIdentPos = d, this.finishNode(t, "ArrowFunctionExpression");
|
|
1571
1571
|
};
|
|
1572
|
-
|
|
1572
|
+
N.parseFunctionBody = function(t, e, r, a) {
|
|
1573
1573
|
var u = e && this.type !== h.braceL, f = this.strict, d = !1;
|
|
1574
1574
|
if (u)
|
|
1575
1575
|
t.body = this.parseMaybeAssign(a), t.expression = !0, this.checkParams(t, !1);
|
|
1576
1576
|
else {
|
|
1577
|
-
var
|
|
1578
|
-
(!f ||
|
|
1579
|
-
var
|
|
1580
|
-
this.labels = [], d && (this.strict = !0), this.checkParams(t, !f && !d && !e && !r && this.isSimpleParamList(t.params)), this.strict && t.id && this.checkLValSimple(t.id, Xe), t.body = this.parseBlock(!1, void 0, d && !f), t.expression = !1, this.adaptDirectivePrologue(t.body.body), this.labels =
|
|
1577
|
+
var g = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(t.params);
|
|
1578
|
+
(!f || g) && (d = this.strictDirective(this.end), d && g && this.raiseRecoverable(t.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
|
|
1579
|
+
var v = this.labels;
|
|
1580
|
+
this.labels = [], d && (this.strict = !0), this.checkParams(t, !f && !d && !e && !r && this.isSimpleParamList(t.params)), this.strict && t.id && this.checkLValSimple(t.id, Xe), t.body = this.parseBlock(!1, void 0, d && !f), t.expression = !1, this.adaptDirectivePrologue(t.body.body), this.labels = v;
|
|
1581
1581
|
}
|
|
1582
1582
|
this.exitScope();
|
|
1583
1583
|
};
|
|
1584
|
-
|
|
1584
|
+
N.isSimpleParamList = function(t) {
|
|
1585
1585
|
for (var e = 0, r = t; e < r.length; e += 1) {
|
|
1586
1586
|
var a = r[e];
|
|
1587
1587
|
if (a.type !== "Identifier")
|
|
@@ -1589,13 +1589,13 @@ _.isSimpleParamList = function(t) {
|
|
|
1589
1589
|
}
|
|
1590
1590
|
return !0;
|
|
1591
1591
|
};
|
|
1592
|
-
|
|
1592
|
+
N.checkParams = function(t, e) {
|
|
1593
1593
|
for (var r = /* @__PURE__ */ Object.create(null), a = 0, u = t.params; a < u.length; a += 1) {
|
|
1594
1594
|
var f = u[a];
|
|
1595
1595
|
this.checkLValInnerPattern(f, Se, e ? null : r);
|
|
1596
1596
|
}
|
|
1597
1597
|
};
|
|
1598
|
-
|
|
1598
|
+
N.parseExprList = function(t, e, r, a) {
|
|
1599
1599
|
for (var u = [], f = !0; !this.eat(t); ) {
|
|
1600
1600
|
if (f)
|
|
1601
1601
|
f = !1;
|
|
@@ -1606,46 +1606,46 @@ _.parseExprList = function(t, e, r, a) {
|
|
|
1606
1606
|
}
|
|
1607
1607
|
return u;
|
|
1608
1608
|
};
|
|
1609
|
-
|
|
1609
|
+
N.checkUnreserved = function(t) {
|
|
1610
1610
|
var e = t.start, r = t.end, a = t.name;
|
|
1611
|
-
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 &
|
|
1611
|
+
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 & Zt) && 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, r).indexOf("\\") !== -1)) {
|
|
1612
1612
|
var u = this.strict ? this.reservedWordsStrict : this.reservedWords;
|
|
1613
1613
|
u.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"));
|
|
1614
1614
|
}
|
|
1615
1615
|
};
|
|
1616
|
-
|
|
1616
|
+
N.parseIdent = function(t) {
|
|
1617
1617
|
var e = this.parseIdentNode();
|
|
1618
1618
|
return this.next(!!t), this.finishNode(e, "Identifier"), t || (this.checkUnreserved(e), e.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = e.start)), e;
|
|
1619
1619
|
};
|
|
1620
|
-
|
|
1620
|
+
N.parseIdentNode = function() {
|
|
1621
1621
|
var t = this.startNode();
|
|
1622
1622
|
return this.type === h.name ? t.name = this.value : this.type.keyword ? (t.name = this.type.keyword, (t.name === "class" || t.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46) && this.context.pop(), this.type = h.name) : this.unexpected(), t;
|
|
1623
1623
|
};
|
|
1624
|
-
|
|
1624
|
+
N.parsePrivateIdent = function() {
|
|
1625
1625
|
var t = this.startNode();
|
|
1626
1626
|
return this.type === h.privateId ? t.name = this.value : this.unexpected(), this.next(), this.finishNode(t, "PrivateIdentifier"), this.options.checkPrivateFields && (this.privateNameStack.length === 0 ? this.raise(t.start, "Private field '#" + t.name + "' must be declared in an enclosing class") : this.privateNameStack[this.privateNameStack.length - 1].used.push(t)), t;
|
|
1627
1627
|
};
|
|
1628
|
-
|
|
1628
|
+
N.parseYield = function(t) {
|
|
1629
1629
|
this.yieldPos || (this.yieldPos = this.start);
|
|
1630
1630
|
var e = this.startNode();
|
|
1631
1631
|
return this.next(), this.type === h.semi || this.canInsertSemicolon() || this.type !== h.star && !this.type.startsExpr ? (e.delegate = !1, e.argument = null) : (e.delegate = this.eat(h.star), e.argument = this.parseMaybeAssign(t)), this.finishNode(e, "YieldExpression");
|
|
1632
1632
|
};
|
|
1633
|
-
|
|
1633
|
+
N.parseAwait = function(t) {
|
|
1634
1634
|
this.awaitPos || (this.awaitPos = this.start);
|
|
1635
1635
|
var e = this.startNode();
|
|
1636
1636
|
return this.next(), e.argument = this.parseMaybeUnary(null, !0, !1, t), this.finishNode(e, "AwaitExpression");
|
|
1637
1637
|
};
|
|
1638
|
-
var
|
|
1639
|
-
|
|
1638
|
+
var $t = K.prototype;
|
|
1639
|
+
$t.raise = function(t, e) {
|
|
1640
1640
|
var r = xe(this.input, t);
|
|
1641
1641
|
e += " (" + r.line + ":" + r.column + ")", this.sourceFile && (e += " in " + this.sourceFile);
|
|
1642
1642
|
var a = new SyntaxError(e);
|
|
1643
1643
|
throw a.pos = t, a.loc = r, a.raisedAt = this.pos, a;
|
|
1644
1644
|
};
|
|
1645
|
-
|
|
1646
|
-
|
|
1645
|
+
$t.raiseRecoverable = $t.raise;
|
|
1646
|
+
$t.curPosition = function() {
|
|
1647
1647
|
if (this.options.locations)
|
|
1648
|
-
return new
|
|
1648
|
+
return new At(this.curLine, this.pos - this.lineStart);
|
|
1649
1649
|
};
|
|
1650
1650
|
var St = K.prototype, Ji = function(e) {
|
|
1651
1651
|
this.flags = e, this.var = [], this.lexical = [], this.functions = [];
|
|
@@ -1657,13 +1657,13 @@ St.exitScope = function() {
|
|
|
1657
1657
|
this.scopeStack.pop();
|
|
1658
1658
|
};
|
|
1659
1659
|
St.treatFunctionsAsVarInScope = function(t) {
|
|
1660
|
-
return t.flags &
|
|
1660
|
+
return t.flags & Et || !this.inModule && t.flags & Vt;
|
|
1661
1661
|
};
|
|
1662
1662
|
St.declareName = function(t, e, r) {
|
|
1663
1663
|
var a = !1;
|
|
1664
1664
|
if (e === xt) {
|
|
1665
1665
|
var u = this.currentScope();
|
|
1666
|
-
a = u.lexical.indexOf(t) > -1 || u.functions.indexOf(t) > -1 || u.var.indexOf(t) > -1, u.lexical.push(t), this.inModule && u.flags &
|
|
1666
|
+
a = u.lexical.indexOf(t) > -1 || u.functions.indexOf(t) > -1 || u.var.indexOf(t) > -1, u.lexical.push(t), this.inModule && u.flags & Vt && delete this.undefinedExports[t];
|
|
1667
1667
|
} else if (e === $e) {
|
|
1668
1668
|
var f = this.currentScope();
|
|
1669
1669
|
f.lexical.push(t);
|
|
@@ -1671,13 +1671,13 @@ St.declareName = function(t, e, r) {
|
|
|
1671
1671
|
var d = this.currentScope();
|
|
1672
1672
|
this.treatFunctionsAsVar ? a = d.lexical.indexOf(t) > -1 : a = d.lexical.indexOf(t) > -1 || d.var.indexOf(t) > -1, d.functions.push(t);
|
|
1673
1673
|
} else
|
|
1674
|
-
for (var
|
|
1675
|
-
var
|
|
1676
|
-
if (
|
|
1674
|
+
for (var g = this.scopeStack.length - 1; g >= 0; --g) {
|
|
1675
|
+
var v = this.scopeStack[g];
|
|
1676
|
+
if (v.lexical.indexOf(t) > -1 && !(v.flags & ze && v.lexical[0] === t) || !this.treatFunctionsAsVarInScope(v) && v.functions.indexOf(t) > -1) {
|
|
1677
1677
|
a = !0;
|
|
1678
1678
|
break;
|
|
1679
1679
|
}
|
|
1680
|
-
if (
|
|
1680
|
+
if (v.var.push(t), this.inModule && v.flags & Vt && delete this.undefinedExports[t], v.flags & Zt)
|
|
1681
1681
|
break;
|
|
1682
1682
|
}
|
|
1683
1683
|
a && this.raiseRecoverable(r, "Identifier '" + t + "' has already been declared");
|
|
@@ -1691,37 +1691,37 @@ St.currentScope = function() {
|
|
|
1691
1691
|
St.currentVarScope = function() {
|
|
1692
1692
|
for (var t = this.scopeStack.length - 1; ; t--) {
|
|
1693
1693
|
var e = this.scopeStack[t];
|
|
1694
|
-
if (e.flags & (
|
|
1694
|
+
if (e.flags & (Zt | Bt | Pt))
|
|
1695
1695
|
return e;
|
|
1696
1696
|
}
|
|
1697
1697
|
};
|
|
1698
1698
|
St.currentThisScope = function() {
|
|
1699
1699
|
for (var t = this.scopeStack.length - 1; ; t--) {
|
|
1700
1700
|
var e = this.scopeStack[t];
|
|
1701
|
-
if (e.flags & (
|
|
1701
|
+
if (e.flags & (Zt | Bt | Pt) && !(e.flags & ge))
|
|
1702
1702
|
return e;
|
|
1703
1703
|
}
|
|
1704
1704
|
};
|
|
1705
|
-
var
|
|
1706
|
-
this.type = "", this.start = r, this.end = 0, e.options.locations && (this.loc = new
|
|
1707
|
-
},
|
|
1708
|
-
|
|
1709
|
-
return new
|
|
1705
|
+
var jt = function(e, r, a) {
|
|
1706
|
+
this.type = "", this.start = r, this.end = 0, e.options.locations && (this.loc = new Ft(e, a)), e.options.directSourceFile && (this.sourceFile = e.options.directSourceFile), e.options.ranges && (this.range = [r, 0]);
|
|
1707
|
+
}, Ut = K.prototype;
|
|
1708
|
+
Ut.startNode = function() {
|
|
1709
|
+
return new jt(this, this.start, this.startLoc);
|
|
1710
1710
|
};
|
|
1711
|
-
|
|
1712
|
-
return new
|
|
1711
|
+
Ut.startNodeAt = function(t, e) {
|
|
1712
|
+
return new jt(this, t, e);
|
|
1713
1713
|
};
|
|
1714
1714
|
function Ze(t, e, r, a) {
|
|
1715
1715
|
return t.type = e, t.end = r, this.options.locations && (t.loc.end = a), this.options.ranges && (t.range[1] = r), t;
|
|
1716
1716
|
}
|
|
1717
|
-
|
|
1717
|
+
Ut.finishNode = function(t, e) {
|
|
1718
1718
|
return Ze.call(this, t, e, this.lastTokEnd, this.lastTokEndLoc);
|
|
1719
1719
|
};
|
|
1720
|
-
|
|
1720
|
+
Ut.finishNodeAt = function(t, e, r, a) {
|
|
1721
1721
|
return Ze.call(this, t, e, r, a);
|
|
1722
1722
|
};
|
|
1723
|
-
|
|
1724
|
-
var e = new
|
|
1723
|
+
Ut.copyNode = function(t) {
|
|
1724
|
+
var e = new jt(this, t.start, this.startLoc);
|
|
1725
1725
|
for (var r in t)
|
|
1726
1726
|
e[r] = t[r];
|
|
1727
1727
|
return e;
|
|
@@ -1763,18 +1763,18 @@ for (var ue = 0, Le = [9, 10, 11, 12, 13, 14]; ue < Le.length; ue += 1) {
|
|
|
1763
1763
|
var is = Le[ue];
|
|
1764
1764
|
es(is);
|
|
1765
1765
|
}
|
|
1766
|
-
var P = K.prototype,
|
|
1766
|
+
var P = K.prototype, Xt = function(e, r) {
|
|
1767
1767
|
this.parent = e, this.base = r || this;
|
|
1768
1768
|
};
|
|
1769
|
-
|
|
1769
|
+
Xt.prototype.separatedFrom = function(e) {
|
|
1770
1770
|
for (var r = this; r; r = r.parent)
|
|
1771
1771
|
for (var a = e; a; a = a.parent)
|
|
1772
1772
|
if (r.base === a.base && r !== a)
|
|
1773
1773
|
return !0;
|
|
1774
1774
|
return !1;
|
|
1775
1775
|
};
|
|
1776
|
-
|
|
1777
|
-
return new
|
|
1776
|
+
Xt.prototype.sibling = function() {
|
|
1777
|
+
return new Xt(this.parent, this.base);
|
|
1778
1778
|
};
|
|
1779
1779
|
var ft = function(e) {
|
|
1780
1780
|
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 = ci[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;
|
|
@@ -1820,8 +1820,8 @@ ft.prototype.eat = function(e, r) {
|
|
|
1820
1820
|
ft.prototype.eatChars = function(e, r) {
|
|
1821
1821
|
r === void 0 && (r = !1);
|
|
1822
1822
|
for (var a = this.pos, u = 0, f = e; u < f.length; u += 1) {
|
|
1823
|
-
var d = f[u],
|
|
1824
|
-
if (
|
|
1823
|
+
var d = f[u], g = this.at(a, r);
|
|
1824
|
+
if (g === -1 || g !== d)
|
|
1825
1825
|
return !1;
|
|
1826
1826
|
a = this.nextIndex(a, r);
|
|
1827
1827
|
}
|
|
@@ -1860,7 +1860,7 @@ P.regexp_pattern = function(t) {
|
|
|
1860
1860
|
};
|
|
1861
1861
|
P.regexp_disjunction = function(t) {
|
|
1862
1862
|
var e = this.options.ecmaVersion >= 16;
|
|
1863
|
-
for (e && (t.branchID = new
|
|
1863
|
+
for (e && (t.branchID = new Xt(t.branchID, null)), this.regexp_alternative(t); t.eat(
|
|
1864
1864
|
124
|
|
1865
1865
|
/* | */
|
|
1866
1866
|
); )
|
|
@@ -2004,9 +2004,9 @@ P.regexp_eatUncapturingGroup = function(t) {
|
|
|
2004
2004
|
if (a) {
|
|
2005
2005
|
var d = this.regexp_eatModifiers(t);
|
|
2006
2006
|
!r && !d && t.current() === 58 && t.raise("Invalid regular expression modifiers");
|
|
2007
|
-
for (var
|
|
2008
|
-
var
|
|
2009
|
-
(d.indexOf(
|
|
2007
|
+
for (var g = 0; g < d.length; g++) {
|
|
2008
|
+
var v = d.charAt(g);
|
|
2009
|
+
(d.indexOf(v, g + 1) > -1 || r.indexOf(v) > -1) && t.raise("Duplicate regular expression modifiers");
|
|
2010
2010
|
}
|
|
2011
2011
|
}
|
|
2012
2012
|
}
|
|
@@ -2170,7 +2170,7 @@ P.regexp_eatCControlLetter = function(t) {
|
|
|
2170
2170
|
return !1;
|
|
2171
2171
|
};
|
|
2172
2172
|
P.regexp_eatZero = function(t) {
|
|
2173
|
-
return t.current() === 48 && !
|
|
2173
|
+
return t.current() === 48 && !ee(t.lookahead()) ? (t.lastIntValue = 0, t.advance(), !0) : !1;
|
|
2174
2174
|
};
|
|
2175
2175
|
P.regexp_eatControlEscape = function(t) {
|
|
2176
2176
|
var e = t.current();
|
|
@@ -2287,7 +2287,7 @@ P.regexp_eatUnicodePropertyValueExpression = function(t) {
|
|
|
2287
2287
|
return fi;
|
|
2288
2288
|
};
|
|
2289
2289
|
P.regexp_validateUnicodePropertyNameAndValue = function(t, e, r) {
|
|
2290
|
-
|
|
2290
|
+
wt(t.unicodeProperties.nonBinary, e) || t.raise("Invalid property name"), t.unicodeProperties.nonBinary[e].test(r) || t.raise("Invalid property value");
|
|
2291
2291
|
};
|
|
2292
2292
|
P.regexp_validateUnicodePropertyNameOrValue = function(t, e) {
|
|
2293
2293
|
if (t.unicodeProperties.binary.test(e))
|
|
@@ -2312,7 +2312,7 @@ P.regexp_eatUnicodePropertyValue = function(t) {
|
|
|
2312
2312
|
return t.lastStringValue !== "";
|
|
2313
2313
|
};
|
|
2314
2314
|
function us(t) {
|
|
2315
|
-
return di(t) ||
|
|
2315
|
+
return di(t) || ee(t);
|
|
2316
2316
|
}
|
|
2317
2317
|
P.regexp_eatLoneUnicodePropertyNameOrValue = function(t) {
|
|
2318
2318
|
return this.regexp_eatUnicodePropertyValue(t);
|
|
@@ -2528,7 +2528,7 @@ function ls(t) {
|
|
|
2528
2528
|
}
|
|
2529
2529
|
P.regexp_eatClassControlLetter = function(t) {
|
|
2530
2530
|
var e = t.current();
|
|
2531
|
-
return
|
|
2531
|
+
return ee(e) || e === 95 ? (t.lastIntValue = e % 32, t.advance(), !0) : !1;
|
|
2532
2532
|
};
|
|
2533
2533
|
P.regexp_eatHexEscapeSequence = function(t) {
|
|
2534
2534
|
var e = t.pos;
|
|
@@ -2544,11 +2544,11 @@ P.regexp_eatHexEscapeSequence = function(t) {
|
|
|
2544
2544
|
};
|
|
2545
2545
|
P.regexp_eatDecimalDigits = function(t) {
|
|
2546
2546
|
var e = t.pos, r = 0;
|
|
2547
|
-
for (t.lastIntValue = 0;
|
|
2547
|
+
for (t.lastIntValue = 0; ee(r = t.current()); )
|
|
2548
2548
|
t.lastIntValue = 10 * t.lastIntValue + (r - 48), t.advance();
|
|
2549
2549
|
return t.pos !== e;
|
|
2550
2550
|
};
|
|
2551
|
-
function
|
|
2551
|
+
function ee(t) {
|
|
2552
2552
|
return t >= 48 && t <= 57;
|
|
2553
2553
|
}
|
|
2554
2554
|
P.regexp_eatHexDigits = function(t) {
|
|
@@ -2593,14 +2593,14 @@ P.regexp_eatFixedHexDigits = function(t, e) {
|
|
|
2593
2593
|
}
|
|
2594
2594
|
return !0;
|
|
2595
2595
|
};
|
|
2596
|
-
var
|
|
2597
|
-
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new
|
|
2596
|
+
var ie = function(e) {
|
|
2597
|
+
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new Ft(e, e.startLoc, e.endLoc)), e.options.ranges && (this.range = [e.start, e.end]);
|
|
2598
2598
|
}, D = K.prototype;
|
|
2599
2599
|
D.next = function(t) {
|
|
2600
|
-
!t && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new
|
|
2600
|
+
!t && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new ie(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
2601
2601
|
};
|
|
2602
2602
|
D.getToken = function() {
|
|
2603
|
-
return this.next(), new
|
|
2603
|
+
return this.next(), new ie(this);
|
|
2604
2604
|
};
|
|
2605
2605
|
typeof Symbol < "u" && (D[Symbol.iterator] = function() {
|
|
2606
2606
|
var t = this;
|
|
@@ -2731,7 +2731,7 @@ D.readToken_caret = function() {
|
|
|
2731
2731
|
};
|
|
2732
2732
|
D.readToken_plus_min = function(t) {
|
|
2733
2733
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
2734
|
-
return e === t ? e === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 ||
|
|
2734
|
+
return e === t ? e === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || Z.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(h.incDec, 2) : e === 61 ? this.finishOp(h.assign, 2) : this.finishOp(h.plusMin, 1);
|
|
2735
2735
|
};
|
|
2736
2736
|
D.readToken_lt_gt = function(t) {
|
|
2737
2737
|
var e = this.input.charCodeAt(this.pos + 1), r = 1;
|
|
@@ -2862,7 +2862,7 @@ D.readRegexp = function() {
|
|
|
2862
2862
|
for (var t, e, r = this.pos; ; ) {
|
|
2863
2863
|
this.pos >= this.input.length && this.raise(r, "Unterminated regular expression");
|
|
2864
2864
|
var a = this.input.charAt(this.pos);
|
|
2865
|
-
if (
|
|
2865
|
+
if (Z.test(a) && this.raise(r, "Unterminated regular expression"), t)
|
|
2866
2866
|
t = !1;
|
|
2867
2867
|
else {
|
|
2868
2868
|
if (a === "[")
|
|
@@ -2879,27 +2879,27 @@ D.readRegexp = function() {
|
|
|
2879
2879
|
++this.pos;
|
|
2880
2880
|
var f = this.pos, d = this.readWord1();
|
|
2881
2881
|
this.containsEsc && this.unexpected(f);
|
|
2882
|
-
var
|
|
2883
|
-
|
|
2884
|
-
var
|
|
2882
|
+
var g = this.regexpState || (this.regexpState = new ft(this));
|
|
2883
|
+
g.reset(r, u, d), this.validateRegExpFlags(g), this.validateRegExpPattern(g);
|
|
2884
|
+
var v = null;
|
|
2885
2885
|
try {
|
|
2886
|
-
|
|
2886
|
+
v = new RegExp(u, d);
|
|
2887
2887
|
} catch {
|
|
2888
2888
|
}
|
|
2889
|
-
return this.finishToken(h.regexp, { pattern: u, flags: d, value:
|
|
2889
|
+
return this.finishToken(h.regexp, { pattern: u, flags: d, value: v });
|
|
2890
2890
|
};
|
|
2891
2891
|
D.readInt = function(t, e, r) {
|
|
2892
|
-
for (var a = this.options.ecmaVersion >= 12 && e === void 0, u = r && this.input.charCodeAt(this.pos) === 48, f = this.pos, d = 0,
|
|
2893
|
-
var
|
|
2894
|
-
if (a &&
|
|
2895
|
-
u && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"),
|
|
2892
|
+
for (var a = this.options.ecmaVersion >= 12 && e === void 0, u = r && this.input.charCodeAt(this.pos) === 48, f = this.pos, d = 0, g = 0, v = 0, o = e ?? 1 / 0; v < o; ++v, ++this.pos) {
|
|
2893
|
+
var C = this.input.charCodeAt(this.pos), _ = void 0;
|
|
2894
|
+
if (a && C === 95) {
|
|
2895
|
+
u && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"), g === 95 && this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"), v === 0 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"), g = C;
|
|
2896
2896
|
continue;
|
|
2897
2897
|
}
|
|
2898
|
-
if (
|
|
2898
|
+
if (C >= 97 ? _ = C - 97 + 10 : C >= 65 ? _ = C - 65 + 10 : C >= 48 && C <= 57 ? _ = C - 48 : _ = 1 / 0, _ >= t)
|
|
2899
2899
|
break;
|
|
2900
|
-
|
|
2900
|
+
g = C, d = d * t + _;
|
|
2901
2901
|
}
|
|
2902
|
-
return a &&
|
|
2902
|
+
return a && g === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === f || e != null && this.pos - f !== e ? null : d;
|
|
2903
2903
|
};
|
|
2904
2904
|
function fs(t, e) {
|
|
2905
2905
|
return e ? parseInt(t, 8) : parseFloat(t.replace(/_/g, ""));
|
|
@@ -3095,27 +3095,27 @@ D.readWord1 = function() {
|
|
|
3095
3095
|
};
|
|
3096
3096
|
D.readWord = function() {
|
|
3097
3097
|
var t = this.readWord1(), e = h.name;
|
|
3098
|
-
return this.keywords.test(t) && (e =
|
|
3098
|
+
return this.keywords.test(t) && (e = kt[t]), this.finishToken(e, t);
|
|
3099
3099
|
};
|
|
3100
3100
|
var bi = "8.15.0";
|
|
3101
3101
|
K.acorn = {
|
|
3102
3102
|
Parser: K,
|
|
3103
3103
|
version: bi,
|
|
3104
|
-
defaultOptions:
|
|
3105
|
-
Position:
|
|
3106
|
-
SourceLocation:
|
|
3104
|
+
defaultOptions: zt,
|
|
3105
|
+
Position: At,
|
|
3106
|
+
SourceLocation: Ft,
|
|
3107
3107
|
getLineInfo: xe,
|
|
3108
|
-
Node:
|
|
3108
|
+
Node: jt,
|
|
3109
3109
|
TokenType: O,
|
|
3110
3110
|
tokTypes: h,
|
|
3111
|
-
keywordTypes:
|
|
3112
|
-
TokContext:
|
|
3113
|
-
tokContexts:
|
|
3111
|
+
keywordTypes: kt,
|
|
3112
|
+
TokContext: Y,
|
|
3113
|
+
tokContexts: j,
|
|
3114
3114
|
isIdentifierChar: dt,
|
|
3115
3115
|
isIdentifierStart: pt,
|
|
3116
|
-
Token:
|
|
3116
|
+
Token: ie,
|
|
3117
3117
|
isNewLine: Tt,
|
|
3118
|
-
lineBreak:
|
|
3118
|
+
lineBreak: Z,
|
|
3119
3119
|
lineBreakG: qe,
|
|
3120
3120
|
nonASCIIwhitespace: ye
|
|
3121
3121
|
};
|
|
@@ -3130,25 +3130,25 @@ function ys(t, e) {
|
|
|
3130
3130
|
}
|
|
3131
3131
|
const xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3132
3132
|
__proto__: null,
|
|
3133
|
-
Node:
|
|
3133
|
+
Node: jt,
|
|
3134
3134
|
Parser: K,
|
|
3135
|
-
Position:
|
|
3136
|
-
SourceLocation:
|
|
3137
|
-
TokContext:
|
|
3138
|
-
Token:
|
|
3135
|
+
Position: At,
|
|
3136
|
+
SourceLocation: Ft,
|
|
3137
|
+
TokContext: Y,
|
|
3138
|
+
Token: ie,
|
|
3139
3139
|
TokenType: O,
|
|
3140
|
-
defaultOptions:
|
|
3140
|
+
defaultOptions: zt,
|
|
3141
3141
|
getLineInfo: xe,
|
|
3142
3142
|
isIdentifierChar: dt,
|
|
3143
3143
|
isIdentifierStart: pt,
|
|
3144
3144
|
isNewLine: Tt,
|
|
3145
|
-
keywordTypes:
|
|
3146
|
-
lineBreak:
|
|
3145
|
+
keywordTypes: kt,
|
|
3146
|
+
lineBreak: Z,
|
|
3147
3147
|
lineBreakG: qe,
|
|
3148
3148
|
nonASCIIwhitespace: ye,
|
|
3149
3149
|
parse: ds,
|
|
3150
3150
|
parseExpressionAt: ms,
|
|
3151
|
-
tokContexts:
|
|
3151
|
+
tokContexts: j,
|
|
3152
3152
|
tokTypes: h,
|
|
3153
3153
|
tokenizer: ys,
|
|
3154
3154
|
version: bi
|
|
@@ -3158,10 +3158,10 @@ function Oe(t, e) {
|
|
|
3158
3158
|
var a = e[r];
|
|
3159
3159
|
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(t, typeof (u = (function(f, d) {
|
|
3160
3160
|
if (typeof f != "object" || f === null) return f;
|
|
3161
|
-
var
|
|
3162
|
-
if (
|
|
3163
|
-
var
|
|
3164
|
-
if (typeof
|
|
3161
|
+
var g = f[Symbol.toPrimitive];
|
|
3162
|
+
if (g !== void 0) {
|
|
3163
|
+
var v = g.call(f, "string");
|
|
3164
|
+
if (typeof v != "object") return v;
|
|
3165
3165
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3166
3166
|
}
|
|
3167
3167
|
return String(f);
|
|
@@ -3169,14 +3169,14 @@ function Oe(t, e) {
|
|
|
3169
3169
|
}
|
|
3170
3170
|
var u;
|
|
3171
3171
|
}
|
|
3172
|
-
function
|
|
3173
|
-
return
|
|
3172
|
+
function Qt() {
|
|
3173
|
+
return Qt = Object.assign ? Object.assign.bind() : function(t) {
|
|
3174
3174
|
for (var e = 1; e < arguments.length; e++) {
|
|
3175
3175
|
var r = arguments[e];
|
|
3176
3176
|
for (var a in r) Object.prototype.hasOwnProperty.call(r, a) && (t[a] = r[a]);
|
|
3177
3177
|
}
|
|
3178
3178
|
return t;
|
|
3179
|
-
},
|
|
3179
|
+
}, Qt.apply(this, arguments);
|
|
3180
3180
|
}
|
|
3181
3181
|
function Kt(t, e) {
|
|
3182
3182
|
t.prototype = Object.create(e.prototype), t.prototype.constructor = t, me(t, e);
|
|
@@ -3218,16 +3218,16 @@ var vs = /* @__PURE__ */ new WeakMap();
|
|
|
3218
3218
|
function gs(t) {
|
|
3219
3219
|
var e = vs.get(t.Parser.acorn || t);
|
|
3220
3220
|
if (!e) {
|
|
3221
|
-
var r = { assert: nt(0, { startsExpr: at }), asserts: nt(0, { startsExpr: at }), global: nt(0, { startsExpr: at }), keyof: nt(0, { startsExpr: at }), readonly: nt(0, { startsExpr: at }), unique: nt(0, { startsExpr: at }), abstract: nt(0, { startsExpr: at }), declare: nt(0, { startsExpr: at }), enum: nt(0, { startsExpr: at }), module: nt(0, { startsExpr: at }), namespace: nt(0, { startsExpr: at }), interface: nt(0, { startsExpr: at }), type: nt(0, { startsExpr: at }) }, a = { at: new O("@"), jsxName: new O("jsxName"), jsxText: new O("jsxText", { beforeExpr: !0 }), jsxTagStart: new O("jsxTagStart", { startsExpr: !0 }), jsxTagEnd: new O("jsxTagEnd") }, u = { tc_oTag: new
|
|
3221
|
+
var r = { assert: nt(0, { startsExpr: at }), asserts: nt(0, { startsExpr: at }), global: nt(0, { startsExpr: at }), keyof: nt(0, { startsExpr: at }), readonly: nt(0, { startsExpr: at }), unique: nt(0, { startsExpr: at }), abstract: nt(0, { startsExpr: at }), declare: nt(0, { startsExpr: at }), enum: nt(0, { startsExpr: at }), module: nt(0, { startsExpr: at }), namespace: nt(0, { startsExpr: at }), interface: nt(0, { startsExpr: at }), type: nt(0, { startsExpr: at }) }, a = { at: new O("@"), jsxName: new O("jsxName"), jsxText: new O("jsxText", { beforeExpr: !0 }), jsxTagStart: new O("jsxTagStart", { startsExpr: !0 }), jsxTagEnd: new O("jsxTagEnd") }, u = { tc_oTag: new Y("<tag", !1, !1), tc_cTag: new Y("</tag", !1, !1), tc_expr: new Y("<tag>...</tag>", !0, !0) }, f = new RegExp("^(?:" + Object.keys(r).join("|") + ")$");
|
|
3222
3222
|
a.jsxTagStart.updateContext = function() {
|
|
3223
3223
|
this.context.push(u.tc_expr), this.context.push(u.tc_oTag), this.exprAllowed = !1;
|
|
3224
3224
|
}, a.jsxTagEnd.updateContext = function(d) {
|
|
3225
|
-
var
|
|
3226
|
-
|
|
3227
|
-
}, e = { tokTypes:
|
|
3228
|
-
return [h.name, h.string, h.num].concat(Object.values(
|
|
3225
|
+
var g = this.context.pop();
|
|
3226
|
+
g === u.tc_oTag && d === h.slash || g === u.tc_cTag ? (this.context.pop(), this.exprAllowed = this.curContext() === u.tc_expr) : this.exprAllowed = !0;
|
|
3227
|
+
}, e = { tokTypes: Qt({}, r, a), tokContexts: Qt({}, u), keywordsRegExp: f, tokenIsLiteralPropertyName: function(d) {
|
|
3228
|
+
return [h.name, h.string, h.num].concat(Object.values(kt), Object.values(r)).includes(d);
|
|
3229
3229
|
}, tokenIsKeywordOrIdentifier: function(d) {
|
|
3230
|
-
return [h.name].concat(Object.values(
|
|
3230
|
+
return [h.name].concat(Object.values(kt), Object.values(r)).includes(d);
|
|
3231
3231
|
}, tokenIsIdentifier: function(d) {
|
|
3232
3232
|
return [].concat(Object.values(r), [h.name]).includes(d);
|
|
3233
3233
|
}, tokenIsTSDeclarationStart: function(d) {
|
|
@@ -3240,7 +3240,7 @@ function gs(t) {
|
|
|
3240
3240
|
}
|
|
3241
3241
|
return e;
|
|
3242
3242
|
}
|
|
3243
|
-
var
|
|
3243
|
+
var Lt = 1024, bs = new RegExp("(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*", "y"), De = new RegExp("(?=(" + bs.source + "))\\1" + /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y"), Ot = function() {
|
|
3244
3244
|
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;
|
|
3245
3245
|
};
|
|
3246
3246
|
function Ss(t, e) {
|
|
@@ -3251,7 +3251,7 @@ function Ve(t, e) {
|
|
|
3251
3251
|
var r = t.key;
|
|
3252
3252
|
return !t.computed && (r.type === "Identifier" && r.name === e || r.type === "Literal" && r.value === e);
|
|
3253
3253
|
}
|
|
3254
|
-
var
|
|
3254
|
+
var w = { AbstractMethodHasImplementation: function(t) {
|
|
3255
3255
|
return "Method '" + t.methodName + "' cannot have an implementation because it is marked abstract.";
|
|
3256
3256
|
}, AbstractPropertyHasInitializer: function(t) {
|
|
3257
3257
|
return "Property '" + t.propertyName + "' cannot have an initializer because it is marked abstract.";
|
|
@@ -3289,8 +3289,8 @@ var A = { AbstractMethodHasImplementation: function(t) {
|
|
|
3289
3289
|
}, 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) {
|
|
3290
3290
|
return "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got " + t.type + ".";
|
|
3291
3291
|
}, LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Ts = { 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: "âĻ" }, Ps = /^[\da-fA-F]+$/, Cs = /^\d+$/;
|
|
3292
|
-
function
|
|
3293
|
-
return t && (t.type === "JSXIdentifier" ? t.name : t.type === "JSXNamespacedName" ? t.namespace.name + ":" + t.name.name : t.type === "JSXMemberExpression" ?
|
|
3292
|
+
function Mt(t) {
|
|
3293
|
+
return t && (t.type === "JSXIdentifier" ? t.name : t.type === "JSXNamespacedName" ? t.namespace.name + ":" + t.name.name : t.type === "JSXMemberExpression" ? Mt(t.object) + "." + Mt(t.property) : void 0);
|
|
3294
3294
|
}
|
|
3295
3295
|
var ce = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
3296
3296
|
function Fe(t) {
|
|
@@ -3319,17 +3319,17 @@ function Be(t) {
|
|
|
3319
3319
|
function Es(t) {
|
|
3320
3320
|
var e = {}, r = e.dts, a = r !== void 0 && r, u = e.allowSatisfies, f = u !== void 0 && u;
|
|
3321
3321
|
return function(d) {
|
|
3322
|
-
var
|
|
3323
|
-
function Ai(T, it,
|
|
3324
|
-
|
|
3325
|
-
for (var
|
|
3326
|
-
var F = T.charCodeAt(
|
|
3327
|
-
if (
|
|
3322
|
+
var g = d.acorn || xs, v = gs(g), o = g.tokTypes, C = g.keywordTypes, _ = g.isIdentifierStart, M = g.lineBreak, q = g.isNewLine, z = g.tokContexts, $ = g.isIdentifierChar, I = v.tokTypes, et = v.tokContexts, se = v.keywordsRegExp, Ti = v.tokenIsLiteralPropertyName, Pi = v.tokenIsTemplate, Ci = v.tokenIsTSDeclarationStart, B = v.tokenIsIdentifier, qt = v.tokenIsKeywordOrIdentifier, ki = v.tokenIsTSTypeOperator;
|
|
3323
|
+
function Ai(T, it, Q) {
|
|
3324
|
+
Q === void 0 && (Q = T.length);
|
|
3325
|
+
for (var J = it; J < Q; J++) {
|
|
3326
|
+
var F = T.charCodeAt(J);
|
|
3327
|
+
if (q(F)) return J < Q - 1 && F === 13 && T.charCodeAt(J + 1) === 10 ? J + 2 : J + 1;
|
|
3328
3328
|
}
|
|
3329
3329
|
return -1;
|
|
3330
3330
|
}
|
|
3331
|
-
d = (function(T, it,
|
|
3332
|
-
var
|
|
3331
|
+
d = (function(T, it, Q) {
|
|
3332
|
+
var J = Q.tokTypes, F = it.tokTypes;
|
|
3333
3333
|
return (function(p) {
|
|
3334
3334
|
function i() {
|
|
3335
3335
|
return p.apply(this, arguments) || this;
|
|
@@ -3344,31 +3344,31 @@ function Es(t) {
|
|
|
3344
3344
|
var l = this.parseDecorator();
|
|
3345
3345
|
c.push(l);
|
|
3346
3346
|
}
|
|
3347
|
-
this.match(
|
|
3347
|
+
this.match(J._export) ? n || this.unexpected() : this.canHaveLeadingDecorator() || this.raise(this.start, "Leading decorators must be attached to a class declaration.");
|
|
3348
3348
|
}, s.parseDecorator = function() {
|
|
3349
3349
|
var n = this.startNode();
|
|
3350
3350
|
this.next(), this.decoratorStack.push([]);
|
|
3351
3351
|
var c, l = this.start, m = this.startLoc;
|
|
3352
|
-
if (this.match(
|
|
3352
|
+
if (this.match(J.parenL)) {
|
|
3353
3353
|
var y = this.start, x = this.startLoc;
|
|
3354
|
-
if (this.next(), c = this.parseExpression(), this.expect(
|
|
3354
|
+
if (this.next(), c = this.parseExpression(), this.expect(J.parenR), this.options.preserveParens) {
|
|
3355
3355
|
var b = this.startNodeAt(y, x);
|
|
3356
3356
|
b.expression = c, c = this.finishNode(b, "ParenthesizedExpression");
|
|
3357
3357
|
}
|
|
3358
|
-
} else for (c = this.parseIdent(!1); this.eat(
|
|
3358
|
+
} else for (c = this.parseIdent(!1); this.eat(J.dot); ) {
|
|
3359
3359
|
var S = this.startNodeAt(l, m);
|
|
3360
3360
|
S.object = c, S.property = this.parseIdent(!0), S.computed = !1, c = this.finishNode(S, "MemberExpression");
|
|
3361
3361
|
}
|
|
3362
3362
|
return n.expression = this.parseMaybeDecoratorArguments(c), this.decoratorStack.pop(), this.finishNode(n, "Decorator");
|
|
3363
3363
|
}, s.parseMaybeDecoratorArguments = function(n) {
|
|
3364
|
-
if (this.eat(
|
|
3364
|
+
if (this.eat(J.parenL)) {
|
|
3365
3365
|
var c = this.startNodeAtNode(n);
|
|
3366
|
-
return c.callee = n, c.arguments = this.parseExprList(
|
|
3366
|
+
return c.callee = n, c.arguments = this.parseExprList(J.parenR, !1), this.finishNode(c, "CallExpression");
|
|
3367
3367
|
}
|
|
3368
3368
|
return n;
|
|
3369
3369
|
}, i;
|
|
3370
3370
|
})(T);
|
|
3371
|
-
})(d,
|
|
3371
|
+
})(d, v, g), d = (function(T, it, Q, J) {
|
|
3372
3372
|
var F = T.tokTypes, p = it.tokTypes, i = T.isNewLine, s = T.isIdentifierChar, n = Object.assign({ allowNamespaces: !0, allowNamespacedObjects: !0 }, {});
|
|
3373
3373
|
return (function(c) {
|
|
3374
3374
|
function l() {
|
|
@@ -3489,10 +3489,10 @@ function Es(t) {
|
|
|
3489
3489
|
default:
|
|
3490
3490
|
this.unexpected();
|
|
3491
3491
|
}
|
|
3492
|
-
|
|
3492
|
+
Mt(L.name) !== Mt(E.name) && this.raise(L.start, "Expected corresponding JSX closing tag for <" + Mt(E.name) + ">");
|
|
3493
3493
|
}
|
|
3494
|
-
var
|
|
3495
|
-
return b["opening" +
|
|
3494
|
+
var k = E.name ? "Element" : "Fragment";
|
|
3495
|
+
return b["opening" + k] = E, b["closing" + k] = L, b.children = S, this.type === F.relational && this.value === "<" && this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag"), this.finishNode(b, "JSX" + k);
|
|
3496
3496
|
}, m.jsx_parseText = function() {
|
|
3497
3497
|
var y = this.parseLiteral(this.value);
|
|
3498
3498
|
return y.type = "JSXText", y;
|
|
@@ -3500,9 +3500,9 @@ function Es(t) {
|
|
|
3500
3500
|
var y = this.start, x = this.startLoc;
|
|
3501
3501
|
return this.next(), this.jsx_parseElementAt(y, x);
|
|
3502
3502
|
}, l;
|
|
3503
|
-
})(
|
|
3504
|
-
})(
|
|
3505
|
-
var
|
|
3503
|
+
})(Q);
|
|
3504
|
+
})(g, v, d), d = (function(T, it, Q) {
|
|
3505
|
+
var J = it.tokTypes, F = Q.tokTypes;
|
|
3506
3506
|
return (function(p) {
|
|
3507
3507
|
function i() {
|
|
3508
3508
|
return p.apply(this, arguments) || this;
|
|
@@ -3510,7 +3510,7 @@ function Es(t) {
|
|
|
3510
3510
|
Kt(i, p);
|
|
3511
3511
|
var s = i.prototype;
|
|
3512
3512
|
return s.parseMaybeImportAttributes = function(n) {
|
|
3513
|
-
if (this.type === F._with || this.type ===
|
|
3513
|
+
if (this.type === F._with || this.type === J.assert) {
|
|
3514
3514
|
this.next();
|
|
3515
3515
|
var c = this.parseImportAttributes();
|
|
3516
3516
|
c && (n.attributes = c);
|
|
@@ -3529,27 +3529,27 @@ function Es(t) {
|
|
|
3529
3529
|
return n;
|
|
3530
3530
|
}, i;
|
|
3531
3531
|
})(T);
|
|
3532
|
-
})(d,
|
|
3532
|
+
})(d, v, g);
|
|
3533
3533
|
var wi = /* @__PURE__ */ (function(T) {
|
|
3534
3534
|
function it(i, s, n) {
|
|
3535
3535
|
var c;
|
|
3536
3536
|
return (c = T.call(this, i, s, n) || this).preValue = null, c.preToken = null, c.isLookahead = !1, c.isAmbientContext = !1, c.inAbstractClass = !1, c.inType = !1, c.inDisallowConditionalTypesContext = !1, c.maybeInArrowParameters = !1, c.shouldParseArrowReturnType = void 0, c.shouldParseAsyncArrowReturnType = void 0, c.decoratorStack = [[]], c.importsStack = [[]], c.importOrExportOuterKind = void 0, c.tsParseConstModifier = c.tsParseModifiers.bind((function(l) {
|
|
3537
3537
|
if (l === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
3538
3538
|
return l;
|
|
3539
|
-
})(c), { allowedModifiers: ["const"], disallowedModifiers: ["in", "out"], errorTemplate:
|
|
3539
|
+
})(c), { allowedModifiers: ["const"], disallowedModifiers: ["in", "out"], errorTemplate: w.InvalidModifierOnTypeParameterPositions }), c;
|
|
3540
3540
|
}
|
|
3541
3541
|
Kt(it, T);
|
|
3542
|
-
var
|
|
3542
|
+
var Q, J, F, p = it.prototype;
|
|
3543
3543
|
return p.getTokenFromCodeInType = function(i) {
|
|
3544
3544
|
return i === 62 || i === 60 ? this.finishOp(o.relational, 1) : T.prototype.getTokenFromCode.call(this, i);
|
|
3545
3545
|
}, p.readToken = function(i) {
|
|
3546
3546
|
if (!this.inType) {
|
|
3547
3547
|
var s = this.curContext();
|
|
3548
|
-
if (s ===
|
|
3549
|
-
if (s ===
|
|
3550
|
-
if (
|
|
3548
|
+
if (s === et.tc_expr) return this.jsx_readToken();
|
|
3549
|
+
if (s === et.tc_oTag || s === et.tc_cTag) {
|
|
3550
|
+
if (_(i)) return this.jsx_readWord();
|
|
3551
3551
|
if (i == 62) return ++this.pos, this.finishToken(I.jsxTagEnd);
|
|
3552
|
-
if ((i === 34 || i === 39) && s ==
|
|
3552
|
+
if ((i === 34 || i === 39) && s == et.tc_oTag) return this.jsx_readString(i);
|
|
3553
3553
|
}
|
|
3554
3554
|
if (i === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) return ++this.pos, this.finishToken(I.jsxTagStart);
|
|
3555
3555
|
}
|
|
@@ -3596,12 +3596,12 @@ function Es(t) {
|
|
|
3596
3596
|
}, p.tsCheckForInvalidTypeCasts = function(i) {
|
|
3597
3597
|
var s = this;
|
|
3598
3598
|
i.forEach(function(n) {
|
|
3599
|
-
n?.type === "TSTypeCastExpression" && s.raise(n.typeAnnotation.start,
|
|
3599
|
+
n?.type === "TSTypeCastExpression" && s.raise(n.typeAnnotation.start, w.UnexpectedTypeAnnotation);
|
|
3600
3600
|
});
|
|
3601
3601
|
}, p.atPossibleAsyncArrow = function(i) {
|
|
3602
3602
|
return i.type === "Identifier" && i.name === "async" && this.lastTokEndLoc.column === i.end && !this.canInsertSemicolon() && i.end - i.start == 5 && i.start === this.potentialArrowAt;
|
|
3603
3603
|
}, p.tsIsIdentifier = function() {
|
|
3604
|
-
return
|
|
3604
|
+
return B(this.type);
|
|
3605
3605
|
}, p.tsTryParseTypeOrTypePredicateAnnotation = function() {
|
|
3606
3606
|
return this.match(o.colon) ? this.tsParseTypeOrTypePredicateAnnotation(o.colon) : void 0;
|
|
3607
3607
|
}, p.tsTryParseGenericAsyncArrowFunction = function(i, s, n) {
|
|
@@ -3631,7 +3631,7 @@ function Es(t) {
|
|
|
3631
3631
|
var n = i + s.length;
|
|
3632
3632
|
if (this.input.slice(i, n) === s) {
|
|
3633
3633
|
var c = this.input.charCodeAt(n);
|
|
3634
|
-
return !(
|
|
3634
|
+
return !($(c) || (64512 & c) == 55296);
|
|
3635
3635
|
}
|
|
3636
3636
|
return !1;
|
|
3637
3637
|
}, p.isAbstractConstructorSignature = function() {
|
|
@@ -3666,7 +3666,7 @@ function Es(t) {
|
|
|
3666
3666
|
return this.setLookaheadState(s), c;
|
|
3667
3667
|
}, p.readWord = function() {
|
|
3668
3668
|
var i = this.readWord1(), s = o.name;
|
|
3669
|
-
return this.keywords.test(i) ? s =
|
|
3669
|
+
return this.keywords.test(i) ? s = C[i] : new RegExp(se).test(i) && (s = I[i]), this.finishToken(s, i);
|
|
3670
3670
|
}, p.skipBlockComment = function() {
|
|
3671
3671
|
var i;
|
|
3672
3672
|
this.isLookahead || (i = this.options.onComment && this.curPosition());
|
|
@@ -3676,7 +3676,7 @@ function Es(t) {
|
|
|
3676
3676
|
}, p.skipLineComment = function(i) {
|
|
3677
3677
|
var s, n = this.pos;
|
|
3678
3678
|
this.isLookahead || (s = this.options.onComment && this.curPosition());
|
|
3679
|
-
for (var c = this.input.charCodeAt(this.pos += i); this.pos < this.input.length && !
|
|
3679
|
+
for (var c = this.input.charCodeAt(this.pos += i); this.pos < this.input.length && !q(c); ) c = this.input.charCodeAt(++this.pos);
|
|
3680
3680
|
this.isLookahead || this.options.onComment && this.options.onComment(!1, this.input.slice(n + i, this.pos), n, this.pos, s, this.curPosition());
|
|
3681
3681
|
}, p.finishToken = function(i, s) {
|
|
3682
3682
|
this.preValue = this.value, this.preToken = this.type, this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
|
|
@@ -3729,7 +3729,7 @@ function Es(t) {
|
|
|
3729
3729
|
}, p.match = function(i) {
|
|
3730
3730
|
return this.type === i;
|
|
3731
3731
|
}, p.matchJsx = function(i) {
|
|
3732
|
-
return this.type ===
|
|
3732
|
+
return this.type === v.tokTypes[i];
|
|
3733
3733
|
}, p.ts_eatWithState = function(i, s, n) {
|
|
3734
3734
|
if (i === n.type) {
|
|
3735
3735
|
for (var c = 0; c < s; c++) this.next();
|
|
@@ -3737,7 +3737,7 @@ function Es(t) {
|
|
|
3737
3737
|
}
|
|
3738
3738
|
return !1;
|
|
3739
3739
|
}, p.ts_eatContextualWithState = function(i, s, n) {
|
|
3740
|
-
if (
|
|
3740
|
+
if (se.test(i)) {
|
|
3741
3741
|
if (this.ts_isContextualWithState(n, I[i])) {
|
|
3742
3742
|
for (var c = 0; c < s; c++) this.next();
|
|
3743
3743
|
return !0;
|
|
@@ -3750,7 +3750,7 @@ function Es(t) {
|
|
|
3750
3750
|
}, p.canHaveLeadingDecorator = function() {
|
|
3751
3751
|
return this.match(o._class);
|
|
3752
3752
|
}, p.eatContextual = function(i) {
|
|
3753
|
-
return
|
|
3753
|
+
return se.test(i) ? !!this.ts_isContextual(I[i]) && (this.next(), !0) : T.prototype.eatContextual.call(this, i);
|
|
3754
3754
|
}, p.tsIsExternalModuleReference = function() {
|
|
3755
3755
|
return this.isContextual("require") && this.lookaheadCharCode() === 40;
|
|
3756
3756
|
}, p.tsParseExternalModuleReference = function() {
|
|
@@ -3776,7 +3776,7 @@ function Es(t) {
|
|
|
3776
3776
|
}
|
|
3777
3777
|
return this.next(), T.prototype.exitScope.call(this), this.finishNode(i, "TSModuleBlock");
|
|
3778
3778
|
}, p.tsParseAmbientExternalModuleDeclaration = function(i) {
|
|
3779
|
-
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) ? (T.prototype.enterScope.call(this,
|
|
3779
|
+
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) ? (T.prototype.enterScope.call(this, Lt), i.body = this.tsParseModuleBlock(), T.prototype.exitScope.call(this)) : T.prototype.semicolon.call(this), this.finishNode(i, "TSModuleDeclaration");
|
|
3780
3780
|
}, p.tsTryParseDeclare = function(i) {
|
|
3781
3781
|
var s = this;
|
|
3782
3782
|
if (!this.isLineTerminator()) {
|
|
@@ -3791,7 +3791,7 @@ function Es(t) {
|
|
|
3791
3791
|
var l = s.tsParseInterfaceDeclaration(i, { declare: !0 });
|
|
3792
3792
|
if (l) return l;
|
|
3793
3793
|
}
|
|
3794
|
-
return
|
|
3794
|
+
return B(c) ? s.tsParseDeclaration(i, s.value, !0) : void 0;
|
|
3795
3795
|
});
|
|
3796
3796
|
}
|
|
3797
3797
|
}, p.tsIsListTerminator = function(i) {
|
|
@@ -3847,7 +3847,7 @@ function Es(t) {
|
|
|
3847
3847
|
return i(), s.tsParseType();
|
|
3848
3848
|
});
|
|
3849
3849
|
}, p.tsSkipParameterStart = function() {
|
|
3850
|
-
if (
|
|
3850
|
+
if (B(this.type) || this.match(o._this)) return this.next(), !0;
|
|
3851
3851
|
if (this.match(o.braceL)) try {
|
|
3852
3852
|
return this.parseObj(!0), !0;
|
|
3853
3853
|
} catch {
|
|
@@ -3877,12 +3877,12 @@ function Es(t) {
|
|
|
3877
3877
|
}, p.tsParseBindingListForSignature = function() {
|
|
3878
3878
|
var i = this;
|
|
3879
3879
|
return T.prototype.parseBindingList.call(this, o.parenR, !0, !0).map(function(s) {
|
|
3880
|
-
return s.type !== "Identifier" && s.type !== "RestElement" && s.type !== "ObjectPattern" && s.type !== "ArrayPattern" && i.raise(s.start,
|
|
3880
|
+
return s.type !== "Identifier" && s.type !== "RestElement" && s.type !== "ObjectPattern" && s.type !== "ArrayPattern" && i.raise(s.start, w.UnsupportedSignatureParameterKind(s.type)), s;
|
|
3881
3881
|
});
|
|
3882
3882
|
}, p.tsParseTypePredicateAsserts = function() {
|
|
3883
3883
|
if (this.type !== I.asserts) return !1;
|
|
3884
3884
|
var i = this.containsEsc;
|
|
3885
|
-
return this.next(), !(!
|
|
3885
|
+
return this.next(), !(!B(this.type) && !this.match(o._this) || (i && this.raise(this.lastTokStart, "Escape sequence in keyword asserts"), 0));
|
|
3886
3886
|
}, p.tsParseThisTypeNode = function() {
|
|
3887
3887
|
var i = this.startNode();
|
|
3888
3888
|
return this.next(), this.finishNode(i, "TSThisType");
|
|
@@ -3923,7 +3923,7 @@ function Es(t) {
|
|
|
3923
3923
|
if (this.lookahead().type !== o._const) return null;
|
|
3924
3924
|
this.next();
|
|
3925
3925
|
var i = this.tsParseTypeReference();
|
|
3926
|
-
return i.typeParameters && this.raise(i.typeName.start,
|
|
3926
|
+
return i.typeParameters && this.raise(i.typeName.start, w.CannotFindName({ name: "const" })), i;
|
|
3927
3927
|
}, p.tsParseFunctionOrConstructorType = function(i, s) {
|
|
3928
3928
|
var n = this, c = this.startNode();
|
|
3929
3929
|
return i === "TSConstructorType" && (c.abstract = !!s, s && this.next(), this.next()), this.tsInAllowConditionalTypesContext(function() {
|
|
@@ -3941,7 +3941,7 @@ function Es(t) {
|
|
|
3941
3941
|
case "TSArrayType":
|
|
3942
3942
|
return;
|
|
3943
3943
|
default:
|
|
3944
|
-
this.raise(i.start,
|
|
3944
|
+
this.raise(i.start, w.UnexpectedReadonly);
|
|
3945
3945
|
}
|
|
3946
3946
|
}, p.tsParseTypeOperator = function() {
|
|
3947
3947
|
var i = this.startNode(), s = this.value;
|
|
@@ -3976,7 +3976,7 @@ function Es(t) {
|
|
|
3976
3976
|
})(), this.finishNode(s, "TSLiteralType");
|
|
3977
3977
|
}, p.tsParseImportType = function() {
|
|
3978
3978
|
var i = this.startNode();
|
|
3979
|
-
return this.expect(o._import), this.expect(o.parenL), this.match(o.string) || this.raise(this.start,
|
|
3979
|
+
return this.expect(o._import), this.expect(o.parenL), this.match(o.string) || this.raise(this.start, w.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");
|
|
3980
3980
|
}, p.tsParseTypeQuery = function() {
|
|
3981
3981
|
var i = this.startNode();
|
|
3982
3982
|
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");
|
|
@@ -3993,7 +3993,7 @@ function Es(t) {
|
|
|
3993
3993
|
var i = this.startLoc, s = this.start, n = this.eat(o.ellipsis), c = this.tsParseType(), l = this.eat(o.question);
|
|
3994
3994
|
if (this.eat(o.colon)) {
|
|
3995
3995
|
var m = this.startNodeAtNode(c);
|
|
3996
|
-
m.optional = l, c.type !== "TSTypeReference" || c.typeParameters || c.typeName.type !== "Identifier" ? (this.raise(c.start,
|
|
3996
|
+
m.optional = l, c.type !== "TSTypeReference" || c.typeParameters || c.typeName.type !== "Identifier" ? (this.raise(c.start, w.InvalidTupleMemberLabel), m.label = c) : m.label = c.typeName, m.elementType = this.tsParseType(), c = this.finishNode(m, "TSNamedTupleMember");
|
|
3997
3997
|
} else if (l) {
|
|
3998
3998
|
var y = this.startNodeAtNode(c);
|
|
3999
3999
|
y.typeAnnotation = c, c = this.finishNode(y, "TSOptionalType");
|
|
@@ -4009,11 +4009,11 @@ function Es(t) {
|
|
|
4009
4009
|
var n = !1, c = null;
|
|
4010
4010
|
return s.elementTypes.forEach(function(l) {
|
|
4011
4011
|
var m = l.type;
|
|
4012
|
-
!n || m === "TSRestType" || m === "TSOptionalType" || m === "TSNamedTupleMember" && l.optional || i.raise(l.start,
|
|
4012
|
+
!n || m === "TSRestType" || m === "TSOptionalType" || m === "TSNamedTupleMember" && l.optional || i.raise(l.start, w.OptionalTypeBeforeRequired), n || (n = m === "TSNamedTupleMember" && l.optional || m === "TSOptionalType");
|
|
4013
4013
|
var y = m;
|
|
4014
4014
|
m === "TSRestType" && (y = (l = l.typeAnnotation).type);
|
|
4015
4015
|
var x = y === "TSNamedTupleMember";
|
|
4016
|
-
c != null || (c = x), c !== x && i.raise(l.start,
|
|
4016
|
+
c != null || (c = x), c !== x && i.raise(l.start, w.MixedLabeledAndUnlabeledElements);
|
|
4017
4017
|
}), this.finishNode(s, "TSTupleType");
|
|
4018
4018
|
}, p.tsParseTemplateLiteralType = function() {
|
|
4019
4019
|
var i = this.startNode();
|
|
@@ -4058,7 +4058,7 @@ function Es(t) {
|
|
|
4058
4058
|
return this.tsParseTemplateLiteralType();
|
|
4059
4059
|
default:
|
|
4060
4060
|
var s = this.type;
|
|
4061
|
-
if (
|
|
4061
|
+
if (B(s) || s === o._void || s === o._null) {
|
|
4062
4062
|
var n = s === o._void ? "TSVoidKeyword" : s === o._null ? "TSNullKeyword" : (function(l) {
|
|
4063
4063
|
switch (l) {
|
|
4064
4064
|
case "any":
|
|
@@ -4127,7 +4127,7 @@ function Es(t) {
|
|
|
4127
4127
|
return i.tsParseType();
|
|
4128
4128
|
}), this.finishNode(n, "TSConditionalType");
|
|
4129
4129
|
}, p.tsIsUnambiguouslyIndexSignature = function() {
|
|
4130
|
-
return this.next(), !!
|
|
4130
|
+
return this.next(), !!B(this.type) && (this.next(), this.match(o.colon));
|
|
4131
4131
|
}, p.tsInType = function(i) {
|
|
4132
4132
|
var s = this.inType;
|
|
4133
4133
|
this.inType = !0;
|
|
@@ -4145,7 +4145,7 @@ function Es(t) {
|
|
|
4145
4145
|
return n && (i.typeAnnotation = n), this.tsParseTypeMemberSemicolon(), this.finishNode(i, "TSIndexSignature");
|
|
4146
4146
|
}
|
|
4147
4147
|
}, p.tsParseNoneModifiers = function(i) {
|
|
4148
|
-
this.tsParseModifiers({ modified: i, allowedModifiers: [], disallowedModifiers: ["in", "out"], errorTemplate:
|
|
4148
|
+
this.tsParseModifiers({ modified: i, allowedModifiers: [], disallowedModifiers: ["in", "out"], errorTemplate: w.InvalidModifierOnTypeParameterPositions });
|
|
4149
4149
|
}, p.tsParseTypeParameter = function(i) {
|
|
4150
4150
|
i === void 0 && (i = this.tsParseNoneModifiers.bind(this));
|
|
4151
4151
|
var s = this.startNode();
|
|
@@ -4154,7 +4154,7 @@ function Es(t) {
|
|
|
4154
4154
|
var s = this.startNode();
|
|
4155
4155
|
this.tsMatchLeftRelational() || this.matchJsx("jsxTagStart") ? this.next() : this.unexpected();
|
|
4156
4156
|
var n = { value: -1 };
|
|
4157
|
-
return s.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, i), !1, !0, n), s.params.length === 0 && this.raise(this.start,
|
|
4157
|
+
return s.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, i), !1, !0, n), s.params.length === 0 && this.raise(this.start, w.EmptyTypeParameters), n.value !== -1 && this.addExtra(s, "trailingComma", n.value), this.finishNode(s, "TSTypeParameterDeclaration");
|
|
4158
4158
|
}, p.tsTryParseTypeParameters = function(i) {
|
|
4159
4159
|
if (this.tsMatchLeftRelational()) return this.tsParseTypeParameters(i);
|
|
4160
4160
|
}, p.tsTryParse = function(i) {
|
|
@@ -4165,7 +4165,7 @@ function Es(t) {
|
|
|
4165
4165
|
}, p.tsNextTokenCanFollowModifier = function() {
|
|
4166
4166
|
return this.next(!0), this.tsTokenCanFollowModifier();
|
|
4167
4167
|
}, p.tsParseModifier = function(i, s) {
|
|
4168
|
-
if (
|
|
4168
|
+
if (B(this.type) || this.type === o._in) {
|
|
4169
4169
|
var n = this.value;
|
|
4170
4170
|
if (i.indexOf(n) !== -1 && !this.containsEsc) {
|
|
4171
4171
|
if (s && this.tsIsStartOfStaticBlocks()) return;
|
|
@@ -4178,31 +4178,31 @@ function Es(t) {
|
|
|
4178
4178
|
s[m] = n[m];
|
|
4179
4179
|
}
|
|
4180
4180
|
}, p.tsParseModifiers = function(i) {
|
|
4181
|
-
for (var s = this, n = i.modified, c = i.allowedModifiers, l = i.disallowedModifiers, m = i.stopOnStartOfClassStaticBlock, y = i.errorTemplate, x = y === void 0 ?
|
|
4182
|
-
|
|
4183
|
-
}, E = function(
|
|
4184
|
-
(n[W] &&
|
|
4181
|
+
for (var s = this, n = i.modified, c = i.allowedModifiers, l = i.disallowedModifiers, m = i.stopOnStartOfClassStaticBlock, y = i.errorTemplate, x = y === void 0 ? w.InvalidModifierOnTypeMember : y, b = {}, S = function(H, U, W, G) {
|
|
4182
|
+
U === W && n[G] && s.raise(H.column, w.InvalidModifiersOrder({ orderedModifiers: [W, G] }));
|
|
4183
|
+
}, E = function(H, U, W, G) {
|
|
4184
|
+
(n[W] && U === G || n[G] && U === W) && s.raise(H.column, w.IncompatibleModifiers({ modifiers: [W, G] }));
|
|
4185
4185
|
}; ; ) {
|
|
4186
|
-
var L = this.startLoc,
|
|
4187
|
-
if (!
|
|
4188
|
-
Be(
|
|
4186
|
+
var L = this.startLoc, k = this.tsParseModifier(c.concat(l ?? []), m);
|
|
4187
|
+
if (!k) break;
|
|
4188
|
+
Be(k) ? n.accessibility ? this.raise(this.start, w.DuplicateAccessibilityModifier()) : (S(L, k, k, "override"), S(L, k, k, "static"), S(L, k, k, "readonly"), S(L, k, k, "accessor"), b.accessibility = k, n.accessibility = k) : As(k) ? n[k] ? this.raise(this.start, w.DuplicateModifier({ modifier: k })) : (S(L, k, "in", "out"), b[k] = k, n[k] = !0) : ks(k) ? n[k] ? this.raise(this.start, w.DuplicateModifier({ modifier: k })) : (E(L, k, "accessor", "readonly"), E(L, k, "accessor", "static"), E(L, k, "accessor", "override"), b[k] = k, n[k] = !0) : Object.hasOwnProperty.call(n, k) ? this.raise(this.start, w.DuplicateModifier({ modifier: k })) : (S(L, k, "static", "readonly"), S(L, k, "static", "override"), S(L, k, "override", "readonly"), S(L, k, "abstract", "override"), E(L, k, "declare", "override"), E(L, k, "static", "abstract"), b[k] = k, n[k] = !0), l != null && l.includes(k) && this.raise(this.start, x);
|
|
4189
4189
|
}
|
|
4190
4190
|
return b;
|
|
4191
4191
|
}, p.tsParseInOutModifiers = function(i) {
|
|
4192
|
-
this.tsParseModifiers({ modified: i, allowedModifiers: ["in", "out"], disallowedModifiers: ["public", "private", "protected", "readonly", "declare", "abstract", "override"], errorTemplate:
|
|
4192
|
+
this.tsParseModifiers({ modified: i, allowedModifiers: ["in", "out"], disallowedModifiers: ["public", "private", "protected", "readonly", "declare", "abstract", "override"], errorTemplate: w.InvalidModifierOnTypeParameter });
|
|
4193
4193
|
}, p.tsParseTypeArguments = function() {
|
|
4194
4194
|
var i = this, s = this.startNode();
|
|
4195
4195
|
return s.params = this.tsInType(function() {
|
|
4196
4196
|
return i.tsInNoContext(function() {
|
|
4197
4197
|
return i.expect(o.relational), i.tsParseDelimitedList("TypeParametersOrArguments", i.tsParseType.bind(i));
|
|
4198
4198
|
});
|
|
4199
|
-
}), s.params.length === 0 && this.raise(this.start,
|
|
4199
|
+
}), s.params.length === 0 && this.raise(this.start, w.EmptyTypeArguments), this.exprAllowed = !1, this.expect(o.relational), this.finishNode(s, "TSTypeParameterInstantiation");
|
|
4200
4200
|
}, p.tsParseHeritageClause = function(i) {
|
|
4201
4201
|
var s = this, n = this.start, c = this.tsParseDelimitedList("HeritageClauseElement", function() {
|
|
4202
4202
|
var l = s.startNode();
|
|
4203
4203
|
return l.expression = s.tsParseEntityName(), s.tsMatchLeftRelational() && (l.typeParameters = s.tsParseTypeArguments()), s.finishNode(l, "TSExpressionWithTypeArguments");
|
|
4204
4204
|
});
|
|
4205
|
-
return c.length || this.raise(n,
|
|
4205
|
+
return c.length || this.raise(n, w.EmptyHeritageClauseType({ token: i })), c;
|
|
4206
4206
|
}, p.tsParseTypeMemberSemicolon = function() {
|
|
4207
4207
|
this.eat(o.comma) || this.isLineTerminator() || this.expect(o.semi);
|
|
4208
4208
|
}, p.tsTryParseAndCatch = function(i) {
|
|
@@ -4216,18 +4216,18 @@ function Es(t) {
|
|
|
4216
4216
|
this.eat(o.question) && (i.optional = !0);
|
|
4217
4217
|
var n = i;
|
|
4218
4218
|
if (this.match(o.parenL) || this.tsMatchLeftRelational()) {
|
|
4219
|
-
s && this.raise(i.start,
|
|
4219
|
+
s && this.raise(i.start, w.ReadonlyForMethodSignature);
|
|
4220
4220
|
var c = n;
|
|
4221
|
-
c.kind && this.tsMatchLeftRelational() && this.raise(this.start,
|
|
4221
|
+
c.kind && this.tsMatchLeftRelational() && this.raise(this.start, w.AccesorCannotHaveTypeParameters), this.tsFillSignature(o.colon, c), this.tsParseTypeMemberSemicolon();
|
|
4222
4222
|
var l = "parameters", m = "typeAnnotation";
|
|
4223
|
-
if (c.kind === "get") c[l].length > 0 && (this.raise(this.start, "A 'get' accesor must not have any formal parameters."), this.isThisParam(c[l][0]) && this.raise(this.start,
|
|
4223
|
+
if (c.kind === "get") c[l].length > 0 && (this.raise(this.start, "A 'get' accesor must not have any formal parameters."), this.isThisParam(c[l][0]) && this.raise(this.start, w.AccesorCannotDeclareThisParameter));
|
|
4224
4224
|
else if (c.kind === "set") {
|
|
4225
4225
|
if (c[l].length !== 1) this.raise(this.start, "A 'get' accesor must not have any formal parameters.");
|
|
4226
4226
|
else {
|
|
4227
4227
|
var y = c[l][0];
|
|
4228
|
-
this.isThisParam(y) && this.raise(this.start,
|
|
4228
|
+
this.isThisParam(y) && this.raise(this.start, w.AccesorCannotDeclareThisParameter), y.type === "Identifier" && y.optional && this.raise(this.start, w.SetAccesorCannotHaveOptionalParameter), y.type === "RestElement" && this.raise(this.start, w.SetAccesorCannotHaveRestParameter);
|
|
4229
4229
|
}
|
|
4230
|
-
c[m] && this.raise(c[m].start,
|
|
4230
|
+
c[m] && this.raise(c[m].start, w.SetAccesorCannotHaveReturnType);
|
|
4231
4231
|
} else c.kind = "method";
|
|
4232
4232
|
return this.finishNode(c, "TSMethodSignature");
|
|
4233
4233
|
}
|
|
@@ -4252,7 +4252,7 @@ function Es(t) {
|
|
|
4252
4252
|
return this.expect(o.braceR), i;
|
|
4253
4253
|
}, p.tsParseInterfaceDeclaration = function(i, s) {
|
|
4254
4254
|
if (s === void 0 && (s = {}), this.hasFollowingLineBreak()) return null;
|
|
4255
|
-
this.expectContextual("interface"), s.declare && (i.declare = !0),
|
|
4255
|
+
this.expectContextual("interface"), s.declare && (i.declare = !0), B(this.type) ? (i.id = this.parseIdent(), this.checkLValSimple(i.id, 7)) : (i.id = null, this.raise(this.start, w.MissingInterfaceName)), i.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)), this.eat(o._extends) && (i.extends = this.tsParseHeritageClause("extends"));
|
|
4256
4256
|
var n = this.startNode();
|
|
4257
4257
|
return n.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)), i.body = this.finishNode(n, "TSInterfaceBody"), this.finishNode(i, "TSInterfaceDeclaration");
|
|
4258
4258
|
}, p.tsParseAbstractDeclaration = function(i) {
|
|
@@ -4270,7 +4270,7 @@ function Es(t) {
|
|
|
4270
4270
|
break;
|
|
4271
4271
|
case "global":
|
|
4272
4272
|
if (this.match(o.braceL)) {
|
|
4273
|
-
T.prototype.enterScope.call(this,
|
|
4273
|
+
T.prototype.enterScope.call(this, Lt);
|
|
4274
4274
|
var c = i;
|
|
4275
4275
|
return c.global = !0, c.id = s, c.body = this.tsParseModuleBlock(), T.prototype.exitScope.call(this), this.finishNode(c, "TSModuleDeclaration");
|
|
4276
4276
|
}
|
|
@@ -4282,15 +4282,15 @@ function Es(t) {
|
|
|
4282
4282
|
return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(!1);
|
|
4283
4283
|
}, p.tsIsExportDefaultSpecifier = function() {
|
|
4284
4284
|
var i = this.type, s = this.isAsyncFunction(), n = this.isLet();
|
|
4285
|
-
if (
|
|
4285
|
+
if (B(i)) {
|
|
4286
4286
|
if (s && !this.containsEsc || n) return !1;
|
|
4287
4287
|
if ((i === I.type || i === I.interface) && !this.containsEsc) {
|
|
4288
4288
|
var c = this.lookahead();
|
|
4289
|
-
if (
|
|
4289
|
+
if (B(c.type) && !this.isContextualWithState("from", c) || c.type === o.braceL) return !1;
|
|
4290
4290
|
}
|
|
4291
4291
|
} else if (!this.match(o._default)) return !1;
|
|
4292
4292
|
var l = this.nextTokenStart(), m = this.isUnparsedContextual(l, "from");
|
|
4293
|
-
if (this.input.charCodeAt(l) === 44 ||
|
|
4293
|
+
if (this.input.charCodeAt(l) === 44 || B(this.type) && m) return !0;
|
|
4294
4294
|
if (this.match(o._default) && m) {
|
|
4295
4295
|
var y = this.input.charCodeAt(this.nextTokenStartSince(l + 4));
|
|
4296
4296
|
return y === 34 || y === 39;
|
|
@@ -4310,7 +4310,7 @@ function Es(t) {
|
|
|
4310
4310
|
if (s === void 0 && (s = !1), i.id = this.parseIdent(), s || this.checkLValSimple(i.id, 8), this.eat(o.dot)) {
|
|
4311
4311
|
var n = this.startNode();
|
|
4312
4312
|
this.tsParseModuleOrNamespaceDeclaration(n, !0), i.body = n;
|
|
4313
|
-
} else T.prototype.enterScope.call(this,
|
|
4313
|
+
} else T.prototype.enterScope.call(this, Lt), i.body = this.tsParseModuleBlock(), T.prototype.exitScope.call(this);
|
|
4314
4314
|
return this.finishNode(i, "TSModuleDeclaration");
|
|
4315
4315
|
}, p.checkLValSimple = function(i, s, n) {
|
|
4316
4316
|
return s === void 0 && (s = 0), T.prototype.checkLValSimple.call(this, i, s, n);
|
|
@@ -4326,38 +4326,38 @@ function Es(t) {
|
|
|
4326
4326
|
}, p.tsParseDeclaration = function(i, s, n) {
|
|
4327
4327
|
switch (s) {
|
|
4328
4328
|
case "abstract":
|
|
4329
|
-
if (this.tsCheckLineTerminator(n) && (this.match(o._class) ||
|
|
4329
|
+
if (this.tsCheckLineTerminator(n) && (this.match(o._class) || B(this.type))) return this.tsParseAbstractDeclaration(i);
|
|
4330
4330
|
break;
|
|
4331
4331
|
case "module":
|
|
4332
4332
|
if (this.tsCheckLineTerminator(n)) {
|
|
4333
4333
|
if (this.match(o.string)) return this.tsParseAmbientExternalModuleDeclaration(i);
|
|
4334
|
-
if (
|
|
4334
|
+
if (B(this.type)) return this.tsParseModuleOrNamespaceDeclaration(i);
|
|
4335
4335
|
}
|
|
4336
4336
|
break;
|
|
4337
4337
|
case "namespace":
|
|
4338
|
-
if (this.tsCheckLineTerminator(n) &&
|
|
4338
|
+
if (this.tsCheckLineTerminator(n) && B(this.type)) return this.tsParseModuleOrNamespaceDeclaration(i);
|
|
4339
4339
|
break;
|
|
4340
4340
|
case "type":
|
|
4341
|
-
if (this.tsCheckLineTerminator(n) &&
|
|
4341
|
+
if (this.tsCheckLineTerminator(n) && B(this.type)) return this.tsParseTypeAliasDeclaration(i);
|
|
4342
4342
|
}
|
|
4343
4343
|
}, p.tsTryParseExportDeclaration = function() {
|
|
4344
4344
|
return this.tsParseDeclaration(this.startNode(), this.value, !0);
|
|
4345
4345
|
}, p.tsParseImportEqualsDeclaration = function(i, s) {
|
|
4346
4346
|
i.isExport = s || !1, i.id = this.parseIdent(), this.checkLValSimple(i.id, 2), T.prototype.expect.call(this, o.eq);
|
|
4347
4347
|
var n = this.tsParseModuleReference();
|
|
4348
|
-
return i.importKind === "type" && n.type !== "TSExternalModuleReference" && this.raise(n.start,
|
|
4348
|
+
return i.importKind === "type" && n.type !== "TSExternalModuleReference" && this.raise(n.start, w.ImportAliasHasImportType), i.moduleReference = n, T.prototype.semicolon.call(this), this.finishNode(i, "TSImportEqualsDeclaration");
|
|
4349
4349
|
}, p.isExportDefaultSpecifier = function() {
|
|
4350
4350
|
if (this.tsIsDeclarationStart()) return !1;
|
|
4351
4351
|
var i = this.type;
|
|
4352
|
-
if (
|
|
4352
|
+
if (B(i)) {
|
|
4353
4353
|
if (this.isContextual("async") || this.isContextual("let")) return !1;
|
|
4354
4354
|
if ((i === I.type || i === I.interface) && !this.containsEsc) {
|
|
4355
4355
|
var s = this.lookahead();
|
|
4356
|
-
if (
|
|
4356
|
+
if (B(s.type) && !this.isContextualWithState("from", s) || s.type === o.braceL) return !1;
|
|
4357
4357
|
}
|
|
4358
4358
|
} else if (!this.match(o._default)) return !1;
|
|
4359
4359
|
var n = this.nextTokenStart(), c = this.isUnparsedContextual(n, "from");
|
|
4360
|
-
if (this.input.charCodeAt(n) === 44 ||
|
|
4360
|
+
if (this.input.charCodeAt(n) === 44 || B(this.type) && c) return !0;
|
|
4361
4361
|
if (this.match(o._default) && c) {
|
|
4362
4362
|
var l = this.input.charCodeAt(this.nextTokenStartSince(n + 4));
|
|
4363
4363
|
return l === 34 || l === 39;
|
|
@@ -4378,7 +4378,7 @@ function Es(t) {
|
|
|
4378
4378
|
}, p.parseFunctionBody = function(i, s, n, c, l) {
|
|
4379
4379
|
s === void 0 && (s = !1), n === void 0 && (n = !1), c === void 0 && (c = !1), this.match(o.colon) && (i.returnType = this.tsParseTypeOrTypePredicateAnnotation(o.colon));
|
|
4380
4380
|
var m = l != null && l.isFunctionDeclaration ? "TSDeclareFunction" : l != null && l.isClassMethod ? "TSDeclareMethod" : void 0;
|
|
4381
|
-
return m && !this.match(o.braceL) && this.isLineTerminator() ? this.finishNode(i, m) : m === "TSDeclareFunction" && this.isAmbientContext && (this.raise(i.start,
|
|
4381
|
+
return m && !this.match(o.braceL) && this.isLineTerminator() ? this.finishNode(i, m) : m === "TSDeclareFunction" && this.isAmbientContext && (this.raise(i.start, w.DeclareFunctionHasImplementation), i.declare) ? (T.prototype.parseFunctionBody.call(this, i, s, n, !1), this.finishNode(i, m)) : (T.prototype.parseFunctionBody.call(this, i, s, n, c), i);
|
|
4382
4382
|
}, p.parseNew = function() {
|
|
4383
4383
|
var i;
|
|
4384
4384
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
@@ -4403,7 +4403,7 @@ function Es(t) {
|
|
|
4403
4403
|
return T.prototype.parseExprOp.call(this, i, s, n, c, l);
|
|
4404
4404
|
}, p.parseImportSpecifiers = function() {
|
|
4405
4405
|
var i = [], s = !0;
|
|
4406
|
-
if (
|
|
4406
|
+
if (v.tokenIsIdentifier(this.type) && (i.push(this.parseImportDefaultSpecifier()), !this.eat(o.comma))) return i;
|
|
4407
4407
|
if (this.type === o.star) return i.push(this.parseImportNamespaceSpecifier()), i;
|
|
4408
4408
|
for (this.expect(o.braceL); !this.eat(o.braceR); ) {
|
|
4409
4409
|
if (s) s = !1;
|
|
@@ -4413,15 +4413,15 @@ function Es(t) {
|
|
|
4413
4413
|
return i;
|
|
4414
4414
|
}, p.parseImport = function(i) {
|
|
4415
4415
|
var s = this.lookahead();
|
|
4416
|
-
if (i.importKind = "value", this.importOrExportOuterKind = "value",
|
|
4416
|
+
if (i.importKind = "value", this.importOrExportOuterKind = "value", B(s.type) || this.match(o.star) || this.match(o.braceL)) {
|
|
4417
4417
|
var n = this.lookahead(2);
|
|
4418
|
-
if (n.type !== o.comma && !this.isContextualWithState("from", n) && n.type !== o.eq && this.ts_eatContextualWithState("type", 1, s) && (this.importOrExportOuterKind = "type", i.importKind = "type", s = this.lookahead(), n = this.lookahead(2)),
|
|
4418
|
+
if (n.type !== o.comma && !this.isContextualWithState("from", n) && n.type !== o.eq && this.ts_eatContextualWithState("type", 1, s) && (this.importOrExportOuterKind = "type", i.importKind = "type", s = this.lookahead(), n = this.lookahead(2)), B(s.type) && n.type === o.eq) {
|
|
4419
4419
|
this.next();
|
|
4420
4420
|
var c = this.tsParseImportEqualsDeclaration(i);
|
|
4421
4421
|
return this.importOrExportOuterKind = "value", c;
|
|
4422
4422
|
}
|
|
4423
4423
|
}
|
|
4424
|
-
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,
|
|
4424
|
+
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, w.TypeImportCannotSpecifyDefaultAndNamed), i;
|
|
4425
4425
|
}, p.parseExportDefaultDeclaration = function() {
|
|
4426
4426
|
if (this.isAbstractClass()) {
|
|
4427
4427
|
var i = this.startNode();
|
|
@@ -4478,7 +4478,7 @@ function Es(t) {
|
|
|
4478
4478
|
i && (typeof s != "string" && (s = s.type === "Identifier" ? s.name : s.value), i[s] = !0);
|
|
4479
4479
|
}, p.parseMaybeDefault = function(i, s, n) {
|
|
4480
4480
|
var c = T.prototype.parseMaybeDefault.call(this, i, s, n);
|
|
4481
|
-
return c.type === "AssignmentPattern" && c.typeAnnotation && c.right.start < c.typeAnnotation.start && this.raise(c.typeAnnotation.start,
|
|
4481
|
+
return c.type === "AssignmentPattern" && c.typeAnnotation && c.right.start < c.typeAnnotation.start && this.raise(c.typeAnnotation.start, w.TypeAnnotationAfterAssign), c;
|
|
4482
4482
|
}, p.typeCastToParameter = function(i) {
|
|
4483
4483
|
return i.expression.typeAnnotation = i.typeAnnotation, this.resetEndLocation(i.expression, i.typeAnnotation.end), i.expression;
|
|
4484
4484
|
}, p.toAssignableList = function(i, s) {
|
|
@@ -4492,9 +4492,9 @@ function Es(t) {
|
|
|
4492
4492
|
if (this.type === I.jsxText) return this.jsx_parseText();
|
|
4493
4493
|
if (this.type === I.jsxTagStart) return this.jsx_parseElement();
|
|
4494
4494
|
if (this.type === I.at) return this.parseDecorators(), this.parseExprAtom();
|
|
4495
|
-
if (
|
|
4495
|
+
if (B(this.type)) {
|
|
4496
4496
|
var c = this.potentialArrowAt === this.start, l = this.start, m = this.startLoc, y = this.containsEsc, x = this.parseIdent(!1);
|
|
4497
|
-
if (this.options.ecmaVersion >= 8 && !y && x.name === "async" && !this.canInsertSemicolon() && this.eat(o._function)) return this.overrideContext(
|
|
4497
|
+
if (this.options.ecmaVersion >= 8 && !y && x.name === "async" && !this.canInsertSemicolon() && this.eat(o._function)) return this.overrideContext(z.f_expr), this.parseFunction(this.startNodeAt(l, m), 0, !1, !0, s);
|
|
4498
4498
|
if (c && !this.canInsertSemicolon()) {
|
|
4499
4499
|
if (this.eat(o.arrow)) return this.parseArrowExpression(this.startNodeAt(l, m), [x], !1, s);
|
|
4500
4500
|
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(l, m), [x], !0, s);
|
|
@@ -4503,12 +4503,12 @@ function Es(t) {
|
|
|
4503
4503
|
}
|
|
4504
4504
|
return T.prototype.parseExprAtom.call(this, i, s, n);
|
|
4505
4505
|
}, p.parseExprAtomDefault = function() {
|
|
4506
|
-
if (
|
|
4506
|
+
if (B(this.type)) {
|
|
4507
4507
|
var i = this.potentialArrowAt === this.start, s = this.containsEsc, n = this.parseIdent();
|
|
4508
4508
|
if (!s && n.name === "async" && !this.canInsertSemicolon()) {
|
|
4509
4509
|
var c = this.type;
|
|
4510
4510
|
if (c === o._function) return this.next(), this.parseFunction(this.startNodeAtNode(n), void 0, !0, !0);
|
|
4511
|
-
if (
|
|
4511
|
+
if (B(c)) {
|
|
4512
4512
|
if (this.lookaheadCharCode() === 61) {
|
|
4513
4513
|
var l = this.parseIdent(!1);
|
|
4514
4514
|
return !this.canInsertSemicolon() && this.eat(o.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAtNode(n), [l], !0);
|
|
@@ -4521,7 +4521,7 @@ function Es(t) {
|
|
|
4521
4521
|
this.unexpected();
|
|
4522
4522
|
}, p.parseIdentNode = function() {
|
|
4523
4523
|
var i = this.startNode();
|
|
4524
|
-
return
|
|
4524
|
+
return qt(this.type) ? (i.name = this.value, i) : T.prototype.parseIdentNode.call(this);
|
|
4525
4525
|
}, p.parseVarStatement = function(i, s, n) {
|
|
4526
4526
|
n === void 0 && (n = !1);
|
|
4527
4527
|
var c = this.isAmbientContext;
|
|
@@ -4530,7 +4530,7 @@ function Es(t) {
|
|
|
4530
4530
|
if (!c) return l;
|
|
4531
4531
|
for (var m, y = Me(l.declarations); !(m = y()).done; ) {
|
|
4532
4532
|
var x = m.value, b = x.init;
|
|
4533
|
-
b && (s !== "const" || x.id.typeAnnotation ? this.raise(b.start,
|
|
4533
|
+
b && (s !== "const" || x.id.typeAnnotation ? this.raise(b.start, w.InitializerNotAllowedInAmbientContext) : b.type !== "StringLiteral" && b.type !== "BooleanLiteral" && b.type !== "NumericLiteral" && b.type !== "BigIntLiteral" && (b.type !== "TemplateLiteral" || b.expressions.length > 0) && !ws(b) && this.raise(b.start, w.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference));
|
|
4534
4534
|
}
|
|
4535
4535
|
return l;
|
|
4536
4536
|
}, p.parseStatement = function(i, s, n) {
|
|
@@ -4547,7 +4547,7 @@ function Es(t) {
|
|
|
4547
4547
|
}, p.parseAccessModifier = function() {
|
|
4548
4548
|
return this.tsParseModifier(["public", "protected", "private"]);
|
|
4549
4549
|
}, p.parsePostMemberNameModifiers = function(i) {
|
|
4550
|
-
this.eat(o.question) && (i.optional = !0), i.readonly && this.match(o.parenL) && this.raise(i.start,
|
|
4550
|
+
this.eat(o.question) && (i.optional = !0), i.readonly && this.match(o.parenL) && this.raise(i.start, w.ClassMethodHasReadonly), i.declare && this.match(o.parenL) && this.raise(i.start, w.ClassMethodHasDeclare);
|
|
4551
4551
|
}, p.parseExpressionStatement = function(i, s) {
|
|
4552
4552
|
return (s.type === "Identifier" ? this.tsParseExpressionStatement(i, s) : void 0) || T.prototype.parseExpressionStatement.call(this, i, s);
|
|
4553
4553
|
}, p.shouldParseExportStatement = function() {
|
|
@@ -4579,8 +4579,8 @@ function Es(t) {
|
|
|
4579
4579
|
return s.parseExportDeclaration(i);
|
|
4580
4580
|
});
|
|
4581
4581
|
var n = this.start, c = this.startLoc, l = this.eatContextual("declare");
|
|
4582
|
-
!l || !this.ts_isContextual(I.declare) && this.shouldParseExportStatement() || this.raise(this.start,
|
|
4583
|
-
var m =
|
|
4582
|
+
!l || !this.ts_isContextual(I.declare) && this.shouldParseExportStatement() || this.raise(this.start, w.ExpectedAmbientAfterExportDeclare);
|
|
4583
|
+
var m = B(this.type) && this.tsTryParseExportDeclaration() || this.parseStatement(null);
|
|
4584
4584
|
return m ? ((m.type === "TSInterfaceDeclaration" || m.type === "TSTypeAliasDeclaration" || l) && (i.exportKind = "type"), l && (this.resetStartLocation(m, n, c), m.declare = !0), m) : null;
|
|
4585
4585
|
}, p.parseClassId = function(i, s) {
|
|
4586
4586
|
if (s || !this.isContextual("implements")) {
|
|
@@ -4593,17 +4593,17 @@ function Es(t) {
|
|
|
4593
4593
|
var s = this.tsTryParseTypeAnnotation();
|
|
4594
4594
|
s && (i.typeAnnotation = s);
|
|
4595
4595
|
}, p.parseClassField = function(i) {
|
|
4596
|
-
if (i.key.type === "PrivateIdentifier") i.abstract && this.raise(i.start,
|
|
4597
|
-
else if (this.parseClassPropertyAnnotation(i), this.isAmbientContext && (!i.readonly || i.typeAnnotation) && this.match(o.eq) && this.raise(this.start,
|
|
4596
|
+
if (i.key.type === "PrivateIdentifier") i.abstract && this.raise(i.start, w.PrivateElementHasAbstract), i.accessibility && this.raise(i.start, w.PrivateElementHasAccessibility({ modifier: i.accessibility })), this.parseClassPropertyAnnotation(i);
|
|
4597
|
+
else if (this.parseClassPropertyAnnotation(i), this.isAmbientContext && (!i.readonly || i.typeAnnotation) && this.match(o.eq) && this.raise(this.start, w.DeclareClassFieldHasInitializer), i.abstract && this.match(o.eq)) {
|
|
4598
4598
|
var s = i.key;
|
|
4599
|
-
this.raise(this.start,
|
|
4599
|
+
this.raise(this.start, w.AbstractPropertyHasInitializer({ propertyName: s.type !== "Identifier" || i.computed ? "[" + this.input.slice(s.start, s.end) + "]" : s.name }));
|
|
4600
4600
|
}
|
|
4601
4601
|
return T.prototype.parseClassField.call(this, i);
|
|
4602
4602
|
}, p.parseClassMethod = function(i, s, n, c) {
|
|
4603
4603
|
var l = i.kind === "constructor", m = i.key.type === "PrivateIdentifier", y = this.tsTryParseTypeParameters();
|
|
4604
|
-
m ? (y && (i.typeParameters = y), i.accessibility && this.raise(i.start,
|
|
4604
|
+
m ? (y && (i.typeParameters = y), i.accessibility && this.raise(i.start, w.PrivateMethodsHasAccessibility({ modifier: i.accessibility }))) : y && l && this.raise(y.start, w.ConstructorHasTypeParameters);
|
|
4605
4605
|
var x = i.declare, b = i.kind;
|
|
4606
|
-
!(x !== void 0 && x) || b !== "get" && b !== "set" || this.raise(i.start,
|
|
4606
|
+
!(x !== void 0 && x) || b !== "get" && b !== "set" || this.raise(i.start, w.DeclareAccessor({ kind: b })), y && (i.typeParameters = y);
|
|
4607
4607
|
var S = i.key;
|
|
4608
4608
|
i.kind === "constructor" ? (s && this.raise(S.start, "Constructor can't be a generator"), n && this.raise(S.start, "Constructor can't be an async method")) : i.static && Ve(i, "prototype") && this.raise(S.start, "Classes may not have a static property named prototype");
|
|
4609
4609
|
var E = i.value = this.parseMethod(s, n, c, !0, i);
|
|
@@ -4613,23 +4613,23 @@ function Es(t) {
|
|
|
4613
4613
|
}, p.parseClassElement = function(i) {
|
|
4614
4614
|
var s = this;
|
|
4615
4615
|
if (this.eat(o.semi)) return null;
|
|
4616
|
-
var n, c = this.options.ecmaVersion, l = this.startNode(), m = "", y = !1, x = !1, b = "method", S = ["declare", "private", "public", "protected", "accessor", "override", "abstract", "readonly", "static"], E = this.tsParseModifiers({ modified: l, allowedModifiers: S, disallowedModifiers: ["in", "out"], stopOnStartOfClassStaticBlock: !0, errorTemplate:
|
|
4616
|
+
var n, c = this.options.ecmaVersion, l = this.startNode(), m = "", y = !1, x = !1, b = "method", S = ["declare", "private", "public", "protected", "accessor", "override", "abstract", "readonly", "static"], E = this.tsParseModifiers({ modified: l, allowedModifiers: S, disallowedModifiers: ["in", "out"], stopOnStartOfClassStaticBlock: !0, errorTemplate: w.InvalidModifierOnTypeParameterPositions });
|
|
4617
4617
|
n = !!E.static;
|
|
4618
4618
|
var L = function() {
|
|
4619
4619
|
if (!s.tsIsStartOfStaticBlocks()) {
|
|
4620
|
-
var
|
|
4621
|
-
if (
|
|
4622
|
-
if (!s.inAbstractClass && l.abstract && s.raise(l.start,
|
|
4623
|
-
var
|
|
4624
|
-
(s.eatContextual("get") || s.eatContextual("set")) && (s.isClassElementNameStart() ? b =
|
|
4620
|
+
var k = s.tsTryParseIndexSignature(l);
|
|
4621
|
+
if (k) return l.abstract && s.raise(l.start, w.IndexSignatureHasAbstract), l.accessibility && s.raise(l.start, w.IndexSignatureHasAccessibility({ modifier: l.accessibility })), l.declare && s.raise(l.start, w.IndexSignatureHasDeclare), l.override && s.raise(l.start, w.IndexSignatureHasOverride), k;
|
|
4622
|
+
if (!s.inAbstractClass && l.abstract && s.raise(l.start, w.NonAbstractClassHasAbstractMethod), l.override && i && s.raise(l.start, w.OverrideNotInSubClass), l.static = n, n && (s.isClassElementNameStart() || s.type === o.star || (m = "static")), !m && c >= 8 && s.eatContextual("async") && (!s.isClassElementNameStart() && s.type !== o.star || s.canInsertSemicolon() ? m = "async" : x = !0), !m && (c >= 9 || !x) && s.eat(o.star) && (y = !0), !m && !x && !y) {
|
|
4623
|
+
var H = s.value;
|
|
4624
|
+
(s.eatContextual("get") || s.eatContextual("set")) && (s.isClassElementNameStart() ? b = H : m = H);
|
|
4625
4625
|
}
|
|
4626
4626
|
if (m ? (l.computed = !1, l.key = s.startNodeAt(s.lastTokStart, s.lastTokStartLoc), l.key.name = m, s.finishNode(l.key, "Identifier")) : s.parseClassElementName(l), s.parsePostMemberNameModifiers(l), s.isClassMethod() || c < 13 || s.type === o.parenL || b !== "method" || y || x) {
|
|
4627
|
-
var
|
|
4628
|
-
|
|
4627
|
+
var U = !l.static && Ve(l, "constructor"), W = U && i;
|
|
4628
|
+
U && b !== "method" && s.raise(l.key.start, "Constructor can't have get/set modifier"), l.kind = U ? "constructor" : b, s.parseClassMethod(l, y, x, W);
|
|
4629
4629
|
} else s.parseClassField(l);
|
|
4630
4630
|
return l;
|
|
4631
4631
|
}
|
|
4632
|
-
if (s.next(), s.next(), s.tsHasSomeModifiers(l, S) && s.raise(s.start,
|
|
4632
|
+
if (s.next(), s.next(), s.tsHasSomeModifiers(l, S) && s.raise(s.start, w.StaticBlockCannotHaveModifier), c >= 13) return T.prototype.parseClassStaticBlock.call(s, l), l;
|
|
4633
4633
|
};
|
|
4634
4634
|
return l.declare ? this.tsInAmbientContext(L) : L(), l;
|
|
4635
4635
|
}, p.isClassElementNameStart = function() {
|
|
@@ -4655,9 +4655,9 @@ function Es(t) {
|
|
|
4655
4655
|
this.exprAllowed = !1;
|
|
4656
4656
|
}
|
|
4657
4657
|
var c = !1, l = -1, m = -1, y = -1;
|
|
4658
|
-
s ? (l = s.parenthesizedAssign, m = s.trailingComma, y = s.doubleProto, s.parenthesizedAssign = s.trailingComma = -1) : (s = new
|
|
4658
|
+
s ? (l = s.parenthesizedAssign, m = s.trailingComma, y = s.doubleProto, s.parenthesizedAssign = s.trailingComma = -1) : (s = new Ot(), c = !0);
|
|
4659
4659
|
var x = this.start, b = this.startLoc;
|
|
4660
|
-
(this.type === o.parenL ||
|
|
4660
|
+
(this.type === o.parenL || B(this.type)) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = i === "await");
|
|
4661
4661
|
var S = this.parseMaybeConditional(i, s);
|
|
4662
4662
|
if (n && (S = n.call(this, S, x, b)), this.type.isAssign) {
|
|
4663
4663
|
var E = this.startNodeAt(x, b);
|
|
@@ -4665,49 +4665,49 @@ function Es(t) {
|
|
|
4665
4665
|
}
|
|
4666
4666
|
return c && this.checkExpressionErrors(s, !0), l > -1 && (s.parenthesizedAssign = l), m > -1 && (s.trailingComma = m), S;
|
|
4667
4667
|
}, p.parseMaybeAssign = function(i, s, n) {
|
|
4668
|
-
var c, l, m, y, x, b, S, E, L,
|
|
4668
|
+
var c, l, m, y, x, b, S, E, L, k, H, U = this;
|
|
4669
4669
|
if (this.matchJsx("jsxTagStart") || this.tsMatchLeftRelational()) {
|
|
4670
4670
|
if (E = this.cloneCurLookaheadState(), !(L = this.tryParse(function() {
|
|
4671
|
-
return
|
|
4671
|
+
return U.parseMaybeAssignOrigin(i, s, n);
|
|
4672
4672
|
}, E)).error) return L.node;
|
|
4673
|
-
var W = this.context,
|
|
4674
|
-
|
|
4673
|
+
var W = this.context, G = W[W.length - 1];
|
|
4674
|
+
G === v.tokContexts.tc_oTag && W[W.length - 2] === v.tokContexts.tc_expr ? (W.pop(), W.pop()) : G !== v.tokContexts.tc_oTag && G !== v.tokContexts.tc_expr || W.pop();
|
|
4675
4675
|
}
|
|
4676
4676
|
if (!((c = L) != null && c.error || this.tsMatchLeftRelational())) return this.parseMaybeAssignOrigin(i, s, n);
|
|
4677
4677
|
E && !this.compareLookaheadState(E, this.getCurLookaheadState()) || (E = this.cloneCurLookaheadState());
|
|
4678
4678
|
var rt = this.tryParse(function(vt) {
|
|
4679
|
-
var
|
|
4680
|
-
|
|
4681
|
-
var gt =
|
|
4682
|
-
return (gt.type !== "ArrowFunctionExpression" || (
|
|
4679
|
+
var _t, Nt;
|
|
4680
|
+
H = U.tsParseTypeParameters();
|
|
4681
|
+
var gt = U.parseMaybeAssignOrigin(i, s, n);
|
|
4682
|
+
return (gt.type !== "ArrowFunctionExpression" || (_t = gt.extra) != null && _t.parenthesized) && vt(), ((Nt = H) == null ? void 0 : Nt.params.length) !== 0 && U.resetStartLocationFromNode(gt, H), gt.typeParameters = H, gt;
|
|
4683
4683
|
}, E);
|
|
4684
|
-
if (!rt.error && !rt.aborted) return
|
|
4685
|
-
if (!L && (Fe(!0), !(
|
|
4686
|
-
return
|
|
4687
|
-
}, E)).error)) return
|
|
4684
|
+
if (!rt.error && !rt.aborted) return H && this.reportReservedArrowTypeParam(H), rt.node;
|
|
4685
|
+
if (!L && (Fe(!0), !(k = this.tryParse(function() {
|
|
4686
|
+
return U.parseMaybeAssignOrigin(i, s, n);
|
|
4687
|
+
}, E)).error)) return k.node;
|
|
4688
4688
|
if ((l = L) != null && l.node) return this.setLookaheadState(L.failState), L.node;
|
|
4689
|
-
if (rt.node) return this.setLookaheadState(rt.failState),
|
|
4690
|
-
if ((m =
|
|
4691
|
-
throw (y = L) != null && y.thrown ? L.error : rt.thrown ? rt.error : (x =
|
|
4689
|
+
if (rt.node) return this.setLookaheadState(rt.failState), H && this.reportReservedArrowTypeParam(H), rt.node;
|
|
4690
|
+
if ((m = k) != null && m.node) return this.setLookaheadState(k.failState), k.node;
|
|
4691
|
+
throw (y = L) != null && y.thrown ? L.error : rt.thrown ? rt.error : (x = k) != null && x.thrown ? k.error : ((b = L) == null ? void 0 : b.error) || rt.error || ((S = k) == null ? void 0 : S.error);
|
|
4692
4692
|
}, p.parseAssignableListItem = function(i) {
|
|
4693
4693
|
for (var s = []; this.match(I.at); ) s.push(this.parseDecorator());
|
|
4694
4694
|
var n, c = this.start, l = this.startLoc, m = !1, y = !1;
|
|
4695
4695
|
if (i !== void 0) {
|
|
4696
4696
|
var x = {};
|
|
4697
|
-
this.tsParseModifiers({ modified: x, allowedModifiers: ["public", "private", "protected", "override", "readonly"] }), n = x.accessibility, y = x.override, m = x.readonly, i === !1 && (n || m || y) && this.raise(l.start,
|
|
4697
|
+
this.tsParseModifiers({ modified: x, allowedModifiers: ["public", "private", "protected", "override", "readonly"] }), n = x.accessibility, y = x.override, m = x.readonly, i === !1 && (n || m || y) && this.raise(l.start, w.UnexpectedParameterModifier);
|
|
4698
4698
|
}
|
|
4699
4699
|
var b = this.parseMaybeDefault(c, l);
|
|
4700
4700
|
this.parseBindingListItem(b);
|
|
4701
4701
|
var S = this.parseMaybeDefault(b.start, b.loc, b);
|
|
4702
4702
|
if (s.length && (S.decorators = s), n || m || y) {
|
|
4703
4703
|
var E = this.startNodeAt(c, l);
|
|
4704
|
-
return n && (E.accessibility = n), m && (E.readonly = m), y && (E.override = y), S.type !== "Identifier" && S.type !== "AssignmentPattern" && this.raise(E.start,
|
|
4704
|
+
return n && (E.accessibility = n), m && (E.readonly = m), y && (E.override = y), S.type !== "Identifier" && S.type !== "AssignmentPattern" && this.raise(E.start, w.UnsupportedParameterPropertyKind), E.parameter = S, this.finishNode(E, "TSParameterProperty");
|
|
4705
4705
|
}
|
|
4706
4706
|
return S;
|
|
4707
4707
|
}, p.checkLValInnerPattern = function(i, s, n) {
|
|
4708
4708
|
s === void 0 && (s = 0), i.type === "TSParameterProperty" ? this.checkLValInnerPattern(i.parameter, s, n) : T.prototype.checkLValInnerPattern.call(this, i, s, n);
|
|
4709
4709
|
}, p.parseBindingListItem = function(i) {
|
|
4710
|
-
this.eat(o.question) && (i.type === "Identifier" || this.isAmbientContext || this.inType || this.raise(i.start,
|
|
4710
|
+
this.eat(o.question) && (i.type === "Identifier" || this.isAmbientContext || this.inType || this.raise(i.start, w.PatternIsOptional), i.optional = !0);
|
|
4711
4711
|
var s = this.tsTryParseTypeAnnotation();
|
|
4712
4712
|
return s && (i.typeAnnotation = s), this.resetEndLocation(i), i;
|
|
4713
4713
|
}, p.isAssignable = function(i, s) {
|
|
@@ -4747,14 +4747,14 @@ function Es(t) {
|
|
|
4747
4747
|
return !1;
|
|
4748
4748
|
}
|
|
4749
4749
|
}, p.toAssignable = function(i, s, n) {
|
|
4750
|
-
switch (s === void 0 && (s = !1), n === void 0 && (n = new
|
|
4750
|
+
switch (s === void 0 && (s = !1), n === void 0 && (n = new Ot()), i.type) {
|
|
4751
4751
|
case "ParenthesizedExpression":
|
|
4752
4752
|
return this.toAssignableParenthesizedExpression(i, s, n);
|
|
4753
4753
|
case "TSAsExpression":
|
|
4754
4754
|
case "TSSatisfiesExpression":
|
|
4755
4755
|
case "TSNonNullExpression":
|
|
4756
4756
|
case "TSTypeAssertion":
|
|
4757
|
-
return s || this.raise(i.start,
|
|
4757
|
+
return s || this.raise(i.start, w.UnexpectedTypeCastInParameter), this.toAssignable(i.expression, s, n);
|
|
4758
4758
|
case "MemberExpression":
|
|
4759
4759
|
break;
|
|
4760
4760
|
case "AssignmentExpression":
|
|
@@ -4781,7 +4781,7 @@ function Es(t) {
|
|
|
4781
4781
|
var i = T.prototype.curPosition.call(this);
|
|
4782
4782
|
return Object.defineProperty(i, "offset", { get: function() {
|
|
4783
4783
|
return function(s) {
|
|
4784
|
-
var n = new
|
|
4784
|
+
var n = new g.Position(this.line, this.column + s);
|
|
4785
4785
|
return n.index = this.index + s, n;
|
|
4786
4786
|
};
|
|
4787
4787
|
} }), i.index = this.pos, i;
|
|
@@ -4812,21 +4812,21 @@ function Es(t) {
|
|
|
4812
4812
|
if (this.options.ecmaVersion >= 6) {
|
|
4813
4813
|
var y = this.maybeInArrowParameters;
|
|
4814
4814
|
this.maybeInArrowParameters = !0, this.next();
|
|
4815
|
-
var x, b = this.start, S = this.startLoc, E = [], L = !0,
|
|
4815
|
+
var x, b = this.start, S = this.startLoc, E = [], L = !0, k = !1, H = new Ot(), U = this.yieldPos, W = this.awaitPos;
|
|
4816
4816
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== o.parenR; ) {
|
|
4817
4817
|
if (L ? L = !1 : this.expect(o.comma), m && this.afterTrailingComma(o.parenR, !0)) {
|
|
4818
|
-
|
|
4818
|
+
k = !0;
|
|
4819
4819
|
break;
|
|
4820
4820
|
}
|
|
4821
4821
|
if (this.type === o.ellipsis) {
|
|
4822
4822
|
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");
|
|
4823
4823
|
break;
|
|
4824
4824
|
}
|
|
4825
|
-
E.push(this.parseMaybeAssign(s,
|
|
4825
|
+
E.push(this.parseMaybeAssign(s, H, this.parseParenItem));
|
|
4826
4826
|
}
|
|
4827
|
-
var
|
|
4828
|
-
if (this.expect(o.parenR), this.maybeInArrowParameters = y, i && this.shouldParseArrow(E) && this.eat(o.arrow)) return this.checkPatternErrors(
|
|
4829
|
-
E.length && !
|
|
4827
|
+
var G = this.lastTokEnd, rt = this.lastTokEndLoc;
|
|
4828
|
+
if (this.expect(o.parenR), this.maybeInArrowParameters = y, i && this.shouldParseArrow(E) && this.eat(o.arrow)) return this.checkPatternErrors(H, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = U, this.awaitPos = W, this.parseParenArrowList(c, l, E, s);
|
|
4829
|
+
E.length && !k || this.unexpected(this.lastTokStart), x && this.unexpected(x), this.checkExpressionErrors(H, !0), this.yieldPos = U || this.yieldPos, this.awaitPos = W || this.awaitPos, E.length > 1 ? ((n = this.startNodeAt(b, S)).expressions = E, this.finishNodeAt(n, "SequenceExpression", G, rt)) : n = E[0];
|
|
4830
4830
|
} else n = this.parseParenExpression();
|
|
4831
4831
|
if (this.options.preserveParens) {
|
|
4832
4832
|
var vt = this.startNodeAt(c, l);
|
|
@@ -4868,7 +4868,7 @@ function Es(t) {
|
|
|
4868
4868
|
i.optional = !0, b = E = !0, this.next();
|
|
4869
4869
|
}
|
|
4870
4870
|
if (this.tsMatchLeftRelational() || this.match(o.bitShift)) {
|
|
4871
|
-
var L,
|
|
4871
|
+
var L, k = this.tsTryParseAndCatch(function() {
|
|
4872
4872
|
if (!c && x.atPossibleAsyncArrow(i)) {
|
|
4873
4873
|
var Ce = x.tsTryParseGenericAsyncArrowFunction(s, n, y);
|
|
4874
4874
|
if (Ce) return i = Ce;
|
|
@@ -4881,8 +4881,8 @@ function Es(t) {
|
|
|
4881
4881
|
return ke.typeParameters = Wt, ke;
|
|
4882
4882
|
}
|
|
4883
4883
|
if (!c && x.eat(o.parenL)) {
|
|
4884
|
-
var Ae = new
|
|
4885
|
-
return
|
|
4884
|
+
var Ae = new Ot(), Ct = x.startNodeAt(s, n);
|
|
4885
|
+
return Ct.callee = i, Ct.arguments = x.parseExprList(o.parenR, x.options.ecmaVersion >= 8, !1, Ae), x.tsCheckForInvalidTypeCasts(Ct.arguments), Ct.typeParameters = Wt, b && (Ct.optional = E), x.checkExpressionErrors(Ae, !0), i = x.finishNode(Ct, "CallExpression");
|
|
4886
4886
|
}
|
|
4887
4887
|
var ae = x.type;
|
|
4888
4888
|
if (!(x.tsMatchRightRelational() || ae === o.bitShift || ae !== o.parenL && (we = ae, !!we.startsExpr) && !x.hasPrecedingLineBreak())) {
|
|
@@ -4890,29 +4890,29 @@ function Es(t) {
|
|
|
4890
4890
|
return ne.expression = i, ne.typeParameters = Wt, x.finishNode(ne, "TSInstantiationExpression");
|
|
4891
4891
|
}
|
|
4892
4892
|
});
|
|
4893
|
-
if (L && this.unexpected(L),
|
|
4893
|
+
if (L && this.unexpected(L), k) return k.type === "TSInstantiationExpression" && (this.match(o.dot) || this.match(o.questionDot) && this.lookaheadCharCode() !== 40) && this.raise(this.start, w.InvalidPropertyAccessAfterInstantiationExpression), i = k;
|
|
4894
4894
|
}
|
|
4895
|
-
var
|
|
4896
|
-
c &&
|
|
4895
|
+
var H = this.options.ecmaVersion >= 11, U = H && this.eat(o.questionDot);
|
|
4896
|
+
c && U && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
4897
4897
|
var W = this.eat(o.bracketL);
|
|
4898
|
-
if (W ||
|
|
4899
|
-
var
|
|
4900
|
-
|
|
4898
|
+
if (W || U && this.type !== o.parenL && this.type !== o.backQuote || this.eat(o.dot)) {
|
|
4899
|
+
var G = this.startNodeAt(s, n);
|
|
4900
|
+
G.object = i, W ? (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 = !!W, H && (G.optional = U), i = this.finishNode(G, "MemberExpression");
|
|
4901
4901
|
} else if (!c && this.eat(o.parenL)) {
|
|
4902
4902
|
var rt = this.maybeInArrowParameters;
|
|
4903
4903
|
this.maybeInArrowParameters = !0;
|
|
4904
|
-
var vt = new
|
|
4904
|
+
var vt = new Ot(), _t = this.yieldPos, Nt = this.awaitPos, gt = this.awaitIdentPos;
|
|
4905
4905
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
4906
4906
|
var Pe = this.parseExprList(o.parenR, this.options.ecmaVersion >= 8, !1, vt);
|
|
4907
|
-
if (l && !
|
|
4907
|
+
if (l && !U && this.shouldParseAsyncArrow()) this.checkPatternErrors(vt, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = _t, this.awaitPos = Nt, this.awaitIdentPos = gt, i = this.parseSubscriptAsyncArrow(s, n, Pe, y);
|
|
4908
4908
|
else {
|
|
4909
|
-
this.checkExpressionErrors(vt, !0), this.yieldPos =
|
|
4910
|
-
var
|
|
4911
|
-
|
|
4909
|
+
this.checkExpressionErrors(vt, !0), this.yieldPos = _t || this.yieldPos, this.awaitPos = Nt || this.awaitPos, this.awaitIdentPos = gt || this.awaitIdentPos;
|
|
4910
|
+
var Ht = this.startNodeAt(s, n);
|
|
4911
|
+
Ht.callee = i, Ht.arguments = Pe, H && (Ht.optional = U), i = this.finishNode(Ht, "CallExpression");
|
|
4912
4912
|
}
|
|
4913
4913
|
this.maybeInArrowParameters = rt;
|
|
4914
4914
|
} else if (this.type === o.backQuote) {
|
|
4915
|
-
(
|
|
4915
|
+
(U || b) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
4916
4916
|
var re = this.startNodeAt(s, n);
|
|
4917
4917
|
re.tag = i, re.quasi = this.parseTemplate({ isTagged: !0 }), i = this.finishNode(re, "TaggedTemplateExpression");
|
|
4918
4918
|
}
|
|
@@ -4960,7 +4960,7 @@ function Es(t) {
|
|
|
4960
4960
|
var m = this.startNode(), y = this.yieldPos, x = this.awaitPos, b = this.awaitIdentPos;
|
|
4961
4961
|
if (this.initFunction(m), this.options.ecmaVersion >= 6 && (m.generator = i), this.options.ecmaVersion >= 8 && (m.async = !!s), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | pe(s, 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, l && l.abstract && m.body) {
|
|
4962
4962
|
var S = l.key;
|
|
4963
|
-
this.raise(l.start,
|
|
4963
|
+
this.raise(l.start, w.AbstractMethodHasImplementation({ methodName: S.type !== "Identifier" || l.computed ? "[" + this.input.slice(S.start, S.end) + "]" : S.name }));
|
|
4964
4964
|
}
|
|
4965
4965
|
return this.finishNode(m, "FunctionExpression");
|
|
4966
4966
|
}, it.parse = function(i, s) {
|
|
@@ -4994,10 +4994,10 @@ function Es(t) {
|
|
|
4994
4994
|
var E = this.parseIdent();
|
|
4995
4995
|
if (this.isContextual("as")) {
|
|
4996
4996
|
var L = this.parseIdent();
|
|
4997
|
-
|
|
4998
|
-
} else
|
|
4999
|
-
} else
|
|
5000
|
-
x && n && this.raise(S, s ?
|
|
4997
|
+
qt(this.type) ? (x = !0, y = E, c = s ? this.parseIdent() : this.parseModuleExportName(), b = !1) : (c = L, b = !1);
|
|
4998
|
+
} else qt(this.type) ? (b = !1, c = s ? this.parseIdent() : this.parseModuleExportName()) : (x = !0, y = E);
|
|
4999
|
+
} else qt(this.type) && (x = !0, s ? (y = T.prototype.parseIdent.call(this, !0), this.isContextual("as") || this.checkUnreserved(y)) : y = this.parseModuleExportName());
|
|
5000
|
+
x && n && this.raise(S, s ? w.TypeModifierIsUsedInTypeImports : w.TypeModifierIsUsedInTypeExports), i[l] = y, i[m] = c, i[s ? "importKind" : "exportKind"] = x ? "type" : "value", b && this.eatContextual("as") && (i[m] = s ? this.parseIdent() : this.parseModuleExportName()), i[m] || (i[m] = this.copyNode(i[l])), s && this.checkLValSimple(i[m], 2);
|
|
5001
5001
|
}, p.raiseCommonCheck = function(i, s, n) {
|
|
5002
5002
|
return s === "Comma is not permitted after the rest element" ? this.isAmbientContext && this.match(o.comma) && this.lookaheadCharCode() === 41 ? void this.next() : T.prototype.raise.call(this, i, s) : n ? T.prototype.raiseRecoverable.call(this, i, s) : T.prototype.raise.call(this, i, s);
|
|
5003
5003
|
}, p.raiseRecoverable = function(i, s) {
|
|
@@ -5008,10 +5008,10 @@ function Es(t) {
|
|
|
5008
5008
|
var s = this.type;
|
|
5009
5009
|
if (s == o.braceL) {
|
|
5010
5010
|
var n = this.curContext();
|
|
5011
|
-
n ==
|
|
5011
|
+
n == et.tc_oTag ? this.context.push(z.b_expr) : n == et.tc_expr ? this.context.push(z.b_tmpl) : T.prototype.updateContext.call(this, i), this.exprAllowed = !0;
|
|
5012
5012
|
} else {
|
|
5013
5013
|
if (s !== o.slash || i !== I.jsxTagStart) return T.prototype.updateContext.call(this, i);
|
|
5014
|
-
this.context.length -= 2, this.context.push(
|
|
5014
|
+
this.context.length -= 2, this.context.push(et.tc_cTag), this.exprAllowed = !1;
|
|
5015
5015
|
}
|
|
5016
5016
|
}, p.jsx_parseOpeningElementAt = function(i, s) {
|
|
5017
5017
|
var n = this, c = this.startNodeAt(i, s), l = this.jsx_parseElementName();
|
|
@@ -5024,11 +5024,11 @@ function Es(t) {
|
|
|
5024
5024
|
for (c.attributes = []; this.type !== o.slash && this.type !== I.jsxTagEnd; ) c.attributes.push(this.jsx_parseAttribute());
|
|
5025
5025
|
return c.selfClosing = this.eat(o.slash), this.expect(I.jsxTagEnd), this.finishNode(c, l ? "JSXOpeningElement" : "JSXOpeningFragment");
|
|
5026
5026
|
}, p.enterScope = function(i) {
|
|
5027
|
-
i ===
|
|
5027
|
+
i === Lt && this.importsStack.push([]), T.prototype.enterScope.call(this, i);
|
|
5028
5028
|
var s = T.prototype.currentScope.call(this);
|
|
5029
5029
|
s.types = [], s.enums = [], s.constEnums = [], s.classes = [], s.exportOnlyBindings = [];
|
|
5030
5030
|
}, p.exitScope = function() {
|
|
5031
|
-
T.prototype.currentScope.call(this).flags ===
|
|
5031
|
+
T.prototype.currentScope.call(this).flags === Lt && this.importsStack.pop(), T.prototype.exitScope.call(this);
|
|
5032
5032
|
}, p.hasImport = function(i, s) {
|
|
5033
5033
|
var n = this.importsStack.length;
|
|
5034
5034
|
if (this.importsStack[n - 1].indexOf(i) > -1) return !0;
|
|
@@ -5056,16 +5056,16 @@ function Es(t) {
|
|
|
5056
5056
|
}
|
|
5057
5057
|
T.prototype.checkLocalExport.call(this, i);
|
|
5058
5058
|
}
|
|
5059
|
-
},
|
|
5060
|
-
return
|
|
5061
|
-
} }], (
|
|
5062
|
-
return
|
|
5063
|
-
} }]) && Oe(
|
|
5059
|
+
}, Q = it, F = [{ key: "acornTypeScript", get: function() {
|
|
5060
|
+
return v;
|
|
5061
|
+
} }], (J = [{ key: "acornTypeScript", get: function() {
|
|
5062
|
+
return v;
|
|
5063
|
+
} }]) && Oe(Q.prototype, J), F && Oe(Q, F), Object.defineProperty(Q, "prototype", { writable: !1 }), it;
|
|
5064
5064
|
})(d);
|
|
5065
5065
|
return wi;
|
|
5066
5066
|
};
|
|
5067
5067
|
}
|
|
5068
|
-
const Is = ["createObject", "dropObject", "removeRecords", "upsertRecords"], _s = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"],
|
|
5068
|
+
const Is = ["createObject", "dropObject", "removeRecords", "upsertRecords"], _s = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"], Dt = _i(Ei);
|
|
5069
5069
|
async function Ms() {
|
|
5070
5070
|
try {
|
|
5071
5071
|
console.info("đ Building configuration...");
|
|
@@ -5081,26 +5081,26 @@ async function Ds(t) {
|
|
|
5081
5081
|
const e = {};
|
|
5082
5082
|
async function r(u, f) {
|
|
5083
5083
|
console.info(`âī¸ Processing directory '${u}'...`);
|
|
5084
|
-
const d = [],
|
|
5085
|
-
e[
|
|
5086
|
-
for (const
|
|
5087
|
-
const o = `${u}/${
|
|
5084
|
+
const d = [], g = u.slice(`public/${t}`.length);
|
|
5085
|
+
e[g === "" ? "/" : g] = d;
|
|
5086
|
+
for (const v of f) {
|
|
5087
|
+
const o = `${u}/${v}`;
|
|
5088
5088
|
try {
|
|
5089
|
-
const
|
|
5090
|
-
if (
|
|
5091
|
-
const
|
|
5092
|
-
d.push(M), await r(o,
|
|
5089
|
+
const C = await R.stat(o);
|
|
5090
|
+
if (C.isDirectory()) {
|
|
5091
|
+
const _ = await R.readdir(o), M = { childCount: _.length, name: v, typeId: "folder" };
|
|
5092
|
+
d.push(M), await r(o, _);
|
|
5093
5093
|
} else {
|
|
5094
|
-
const
|
|
5095
|
-
d.push(
|
|
5094
|
+
const _ = { id: Ii(), lastModifiedAt: C.mtimeMs, name: v, size: C.size, typeId: "object" };
|
|
5095
|
+
d.push(_);
|
|
5096
5096
|
}
|
|
5097
|
-
} catch (
|
|
5098
|
-
throw new Error(`Unable to get information for '${
|
|
5097
|
+
} catch (C) {
|
|
5098
|
+
throw new Error(`Unable to get information for '${v}' in 'buildPublicDirectoryIndex'. ${String(C)}`);
|
|
5099
5099
|
}
|
|
5100
5100
|
}
|
|
5101
|
-
d.sort((
|
|
5102
|
-
const
|
|
5103
|
-
return
|
|
5101
|
+
d.sort((v, o) => {
|
|
5102
|
+
const C = v.typeId.localeCompare(o.typeId);
|
|
5103
|
+
return C === 0 ? v.name.localeCompare(o.name) : C;
|
|
5104
5104
|
});
|
|
5105
5105
|
}
|
|
5106
5106
|
const a = await R.readdir(`public/${t}`);
|
|
@@ -5111,36 +5111,24 @@ async function Ds(t) {
|
|
|
5111
5111
|
}
|
|
5112
5112
|
async function Vs() {
|
|
5113
5113
|
try {
|
|
5114
|
-
let t = function(
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
break;
|
|
5119
|
-
}
|
|
5120
|
-
case "MethodDefinition": {
|
|
5121
|
-
const B = j, I = B.key.name, X = I === "constructor", Ct = B.accessibility ?? !1;
|
|
5122
|
-
console.log(3333, I, X, Ct), I && !X && !Ct && d.add(I);
|
|
5123
|
-
break;
|
|
5124
|
-
}
|
|
5114
|
+
let t = function(C) {
|
|
5115
|
+
if (C.type === "MethodDefinition") {
|
|
5116
|
+
const _ = C, q = _.key.name, z = q === "constructor", $ = _.accessibility ?? !1;
|
|
5117
|
+
console.log(3333, q, z, $), q && !z && !$ && (v.push(q), Is.includes(q) && (u = !0), _s.includes(q) && (f = !0));
|
|
5125
5118
|
}
|
|
5126
|
-
for (const
|
|
5127
|
-
if (
|
|
5128
|
-
const
|
|
5129
|
-
Array.isArray(
|
|
5119
|
+
for (const _ in C) {
|
|
5120
|
+
if (_ === "loc" || _ === "range" || _ === "start" || _ === "end" || _ === "comments") continue;
|
|
5121
|
+
const M = C[_];
|
|
5122
|
+
Array.isArray(M) ? M.forEach(t) : M && typeof M == "object" && typeof M.type == "string" && t(M);
|
|
5130
5123
|
}
|
|
5131
5124
|
};
|
|
5132
5125
|
console.info("đ Building connector configuration...");
|
|
5133
|
-
const e = JSON.parse(await R.readFile("package.json", "utf8")), r = JSON.parse(await R.readFile("config.json", "utf8")), a = await R.readFile("src/index.ts", "utf8")
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
N.push(B), Is.includes(B) && (v = !0), _s.includes(B) && (g = !0);
|
|
5140
|
-
}
|
|
5141
|
-
N.length > 0 ? console.info(`âšī¸ Implements ${N.length} operations.`) : console.warn("â ī¸ Implements no operations.");
|
|
5142
|
-
let M;
|
|
5143
|
-
g && v ? M = "bidirectional" : g ? M = "source" : v ? M = "destination" : M = "unknown", M === "unknown" ? console.warn("â ī¸ No usage identified.") : console.info(`âšī¸ Supports ${M} usage.`), e.name != null && (r.id = e.name), r.operations = N, r.usageId = M, e.version != null && (r.version = e.version), await R.writeFile("config.json", JSON.stringify(r, void 0, 4), "utf8"), console.info("â
Connector configuration built.");
|
|
5126
|
+
const e = JSON.parse(await R.readFile("package.json", "utf8")), r = JSON.parse(await R.readFile("config.json", "utf8")), a = await R.readFile("src/index.ts", "utf8");
|
|
5127
|
+
let u = !1, f = !1;
|
|
5128
|
+
const g = K.extend(Es()).parse(a, { ecmaVersion: "latest", sourceType: "module", locations: !0 }), v = [];
|
|
5129
|
+
t(g), console.log(`Extracted ${v.length} functions:`, [...v]), v.length > 0 ? console.info(`âšī¸ Implements ${v.length} operations.`) : console.warn("â ī¸ Implements no operations.");
|
|
5130
|
+
let o;
|
|
5131
|
+
f && u ? o = "bidirectional" : f ? o = "source" : u ? o = "destination" : o = "unknown", o === "unknown" ? console.warn("â ī¸ No usage identified.") : console.info(`âšī¸ Supports ${o} usage.`), e.name != null && (r.id = e.name), r.operations = v, r.usageId = o, e.version != null && (r.version = e.version), await R.writeFile("config.json", JSON.stringify(r, void 0, 4), "utf8"), console.info("â
Connector configuration built.");
|
|
5144
5132
|
} catch (t) {
|
|
5145
5133
|
console.error("â Error building connector configuration.", t);
|
|
5146
5134
|
}
|
|
@@ -5197,11 +5185,11 @@ async function Hs() {
|
|
|
5197
5185
|
const t = "<!-- OWASP_BADGE_START -->", e = "<!-- OWASP_BADGE_END -->";
|
|
5198
5186
|
try {
|
|
5199
5187
|
const r = JSON.parse(await R.readFile("./dependency-check-reports/dependency-check-report.json", "utf-8")), a = { critical: 0, high: 0, moderate: 0, low: 0, unknown: 0 };
|
|
5200
|
-
for (const
|
|
5201
|
-
if (
|
|
5202
|
-
for (const
|
|
5203
|
-
const
|
|
5204
|
-
|
|
5188
|
+
for (const q of r.dependencies)
|
|
5189
|
+
if (q.vulnerabilities != null)
|
|
5190
|
+
for (const z of q.vulnerabilities) {
|
|
5191
|
+
const $ = z.severity?.toLowerCase() ?? "unknown";
|
|
5192
|
+
$ in a ? a[$]++ : a.unknown++;
|
|
5205
5193
|
}
|
|
5206
5194
|
const u = {
|
|
5207
5195
|
critical: { color: "D32F2F", label: "critical" },
|
|
@@ -5210,24 +5198,24 @@ async function Hs() {
|
|
|
5210
5198
|
low: { color: "6D8C31", label: "low" },
|
|
5211
5199
|
unknown: { color: "616161", label: "unknown" }
|
|
5212
5200
|
}, f = JSON.parse(await R.readFile("config.json", "utf8")), d = [];
|
|
5213
|
-
if (Object.values(a).reduce((
|
|
5201
|
+
if (Object.values(a).reduce((q, z) => q + z, 0) === 0)
|
|
5214
5202
|
console.info("â
No vulnerabilities found."), d.push(`[](https://data-positioning.github.io/${f.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
5215
5203
|
else
|
|
5216
|
-
for (const [
|
|
5217
|
-
const
|
|
5218
|
-
if (console.warn(`â ī¸ ${
|
|
5219
|
-
const I = `https://img.shields.io/badge/OWASP-${
|
|
5204
|
+
for (const [q, z] of Object.entries(a)) {
|
|
5205
|
+
const $ = u[q];
|
|
5206
|
+
if (console.warn(`â ī¸ ${z} ${$.label} vulnerability(ies) found.`), z === 0) continue;
|
|
5207
|
+
const I = `https://img.shields.io/badge/OWASP-${z}%20${$.label}-${$.color}`;
|
|
5220
5208
|
d.push(`[](https://data-positioning.github.io/${f.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
5221
5209
|
}
|
|
5222
|
-
const
|
|
5223
|
-
(o === -1 ||
|
|
5224
|
-
const
|
|
5210
|
+
const v = await R.readFile("./README.md", "utf8"), o = v.indexOf(t), C = v.indexOf(e);
|
|
5211
|
+
(o === -1 || C === -1) && (console.error("â OWASP badge markers not found in README.md."), process.exit(1));
|
|
5212
|
+
const _ = d.join(" "), M = v.substring(0, o + t.length) + _ + v.substring(C);
|
|
5225
5213
|
await R.writeFile("README.md", M, "utf8"), console.info("â
OWASP dependency check badge(s) inserted into README.md");
|
|
5226
5214
|
} catch (r) {
|
|
5227
5215
|
console.error("â Error updating README with OWASP badges:", r), process.exit(1);
|
|
5228
5216
|
}
|
|
5229
5217
|
}
|
|
5230
|
-
async function
|
|
5218
|
+
async function Ws() {
|
|
5231
5219
|
try {
|
|
5232
5220
|
console.info("đ Sending deployment notice...");
|
|
5233
5221
|
const t = JSON.parse(await R.readFile("config.json", "utf8")), e = {
|
|
@@ -5241,27 +5229,27 @@ async function zs() {
|
|
|
5241
5229
|
console.error("â Error sending deployment notice.", t);
|
|
5242
5230
|
}
|
|
5243
5231
|
}
|
|
5244
|
-
async function
|
|
5232
|
+
async function Ks() {
|
|
5245
5233
|
try {
|
|
5246
5234
|
console.info("đ Synchronising with GitHub....");
|
|
5247
5235
|
const t = JSON.parse(await R.readFile("package.json", "utf8"));
|
|
5248
|
-
await
|
|
5236
|
+
await Dt("git add ."), await Dt(`git commit -m "v${t.version}"`), await Dt("git push origin main:main"), console.info(`â
Synchronised version ${t.version} with GitHub.`);
|
|
5249
5237
|
} catch (t) {
|
|
5250
5238
|
console.error("â Error synchronising with GitHub.", t);
|
|
5251
5239
|
}
|
|
5252
5240
|
}
|
|
5253
|
-
async function
|
|
5241
|
+
async function zs(t, e) {
|
|
5254
5242
|
try {
|
|
5255
5243
|
console.info("đ Uploading directory to R2....");
|
|
5256
5244
|
async function r(u, f, d) {
|
|
5257
|
-
for (const
|
|
5258
|
-
const
|
|
5259
|
-
if ((await R.stat(
|
|
5260
|
-
const
|
|
5261
|
-
await r(
|
|
5245
|
+
for (const g of d) {
|
|
5246
|
+
const v = `${u}/${g}`, o = `${f}/${g}`;
|
|
5247
|
+
if ((await R.stat(v)).isDirectory()) {
|
|
5248
|
+
const _ = await R.readdir(v);
|
|
5249
|
+
await r(v, o, _);
|
|
5262
5250
|
} else {
|
|
5263
|
-
console.info(`âī¸ Uploading '${u}/${
|
|
5264
|
-
const
|
|
5251
|
+
console.info(`âī¸ Uploading '${u}/${g}'...`);
|
|
5252
|
+
const _ = `wrangler r2 object put "datapos-sample-data-eu/${f}/${g}" --file="${u}/${g}" --jurisdiction=eu --remote`, M = await Dt(_);
|
|
5265
5253
|
if (M.stderr) throw new Error(M.stderr);
|
|
5266
5254
|
}
|
|
5267
5255
|
}
|
|
@@ -5292,12 +5280,12 @@ async function Gs(t) {
|
|
|
5292
5280
|
const r = `v${JSON.parse(await R.readFile("package.json", "utf8")).version}`;
|
|
5293
5281
|
async function a(u, f = "") {
|
|
5294
5282
|
const d = await R.readdir(u, { withFileTypes: !0 });
|
|
5295
|
-
for (const
|
|
5296
|
-
const
|
|
5297
|
-
if (!
|
|
5298
|
-
const
|
|
5299
|
-
console.info(`âī¸ Uploading '${o}' â '${
|
|
5300
|
-
const { stderr: M } = await
|
|
5283
|
+
for (const g of d) {
|
|
5284
|
+
const v = `${u}/${g.name}`, o = f ? `${f}/${g.name}` : g.name;
|
|
5285
|
+
if (!g.isDirectory()) {
|
|
5286
|
+
const C = `${t}_${r}/${o}`.replace(/\\/g, "/"), _ = g.name.endsWith(".js") ? "application/javascript" : g.name.endsWith(".css") ? "text/css" : "application/octet-stream";
|
|
5287
|
+
console.info(`âī¸ Uploading '${o}' â '${C}'...`);
|
|
5288
|
+
const { stderr: M } = await Dt(`wrangler r2 object put "${C}" --file="${v}" --content-type ${_} --jurisdiction=eu --remote`);
|
|
5301
5289
|
if (M) throw new Error(M);
|
|
5302
5290
|
}
|
|
5303
5291
|
}
|
|
@@ -5317,9 +5305,9 @@ export {
|
|
|
5317
5305
|
Us as echoScriptNotImplemented,
|
|
5318
5306
|
qs as insertLicensesIntoReadme,
|
|
5319
5307
|
Hs as insertOWASPDependencyCheckBadgeIntoReadme,
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5308
|
+
Ws as sendDeploymentNotice,
|
|
5309
|
+
Ks as syncWithGitHub,
|
|
5310
|
+
zs as uploadDirectoryToR2,
|
|
5323
5311
|
Js as uploadModuleConfigToDO,
|
|
5324
5312
|
Gs as uploadModuleToR2
|
|
5325
5313
|
};
|