@highstate/designer 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +3 -3
- package/.output/public/_nuxt/1_b4y8eQ.js +1 -0
- package/.output/public/_nuxt/BjOhMR1f.js +242 -0
- package/.output/public/_nuxt/CPAAHz3G.js +1 -0
- package/.output/public/_nuxt/{TC7QuZux.js → CmGpyJTe.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/f777d22c-e958-4e7c-865d-11bb8a560858.json +1 -0
- package/.output/public/_nuxt/{entry.DpeBhKHh.css → entry.Vs8IncyG.css} +1 -1
- package/.output/server/index.mjs +1876 -3051
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/@babel/parser/lib/index.js +129 -97
- package/.output/server/node_modules/@babel/parser/package.json +2 -2
- package/.output/server/node_modules/@trpc/server/dist/adapters/fetch/fetchRequestHandler.mjs +74 -0
- package/.output/server/node_modules/@trpc/server/dist/adapters/fetch/index.mjs +1 -0
- package/.output/server/node_modules/@trpc/server/dist/adapters/node-http/incomingMessageToRequest.mjs +119 -0
- package/.output/server/node_modules/@trpc/server/dist/adapters/node-http/index.mjs +2 -0
- package/.output/server/node_modules/@trpc/server/dist/adapters/node-http/nodeHTTPRequestHandler.mjs +92 -0
- package/.output/server/node_modules/@trpc/server/dist/adapters/node-http/writeResponse.mjs +79 -0
- package/.output/server/node_modules/@trpc/server/dist/index.mjs +1 -1
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/middleware.mjs +1 -1
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/parser.mjs +4 -3
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs +3 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs +1 -1
- package/.output/server/node_modules/@trpc/server/package.json +6 -6
- package/.output/server/node_modules/unhead/dist/plugins.mjs +94 -0
- package/.output/server/node_modules/unhead/dist/server.mjs +220 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.C13swrCa.mjs +48 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +148 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Cp0iF6eN.mjs +177 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DZbvapt-.mjs +70 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DeCxexjU.mjs +166 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Txd0XTIP.mjs +172 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
- package/.output/server/node_modules/unhead/dist/utils.mjs +5 -0
- package/.output/server/node_modules/unhead/package.json +66 -11
- package/.output/server/package.json +1 -1
- package/package.json +8 -8
- package/.output/public/_nuxt/B3Ns2-bM.js +0 -1
- package/.output/public/_nuxt/DToExo9V.js +0 -1
- package/.output/public/_nuxt/builds/meta/f64fe243-c5f1-4f5e-a593-05cf555884c2.json +0 -1
- package/.output/public/_nuxt/u3nCRAjk.js +0 -244
- package/.output/server/node_modules/@trpc/server/dist/http.mjs +0 -7
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/contentTypeParsers.mjs +0 -12
- package/.output/server/node_modules/@unhead/dom/dist/index.mjs +0 -197
- package/.output/server/node_modules/@unhead/dom/package.json +0 -40
- package/.output/server/node_modules/@unhead/shared/dist/index.mjs +0 -641
- package/.output/server/node_modules/@unhead/shared/package.json +0 -45
- package/.output/server/node_modules/@unhead/ssr/dist/index.mjs +0 -95
- package/.output/server/node_modules/@unhead/ssr/package.json +0 -40
- package/.output/server/node_modules/node-mock-http/dist/_polyfill/buffer/node.mjs +0 -1
- package/.output/server/node_modules/node-mock-http/dist/_polyfill/events/node.mjs +0 -1
- package/.output/server/node_modules/node-mock-http/dist/index.mjs +0 -1
- package/.output/server/node_modules/node-mock-http/package.json +0 -63
- package/.output/server/node_modules/packrup/dist/index.mjs +0 -108
- package/.output/server/node_modules/packrup/package.json +0 -58
- package/.output/server/node_modules/unhead/dist/index.mjs +0 -748
|
@@ -7,7 +7,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
7
7
|
if (null == r) return {};
|
|
8
8
|
var t = {};
|
|
9
9
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
10
|
-
if (e.
|
|
10
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
11
11
|
t[n] = r[n];
|
|
12
12
|
}
|
|
13
13
|
return t;
|
|
@@ -88,7 +88,6 @@ var StandardErrors = {
|
|
|
88
88
|
AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.",
|
|
89
89
|
AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.",
|
|
90
90
|
AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.",
|
|
91
|
-
AwaitNotInAsyncFunction: "'await' is only allowed within async functions.",
|
|
92
91
|
BadGetterArity: "A 'get' accessor must not have any formal parameters.",
|
|
93
92
|
BadSetterArity: "A 'set' accessor must have exactly one formal parameter.",
|
|
94
93
|
BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.",
|
|
@@ -291,6 +290,7 @@ var StandardErrors = {
|
|
|
291
290
|
}) => `Identifier '${identifierName}' has already been declared.`,
|
|
292
291
|
YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.",
|
|
293
292
|
YieldInParameter: "Yield expression is not allowed in formal parameters.",
|
|
293
|
+
YieldNotInGeneratorFunction: "'yield' is only allowed within generator functions.",
|
|
294
294
|
ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0."
|
|
295
295
|
};
|
|
296
296
|
var StrictModeErrors = {
|
|
@@ -434,6 +434,7 @@ function createDefaultOptions() {
|
|
|
434
434
|
allowImportExportEverywhere: false,
|
|
435
435
|
allowSuperOutsideMethod: false,
|
|
436
436
|
allowUndeclaredExports: false,
|
|
437
|
+
allowYieldOutsideFunction: false,
|
|
437
438
|
plugins: [],
|
|
438
439
|
strictMode: null,
|
|
439
440
|
ranges: false,
|
|
@@ -488,7 +489,7 @@ function toESTreeLocation(node) {
|
|
|
488
489
|
var estree = superClass => class ESTreeParserMixin extends superClass {
|
|
489
490
|
parse() {
|
|
490
491
|
const file = toESTreeLocation(super.parse());
|
|
491
|
-
if (this.optionFlags &
|
|
492
|
+
if (this.optionFlags & 256) {
|
|
492
493
|
file.tokens = file.tokens.map(toESTreeLocation);
|
|
493
494
|
}
|
|
494
495
|
return file;
|
|
@@ -669,6 +670,16 @@ var estree = superClass => class ESTreeParserMixin extends superClass {
|
|
|
669
670
|
propertyNode.computed = false;
|
|
670
671
|
return propertyNode;
|
|
671
672
|
}
|
|
673
|
+
parseClassAccessorProperty(node) {
|
|
674
|
+
const accessorPropertyNode = super.parseClassAccessorProperty(node);
|
|
675
|
+
{
|
|
676
|
+
if (!this.getPluginOption("estree", "classFeatures")) {
|
|
677
|
+
return accessorPropertyNode;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
accessorPropertyNode.type = "AccessorProperty";
|
|
681
|
+
return accessorPropertyNode;
|
|
682
|
+
}
|
|
672
683
|
parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
|
|
673
684
|
const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor);
|
|
674
685
|
if (node) {
|
|
@@ -2374,7 +2385,7 @@ class Tokenizer extends CommentsParser {
|
|
|
2374
2385
|
this.tokens = [];
|
|
2375
2386
|
this.errorHandlers_readInt = {
|
|
2376
2387
|
invalidDigit: (pos, lineStart, curLine, radix) => {
|
|
2377
|
-
if (!(this.optionFlags &
|
|
2388
|
+
if (!(this.optionFlags & 2048)) return false;
|
|
2378
2389
|
this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), {
|
|
2379
2390
|
radix
|
|
2380
2391
|
});
|
|
@@ -2415,7 +2426,7 @@ class Tokenizer extends CommentsParser {
|
|
|
2415
2426
|
}
|
|
2416
2427
|
next() {
|
|
2417
2428
|
this.checkKeywordEscapes();
|
|
2418
|
-
if (this.optionFlags &
|
|
2429
|
+
if (this.optionFlags & 256) {
|
|
2419
2430
|
this.pushToken(new Token(this.state));
|
|
2420
2431
|
}
|
|
2421
2432
|
this.state.lastTokEndLoc = this.state.endLoc;
|
|
@@ -2531,7 +2542,7 @@ class Tokenizer extends CommentsParser {
|
|
|
2531
2542
|
end: this.sourceToOffsetPos(end + commentEnd.length),
|
|
2532
2543
|
loc: new SourceLocation(startLoc, this.state.curPosition())
|
|
2533
2544
|
};
|
|
2534
|
-
if (this.optionFlags &
|
|
2545
|
+
if (this.optionFlags & 256) this.pushToken(comment);
|
|
2535
2546
|
return comment;
|
|
2536
2547
|
}
|
|
2537
2548
|
skipLineComment(startSkip) {
|
|
@@ -2554,12 +2565,12 @@ class Tokenizer extends CommentsParser {
|
|
|
2554
2565
|
end: this.sourceToOffsetPos(end),
|
|
2555
2566
|
loc: new SourceLocation(startLoc, this.state.curPosition())
|
|
2556
2567
|
};
|
|
2557
|
-
if (this.optionFlags &
|
|
2568
|
+
if (this.optionFlags & 256) this.pushToken(comment);
|
|
2558
2569
|
return comment;
|
|
2559
2570
|
}
|
|
2560
2571
|
skipSpace() {
|
|
2561
2572
|
const spaceStart = this.state.pos;
|
|
2562
|
-
const comments = this.optionFlags &
|
|
2573
|
+
const comments = this.optionFlags & 4096 ? [] : null;
|
|
2563
2574
|
loop: while (this.state.pos < this.length) {
|
|
2564
2575
|
const ch = this.input.charCodeAt(this.state.pos);
|
|
2565
2576
|
switch (ch) {
|
|
@@ -2606,7 +2617,7 @@ class Tokenizer extends CommentsParser {
|
|
|
2606
2617
|
default:
|
|
2607
2618
|
if (isWhitespace(ch)) {
|
|
2608
2619
|
++this.state.pos;
|
|
2609
|
-
} else if (ch === 45 && !this.inModule && this.optionFlags &
|
|
2620
|
+
} else if (ch === 45 && !this.inModule && this.optionFlags & 8192) {
|
|
2610
2621
|
const pos = this.state.pos;
|
|
2611
2622
|
if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) {
|
|
2612
2623
|
const comment = this.skipLineComment(3);
|
|
@@ -2617,7 +2628,7 @@ class Tokenizer extends CommentsParser {
|
|
|
2617
2628
|
} else {
|
|
2618
2629
|
break loop;
|
|
2619
2630
|
}
|
|
2620
|
-
} else if (ch === 60 && !this.inModule && this.optionFlags &
|
|
2631
|
+
} else if (ch === 60 && !this.inModule && this.optionFlags & 8192) {
|
|
2621
2632
|
const pos = this.state.pos;
|
|
2622
2633
|
if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) {
|
|
2623
2634
|
const comment = this.skipLineComment(4);
|
|
@@ -3325,7 +3336,7 @@ class Tokenizer extends CommentsParser {
|
|
|
3325
3336
|
raise(toParseError, at, details = {}) {
|
|
3326
3337
|
const loc = at instanceof Position ? at : at.loc.start;
|
|
3327
3338
|
const error = toParseError(loc, details);
|
|
3328
|
-
if (!(this.optionFlags &
|
|
3339
|
+
if (!(this.optionFlags & 2048)) throw error;
|
|
3329
3340
|
if (!this.isLookahead) this.state.errors.push(error);
|
|
3330
3341
|
return error;
|
|
3331
3342
|
}
|
|
@@ -3783,6 +3794,9 @@ class UtilParser extends Tokenizer {
|
|
|
3783
3794
|
if (this.inModule) {
|
|
3784
3795
|
paramFlags |= 2;
|
|
3785
3796
|
}
|
|
3797
|
+
if (this.optionFlags & 32) {
|
|
3798
|
+
paramFlags |= 1;
|
|
3799
|
+
}
|
|
3786
3800
|
this.scope.enter(1);
|
|
3787
3801
|
this.prodParam.enter(paramFlags);
|
|
3788
3802
|
}
|
|
@@ -3809,7 +3823,7 @@ class Node {
|
|
|
3809
3823
|
this.start = pos;
|
|
3810
3824
|
this.end = 0;
|
|
3811
3825
|
this.loc = new SourceLocation(loc);
|
|
3812
|
-
if ((parser == null ? void 0 : parser.optionFlags) &
|
|
3826
|
+
if ((parser == null ? void 0 : parser.optionFlags) & 128) this.range = [pos, 0];
|
|
3813
3827
|
if (parser != null && parser.filename) this.loc.filename = parser.filename;
|
|
3814
3828
|
}
|
|
3815
3829
|
}
|
|
@@ -3897,8 +3911,8 @@ class NodeUtils extends UtilParser {
|
|
|
3897
3911
|
node.type = type;
|
|
3898
3912
|
node.end = endLoc.index;
|
|
3899
3913
|
node.loc.end = endLoc;
|
|
3900
|
-
if (this.optionFlags &
|
|
3901
|
-
if (this.optionFlags &
|
|
3914
|
+
if (this.optionFlags & 128) node.range[1] = endLoc.index;
|
|
3915
|
+
if (this.optionFlags & 4096) {
|
|
3902
3916
|
this.processComment(node);
|
|
3903
3917
|
}
|
|
3904
3918
|
return node;
|
|
@@ -3906,12 +3920,12 @@ class NodeUtils extends UtilParser {
|
|
|
3906
3920
|
resetStartLocation(node, startLoc) {
|
|
3907
3921
|
node.start = startLoc.index;
|
|
3908
3922
|
node.loc.start = startLoc;
|
|
3909
|
-
if (this.optionFlags &
|
|
3923
|
+
if (this.optionFlags & 128) node.range[0] = startLoc.index;
|
|
3910
3924
|
}
|
|
3911
3925
|
resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {
|
|
3912
3926
|
node.end = endLoc.index;
|
|
3913
3927
|
node.loc.end = endLoc;
|
|
3914
|
-
if (this.optionFlags &
|
|
3928
|
+
if (this.optionFlags & 128) node.range[1] = endLoc.index;
|
|
3915
3929
|
}
|
|
3916
3930
|
resetStartLocationFromNode(node, locationNode) {
|
|
3917
3931
|
this.resetStartLocation(node, locationNode.loc.start);
|
|
@@ -4741,8 +4755,7 @@ var flow = superClass => class FlowParserMixin extends superClass {
|
|
|
4741
4755
|
}
|
|
4742
4756
|
}
|
|
4743
4757
|
flowParseQualifiedTypeIdentifier(startLoc, id) {
|
|
4744
|
-
|
|
4745
|
-
(_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc;
|
|
4758
|
+
startLoc != null ? startLoc : startLoc = this.state.startLoc;
|
|
4746
4759
|
let node = id || this.flowParseRestrictedIdentifier(true);
|
|
4747
4760
|
while (this.eat(16)) {
|
|
4748
4761
|
const node2 = this.startNodeAt(startLoc);
|
|
@@ -7198,14 +7211,7 @@ class LValParser extends NodeUtils {
|
|
|
7198
7211
|
for (let i = 0; i <= end; i++) {
|
|
7199
7212
|
const elt = exprList[i];
|
|
7200
7213
|
if (!elt) continue;
|
|
7201
|
-
|
|
7202
|
-
elt.type = "RestElement";
|
|
7203
|
-
const arg = elt.argument;
|
|
7204
|
-
this.checkToRestConversion(arg, true);
|
|
7205
|
-
this.toAssignable(arg, isLHS);
|
|
7206
|
-
} else {
|
|
7207
|
-
this.toAssignable(elt, isLHS);
|
|
7208
|
-
}
|
|
7214
|
+
this.toAssignableListItem(exprList, i, isLHS);
|
|
7209
7215
|
if (elt.type === "RestElement") {
|
|
7210
7216
|
if (i < end) {
|
|
7211
7217
|
this.raise(Errors.RestTrailingComma, elt);
|
|
@@ -7215,6 +7221,17 @@ class LValParser extends NodeUtils {
|
|
|
7215
7221
|
}
|
|
7216
7222
|
}
|
|
7217
7223
|
}
|
|
7224
|
+
toAssignableListItem(exprList, index, isLHS) {
|
|
7225
|
+
const node = exprList[index];
|
|
7226
|
+
if (node.type === "SpreadElement") {
|
|
7227
|
+
node.type = "RestElement";
|
|
7228
|
+
const arg = node.argument;
|
|
7229
|
+
this.checkToRestConversion(arg, true);
|
|
7230
|
+
this.toAssignable(arg, isLHS);
|
|
7231
|
+
} else {
|
|
7232
|
+
this.toAssignable(node, isLHS);
|
|
7233
|
+
}
|
|
7234
|
+
}
|
|
7218
7235
|
isAssignable(node, isBinding) {
|
|
7219
7236
|
switch (node.type) {
|
|
7220
7237
|
case "Identifier":
|
|
@@ -7310,13 +7327,15 @@ class LValParser extends NodeUtils {
|
|
|
7310
7327
|
}
|
|
7311
7328
|
} else {
|
|
7312
7329
|
const decorators = [];
|
|
7313
|
-
if (
|
|
7314
|
-
this.
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7330
|
+
if (flags & 2) {
|
|
7331
|
+
if (this.match(26) && this.hasPlugin("decorators")) {
|
|
7332
|
+
this.raise(Errors.UnsupportedParameterDecorator, this.state.startLoc);
|
|
7333
|
+
}
|
|
7334
|
+
while (this.match(26)) {
|
|
7335
|
+
decorators.push(this.parseDecorator());
|
|
7336
|
+
}
|
|
7318
7337
|
}
|
|
7319
|
-
elts.push(this.
|
|
7338
|
+
elts.push(this.parseBindingElement(flags, decorators));
|
|
7320
7339
|
}
|
|
7321
7340
|
}
|
|
7322
7341
|
return elts;
|
|
@@ -7346,7 +7365,7 @@ class LValParser extends NodeUtils {
|
|
|
7346
7365
|
prop.method = false;
|
|
7347
7366
|
return this.parseObjPropValue(prop, startLoc, false, false, true, false);
|
|
7348
7367
|
}
|
|
7349
|
-
|
|
7368
|
+
parseBindingElement(flags, decorators) {
|
|
7350
7369
|
const left = this.parseMaybeDefault();
|
|
7351
7370
|
if (this.hasPlugin("flow") || flags & 2) {
|
|
7352
7371
|
this.parseFunctionParamType(left);
|
|
@@ -7361,9 +7380,8 @@ class LValParser extends NodeUtils {
|
|
|
7361
7380
|
return param;
|
|
7362
7381
|
}
|
|
7363
7382
|
parseMaybeDefault(startLoc, left) {
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
left = (_left = left) != null ? _left : this.parseBindingAtom();
|
|
7383
|
+
startLoc != null ? startLoc : startLoc = this.state.startLoc;
|
|
7384
|
+
left = left != null ? left : this.parseBindingAtom();
|
|
7367
7385
|
if (!this.eat(29)) return left;
|
|
7368
7386
|
const node = this.startNodeAt(startLoc);
|
|
7369
7387
|
node.left = left;
|
|
@@ -7553,6 +7571,9 @@ const TSErrors = ParseErrorEnum`typescript`({
|
|
|
7553
7571
|
IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.",
|
|
7554
7572
|
IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.",
|
|
7555
7573
|
InitializerNotAllowedInAmbientContext: "Initializers are not allowed in ambient contexts.",
|
|
7574
|
+
InvalidHeritageClauseType: ({
|
|
7575
|
+
token
|
|
7576
|
+
}) => `'${token}' list can only include identifiers or qualified-names with optional type arguments.`,
|
|
7556
7577
|
InvalidModifierOnTypeMember: ({
|
|
7557
7578
|
modifier
|
|
7558
7579
|
}) => `'${modifier}' modifier cannot appear on a type member.`,
|
|
@@ -8605,8 +8626,8 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8605
8626
|
tsParseHeritageClause(token) {
|
|
8606
8627
|
const originalStartLoc = this.state.startLoc;
|
|
8607
8628
|
const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => {
|
|
8608
|
-
const node = this.startNode();
|
|
8609
8629
|
{
|
|
8630
|
+
const node = this.startNode();
|
|
8610
8631
|
node.expression = this.tsParseEntityName(1 | 2);
|
|
8611
8632
|
if (this.match(47)) {
|
|
8612
8633
|
node.typeParameters = this.tsParseTypeArguments();
|
|
@@ -9006,7 +9027,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9006
9027
|
if (this.tsIsDeclarationStart()) return false;
|
|
9007
9028
|
return super.isExportDefaultSpecifier();
|
|
9008
9029
|
}
|
|
9009
|
-
|
|
9030
|
+
parseBindingElement(flags, decorators) {
|
|
9010
9031
|
const startLoc = this.state.startLoc;
|
|
9011
9032
|
const modified = {};
|
|
9012
9033
|
this.tsParseModifiers({
|
|
@@ -9432,18 +9453,15 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9432
9453
|
return super.shouldParseExportDeclaration();
|
|
9433
9454
|
}
|
|
9434
9455
|
parseConditional(expr, startLoc, refExpressionErrors) {
|
|
9435
|
-
if (!this.
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
super.setOptionalParametersError(refExpressionErrors, result.error);
|
|
9456
|
+
if (!this.match(17)) return expr;
|
|
9457
|
+
if (this.state.maybeInArrowParameters) {
|
|
9458
|
+
const nextCh = this.lookaheadCharCode();
|
|
9459
|
+
if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) {
|
|
9460
|
+
this.setOptionalParametersError(refExpressionErrors);
|
|
9461
|
+
return expr;
|
|
9442
9462
|
}
|
|
9443
|
-
return expr;
|
|
9444
9463
|
}
|
|
9445
|
-
|
|
9446
|
-
return result.node;
|
|
9464
|
+
return super.parseConditional(expr, startLoc, refExpressionErrors);
|
|
9447
9465
|
}
|
|
9448
9466
|
parseParenItem(node, startLoc) {
|
|
9449
9467
|
const newNode = super.parseParenItem(node, startLoc);
|
|
@@ -9660,8 +9678,8 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9660
9678
|
throw ((_jsx3 = jsx) == null ? void 0 : _jsx3.error) || arrow.error || ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.error);
|
|
9661
9679
|
}
|
|
9662
9680
|
reportReservedArrowTypeParam(node) {
|
|
9663
|
-
var _node$
|
|
9664
|
-
if (node.params.length === 1 && !node.params[0].constraint && !((_node$
|
|
9681
|
+
var _node$extra2;
|
|
9682
|
+
if (node.params.length === 1 && !node.params[0].constraint && !((_node$extra2 = node.extra) != null && _node$extra2.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) {
|
|
9665
9683
|
this.raise(TSErrors.ReservedArrowTypeParam, node);
|
|
9666
9684
|
}
|
|
9667
9685
|
}
|
|
@@ -9761,7 +9779,6 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9761
9779
|
case "TSParameterProperty":
|
|
9762
9780
|
return "parameter";
|
|
9763
9781
|
case "TSNonNullExpression":
|
|
9764
|
-
case "TSInstantiationExpression":
|
|
9765
9782
|
return "expression";
|
|
9766
9783
|
case "TSAsExpression":
|
|
9767
9784
|
case "TSSatisfiesExpression":
|
|
@@ -9847,14 +9864,12 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9847
9864
|
}
|
|
9848
9865
|
return type;
|
|
9849
9866
|
}
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
exprList[i] = this.typeCastToParameter(expr);
|
|
9855
|
-
}
|
|
9867
|
+
toAssignableListItem(exprList, index, isLHS) {
|
|
9868
|
+
const node = exprList[index];
|
|
9869
|
+
if (node.type === "TSTypeCastExpression") {
|
|
9870
|
+
exprList[index] = this.typeCastToParameter(node);
|
|
9856
9871
|
}
|
|
9857
|
-
super.
|
|
9872
|
+
super.toAssignableListItem(exprList, index, isLHS);
|
|
9858
9873
|
}
|
|
9859
9874
|
typeCastToParameter(node) {
|
|
9860
9875
|
node.expression.typeAnnotation = node.typeAnnotation;
|
|
@@ -10423,18 +10438,18 @@ const mixinPlugins = {
|
|
|
10423
10438
|
};
|
|
10424
10439
|
const mixinPluginNames = Object.keys(mixinPlugins);
|
|
10425
10440
|
class ExpressionParser extends LValParser {
|
|
10426
|
-
checkProto(prop, isRecord,
|
|
10441
|
+
checkProto(prop, isRecord, sawProto, refExpressionErrors) {
|
|
10427
10442
|
if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) {
|
|
10428
|
-
return;
|
|
10443
|
+
return sawProto;
|
|
10429
10444
|
}
|
|
10430
10445
|
const key = prop.key;
|
|
10431
10446
|
const name = key.type === "Identifier" ? key.name : key.value;
|
|
10432
10447
|
if (name === "__proto__") {
|
|
10433
10448
|
if (isRecord) {
|
|
10434
10449
|
this.raise(Errors.RecordNoProto, key);
|
|
10435
|
-
return;
|
|
10450
|
+
return true;
|
|
10436
10451
|
}
|
|
10437
|
-
if (
|
|
10452
|
+
if (sawProto) {
|
|
10438
10453
|
if (refExpressionErrors) {
|
|
10439
10454
|
if (refExpressionErrors.doubleProtoLoc === null) {
|
|
10440
10455
|
refExpressionErrors.doubleProtoLoc = key.loc.start;
|
|
@@ -10443,8 +10458,9 @@ class ExpressionParser extends LValParser {
|
|
|
10443
10458
|
this.raise(Errors.DuplicateProto, key);
|
|
10444
10459
|
}
|
|
10445
10460
|
}
|
|
10446
|
-
|
|
10461
|
+
return true;
|
|
10447
10462
|
}
|
|
10463
|
+
return sawProto;
|
|
10448
10464
|
}
|
|
10449
10465
|
shouldExitDescending(expr, potentialArrowAt) {
|
|
10450
10466
|
return expr.type === "ArrowFunctionExpression" && this.offsetToSourcePos(expr.start) === potentialArrowAt;
|
|
@@ -10459,7 +10475,7 @@ class ExpressionParser extends LValParser {
|
|
|
10459
10475
|
this.finalizeRemainingComments();
|
|
10460
10476
|
expr.comments = this.comments;
|
|
10461
10477
|
expr.errors = this.state.errors;
|
|
10462
|
-
if (this.optionFlags &
|
|
10478
|
+
if (this.optionFlags & 256) {
|
|
10463
10479
|
expr.tokens = this.tokens;
|
|
10464
10480
|
}
|
|
10465
10481
|
return expr;
|
|
@@ -10490,15 +10506,16 @@ class ExpressionParser extends LValParser {
|
|
|
10490
10506
|
parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) {
|
|
10491
10507
|
return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));
|
|
10492
10508
|
}
|
|
10493
|
-
setOptionalParametersError(refExpressionErrors
|
|
10494
|
-
|
|
10495
|
-
refExpressionErrors.optionalParametersLoc = (_resultError$loc = resultError == null ? void 0 : resultError.loc) != null ? _resultError$loc : this.state.startLoc;
|
|
10509
|
+
setOptionalParametersError(refExpressionErrors) {
|
|
10510
|
+
refExpressionErrors.optionalParametersLoc = this.state.startLoc;
|
|
10496
10511
|
}
|
|
10497
10512
|
parseMaybeAssign(refExpressionErrors, afterLeftParse) {
|
|
10498
10513
|
const startLoc = this.state.startLoc;
|
|
10499
|
-
|
|
10514
|
+
const isYield = this.isContextual(108);
|
|
10515
|
+
if (isYield) {
|
|
10500
10516
|
if (this.prodParam.hasYield) {
|
|
10501
|
-
|
|
10517
|
+
this.next();
|
|
10518
|
+
let left = this.parseYield(startLoc);
|
|
10502
10519
|
if (afterLeftParse) {
|
|
10503
10520
|
left = afterLeftParse.call(this, left, startLoc);
|
|
10504
10521
|
}
|
|
@@ -10550,6 +10567,16 @@ class ExpressionParser extends LValParser {
|
|
|
10550
10567
|
} else if (ownExpressionErrors) {
|
|
10551
10568
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
10552
10569
|
}
|
|
10570
|
+
if (isYield) {
|
|
10571
|
+
const {
|
|
10572
|
+
type
|
|
10573
|
+
} = this.state;
|
|
10574
|
+
const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54);
|
|
10575
|
+
if (startsExpr && !this.isAmbiguousPrefixOrIdentifier()) {
|
|
10576
|
+
this.raiseOverwrite(Errors.YieldNotInGeneratorFunction, startLoc);
|
|
10577
|
+
return this.parseYield(startLoc);
|
|
10578
|
+
}
|
|
10579
|
+
}
|
|
10553
10580
|
return left;
|
|
10554
10581
|
}
|
|
10555
10582
|
parseMaybeConditional(refExpressionErrors) {
|
|
@@ -10726,7 +10753,7 @@ class ExpressionParser extends LValParser {
|
|
|
10726
10753
|
type
|
|
10727
10754
|
} = this.state;
|
|
10728
10755
|
const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54);
|
|
10729
|
-
if (startsExpr && !this.
|
|
10756
|
+
if (startsExpr && !this.isAmbiguousPrefixOrIdentifier()) {
|
|
10730
10757
|
this.raiseOverwrite(Errors.AwaitNotInAsyncContext, startLoc);
|
|
10731
10758
|
return this.parseAwait(startLoc);
|
|
10732
10759
|
}
|
|
@@ -10965,7 +10992,7 @@ class ExpressionParser extends LValParser {
|
|
|
10965
10992
|
return this.parseImportMetaProperty(node);
|
|
10966
10993
|
}
|
|
10967
10994
|
if (this.match(10)) {
|
|
10968
|
-
if (this.optionFlags &
|
|
10995
|
+
if (this.optionFlags & 512) {
|
|
10969
10996
|
return this.parseImportCall(node);
|
|
10970
10997
|
} else {
|
|
10971
10998
|
return this.finishNode(node, "Import");
|
|
@@ -11270,7 +11297,7 @@ class ExpressionParser extends LValParser {
|
|
|
11270
11297
|
} else if (this.isContextual(105) || this.isContextual(97)) {
|
|
11271
11298
|
const isSource = this.isContextual(105);
|
|
11272
11299
|
this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation");
|
|
11273
|
-
if (!(this.optionFlags &
|
|
11300
|
+
if (!(this.optionFlags & 512)) {
|
|
11274
11301
|
throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, this.state.startLoc, {
|
|
11275
11302
|
phase: this.state.value
|
|
11276
11303
|
});
|
|
@@ -11390,7 +11417,7 @@ class ExpressionParser extends LValParser {
|
|
|
11390
11417
|
return this.wrapParenthesis(startLoc, val);
|
|
11391
11418
|
}
|
|
11392
11419
|
wrapParenthesis(startLoc, expression) {
|
|
11393
|
-
if (!(this.optionFlags &
|
|
11420
|
+
if (!(this.optionFlags & 1024)) {
|
|
11394
11421
|
this.addExtra(expression, "parenthesized", true);
|
|
11395
11422
|
this.addExtra(expression, "parenStart", startLoc.index);
|
|
11396
11423
|
this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index);
|
|
@@ -11494,7 +11521,7 @@ class ExpressionParser extends LValParser {
|
|
|
11494
11521
|
}
|
|
11495
11522
|
const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
|
|
11496
11523
|
this.state.inFSharpPipelineDirectBody = false;
|
|
11497
|
-
|
|
11524
|
+
let sawProto = false;
|
|
11498
11525
|
let first = true;
|
|
11499
11526
|
const node = this.startNode();
|
|
11500
11527
|
node.properties = [];
|
|
@@ -11514,7 +11541,7 @@ class ExpressionParser extends LValParser {
|
|
|
11514
11541
|
prop = this.parseBindingProperty();
|
|
11515
11542
|
} else {
|
|
11516
11543
|
prop = this.parsePropertyDefinition(refExpressionErrors);
|
|
11517
|
-
this.checkProto(prop, isRecord,
|
|
11544
|
+
sawProto = this.checkProto(prop, isRecord, sawProto, refExpressionErrors);
|
|
11518
11545
|
}
|
|
11519
11546
|
if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") {
|
|
11520
11547
|
this.raise(Errors.InvalidRecordProperty, prop);
|
|
@@ -11946,7 +11973,7 @@ class ExpressionParser extends LValParser {
|
|
|
11946
11973
|
this.raise(Errors.ObsoleteAwaitStar, node);
|
|
11947
11974
|
}
|
|
11948
11975
|
if (!this.scope.inFunction && !(this.optionFlags & 1)) {
|
|
11949
|
-
if (this.
|
|
11976
|
+
if (this.isAmbiguousPrefixOrIdentifier()) {
|
|
11950
11977
|
this.ambiguousScriptDifferentAst = true;
|
|
11951
11978
|
} else {
|
|
11952
11979
|
this.sawUnambiguousESM = true;
|
|
@@ -11957,17 +11984,16 @@ class ExpressionParser extends LValParser {
|
|
|
11957
11984
|
}
|
|
11958
11985
|
return this.finishNode(node, "AwaitExpression");
|
|
11959
11986
|
}
|
|
11960
|
-
|
|
11987
|
+
isAmbiguousPrefixOrIdentifier() {
|
|
11961
11988
|
if (this.hasPrecedingLineBreak()) return true;
|
|
11962
11989
|
const {
|
|
11963
11990
|
type
|
|
11964
11991
|
} = this.state;
|
|
11965
11992
|
return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 102 && !this.state.containsEsc || type === 138 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54;
|
|
11966
11993
|
}
|
|
11967
|
-
parseYield() {
|
|
11968
|
-
const node = this.
|
|
11994
|
+
parseYield(startLoc) {
|
|
11995
|
+
const node = this.startNodeAt(startLoc);
|
|
11969
11996
|
this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, node);
|
|
11970
|
-
this.next();
|
|
11971
11997
|
let delegating = false;
|
|
11972
11998
|
let argument = null;
|
|
11973
11999
|
if (!this.hasPrecedingLineBreak()) {
|
|
@@ -12269,7 +12295,7 @@ class StatementParser extends ExpressionParser {
|
|
|
12269
12295
|
parseTopLevel(file, program) {
|
|
12270
12296
|
file.program = this.parseProgram(program);
|
|
12271
12297
|
file.comments = this.comments;
|
|
12272
|
-
if (this.optionFlags &
|
|
12298
|
+
if (this.optionFlags & 256) {
|
|
12273
12299
|
file.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex);
|
|
12274
12300
|
}
|
|
12275
12301
|
return this.finishNode(file, "File");
|
|
@@ -12279,7 +12305,7 @@ class StatementParser extends ExpressionParser {
|
|
|
12279
12305
|
program.interpreter = this.parseInterpreterDirective();
|
|
12280
12306
|
this.parseBlockBody(program, true, true, end);
|
|
12281
12307
|
if (this.inModule) {
|
|
12282
|
-
if (!(this.optionFlags &
|
|
12308
|
+
if (!(this.optionFlags & 64) && this.scope.undefinedExports.size > 0) {
|
|
12283
12309
|
for (const [localName, at] of Array.from(this.scope.undefinedExports)) {
|
|
12284
12310
|
this.raise(Errors.ModuleExportUndefined, at, {
|
|
12285
12311
|
localName
|
|
@@ -12512,14 +12538,8 @@ class StatementParser extends ExpressionParser {
|
|
|
12512
12538
|
let result;
|
|
12513
12539
|
if (startType === 83) {
|
|
12514
12540
|
result = this.parseImport(node);
|
|
12515
|
-
if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) {
|
|
12516
|
-
this.sawUnambiguousESM = true;
|
|
12517
|
-
}
|
|
12518
12541
|
} else {
|
|
12519
12542
|
result = this.parseExport(node, decorators);
|
|
12520
|
-
if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") {
|
|
12521
|
-
this.sawUnambiguousESM = true;
|
|
12522
|
-
}
|
|
12523
12543
|
}
|
|
12524
12544
|
this.assertModuleNodeAllowed(result);
|
|
12525
12545
|
return result;
|
|
@@ -13430,6 +13450,7 @@ class StatementParser extends ExpressionParser {
|
|
|
13430
13450
|
throw this.raise(Errors.UnsupportedDecoratorExport, node);
|
|
13431
13451
|
}
|
|
13432
13452
|
this.parseExportFrom(node, true);
|
|
13453
|
+
this.sawUnambiguousESM = true;
|
|
13433
13454
|
return this.finishNode(node, "ExportAllDeclaration");
|
|
13434
13455
|
}
|
|
13435
13456
|
const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node);
|
|
@@ -13458,6 +13479,7 @@ class StatementParser extends ExpressionParser {
|
|
|
13458
13479
|
} else if (decorators) {
|
|
13459
13480
|
throw this.raise(Errors.UnsupportedDecoratorExport, node);
|
|
13460
13481
|
}
|
|
13482
|
+
this.sawUnambiguousESM = true;
|
|
13461
13483
|
return this.finishNode(node2, "ExportNamedDeclaration");
|
|
13462
13484
|
}
|
|
13463
13485
|
if (this.eat(65)) {
|
|
@@ -13470,6 +13492,7 @@ class StatementParser extends ExpressionParser {
|
|
|
13470
13492
|
throw this.raise(Errors.UnsupportedDecoratorExport, node);
|
|
13471
13493
|
}
|
|
13472
13494
|
this.checkExport(node2, true, true);
|
|
13495
|
+
this.sawUnambiguousESM = true;
|
|
13473
13496
|
return this.finishNode(node2, "ExportDefaultDeclaration");
|
|
13474
13497
|
}
|
|
13475
13498
|
this.unexpected(null, 5);
|
|
@@ -13507,10 +13530,12 @@ class StatementParser extends ExpressionParser {
|
|
|
13507
13530
|
const isTypeExport = node2.exportKind === "type";
|
|
13508
13531
|
node2.specifiers.push(...this.parseExportSpecifiers(isTypeExport));
|
|
13509
13532
|
node2.source = null;
|
|
13510
|
-
node2.declaration = null;
|
|
13511
13533
|
if (this.hasPlugin("importAssertions")) {
|
|
13512
13534
|
node2.assertions = [];
|
|
13535
|
+
} else {
|
|
13536
|
+
node2.attributes = [];
|
|
13513
13537
|
}
|
|
13538
|
+
node2.declaration = null;
|
|
13514
13539
|
return true;
|
|
13515
13540
|
}
|
|
13516
13541
|
return false;
|
|
@@ -13521,6 +13546,8 @@ class StatementParser extends ExpressionParser {
|
|
|
13521
13546
|
node.source = null;
|
|
13522
13547
|
if (this.hasPlugin("importAssertions")) {
|
|
13523
13548
|
node.assertions = [];
|
|
13549
|
+
} else {
|
|
13550
|
+
node.attributes = [];
|
|
13524
13551
|
}
|
|
13525
13552
|
node.declaration = this.parseExportDeclaration(node);
|
|
13526
13553
|
return true;
|
|
@@ -13884,6 +13911,7 @@ class StatementParser extends ExpressionParser {
|
|
|
13884
13911
|
this.checkImportReflection(node);
|
|
13885
13912
|
this.checkJSONModuleImport(node);
|
|
13886
13913
|
this.semicolon();
|
|
13914
|
+
this.sawUnambiguousESM = true;
|
|
13887
13915
|
return this.finishNode(node, "ImportDeclaration");
|
|
13888
13916
|
}
|
|
13889
13917
|
parseImportSource() {
|
|
@@ -13967,6 +13995,7 @@ class StatementParser extends ExpressionParser {
|
|
|
13967
13995
|
this.next();
|
|
13968
13996
|
if (this.hasPlugin("moduleAttributes")) {
|
|
13969
13997
|
attributes = this.parseModuleAttributes();
|
|
13998
|
+
this.addExtra(node, "deprecatedWithLegacySyntax", true);
|
|
13970
13999
|
} else {
|
|
13971
14000
|
attributes = this.parseImportAttributes();
|
|
13972
14001
|
}
|
|
@@ -14080,31 +14109,34 @@ class Parser extends StatementParser {
|
|
|
14080
14109
|
optionFlags |= 16;
|
|
14081
14110
|
}
|
|
14082
14111
|
if (options.allowUndeclaredExports) {
|
|
14083
|
-
optionFlags |=
|
|
14112
|
+
optionFlags |= 64;
|
|
14084
14113
|
}
|
|
14085
14114
|
if (options.allowNewTargetOutsideFunction) {
|
|
14086
14115
|
optionFlags |= 4;
|
|
14087
14116
|
}
|
|
14117
|
+
if (options.allowYieldOutsideFunction) {
|
|
14118
|
+
optionFlags |= 32;
|
|
14119
|
+
}
|
|
14088
14120
|
if (options.ranges) {
|
|
14089
|
-
optionFlags |=
|
|
14121
|
+
optionFlags |= 128;
|
|
14090
14122
|
}
|
|
14091
14123
|
if (options.tokens) {
|
|
14092
|
-
optionFlags |=
|
|
14124
|
+
optionFlags |= 256;
|
|
14093
14125
|
}
|
|
14094
14126
|
if (options.createImportExpressions) {
|
|
14095
|
-
optionFlags |=
|
|
14127
|
+
optionFlags |= 512;
|
|
14096
14128
|
}
|
|
14097
14129
|
if (options.createParenthesizedExpressions) {
|
|
14098
|
-
optionFlags |=
|
|
14130
|
+
optionFlags |= 1024;
|
|
14099
14131
|
}
|
|
14100
14132
|
if (options.errorRecovery) {
|
|
14101
|
-
optionFlags |=
|
|
14133
|
+
optionFlags |= 2048;
|
|
14102
14134
|
}
|
|
14103
14135
|
if (options.attachComment) {
|
|
14104
|
-
optionFlags |=
|
|
14136
|
+
optionFlags |= 4096;
|
|
14105
14137
|
}
|
|
14106
14138
|
if (options.annexB) {
|
|
14107
|
-
optionFlags |=
|
|
14139
|
+
optionFlags |= 8192;
|
|
14108
14140
|
}
|
|
14109
14141
|
this.optionFlags = optionFlags;
|
|
14110
14142
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babel/parser",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.27.0",
|
|
4
4
|
"description": "A JavaScript parser",
|
|
5
5
|
"author": "The Babel Team (https://babel.dev/team)",
|
|
6
6
|
"homepage": "https://babel.dev/docs/en/next/babel-parser",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"# dependencies": "This package doesn't actually have runtime dependencies. @babel/types is only needed for type definitions.",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@babel/types": "^7.
|
|
38
|
+
"@babel/types": "^7.27.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@babel/code-frame": "^7.26.2",
|