@danielx/civet 0.5.92 → 0.5.94
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/browser.js +323 -179
- package/dist/civet +1 -1
- package/dist/esbuild-plugin.js +119 -26
- package/dist/esm.mjs +9 -4
- package/dist/main.js +323 -179
- package/dist/main.mjs +323 -179
- package/dist/types.d.ts +8 -1
- package/package.json +4 -1
- package/register.js +9 -0
- package/dist/browser.js.gzip +0 -0
package/dist/main.js
CHANGED
|
@@ -385,6 +385,82 @@ var require_lib = __commonJS({
|
|
|
385
385
|
return '"' + str.replace(/"/g, '\\"') + '"';
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
+
function lastAccessInCallExpression(exp) {
|
|
389
|
+
let children, i;
|
|
390
|
+
do {
|
|
391
|
+
({ children } = exp);
|
|
392
|
+
i = children.length - 1;
|
|
393
|
+
while (i >= 0 && (children[i].type === "Call" || children[i].type === "NonNullAssertion" || children[i].type === "Optional"))
|
|
394
|
+
i--;
|
|
395
|
+
if (i < 0)
|
|
396
|
+
return;
|
|
397
|
+
} while (children[i].type === "MemberExpression" && (exp = children[i]));
|
|
398
|
+
return children[i];
|
|
399
|
+
}
|
|
400
|
+
function convertMethodToFunction(method) {
|
|
401
|
+
const { signature, block } = method;
|
|
402
|
+
let { modifier } = signature;
|
|
403
|
+
if (modifier) {
|
|
404
|
+
if (modifier.get || modifier.set) {
|
|
405
|
+
return;
|
|
406
|
+
} else if (modifier.async) {
|
|
407
|
+
modifier = [modifier.children[0][0], " function ", ...modifier.children.slice(1)];
|
|
408
|
+
} else {
|
|
409
|
+
modifier = ["function ", ...modifier.children];
|
|
410
|
+
}
|
|
411
|
+
} else {
|
|
412
|
+
modifier = "function ";
|
|
413
|
+
}
|
|
414
|
+
return {
|
|
415
|
+
...signature,
|
|
416
|
+
id: signature.name,
|
|
417
|
+
type: "FunctionExpression",
|
|
418
|
+
children: [
|
|
419
|
+
[modifier, ...signature.children.slice(1)],
|
|
420
|
+
block
|
|
421
|
+
],
|
|
422
|
+
block
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
function convertObjectToJSXAttributes(obj) {
|
|
426
|
+
const { content } = obj;
|
|
427
|
+
const parts = [];
|
|
428
|
+
const rest = [];
|
|
429
|
+
for (let i = 0; i < content.length; i++) {
|
|
430
|
+
if (i > 0)
|
|
431
|
+
parts.push(" ");
|
|
432
|
+
const part = content[i];
|
|
433
|
+
switch (part.type) {
|
|
434
|
+
case "Identifier":
|
|
435
|
+
parts.push([part.name, "={", part.name, "}"]);
|
|
436
|
+
break;
|
|
437
|
+
case "Property":
|
|
438
|
+
if (part.name.type === "ComputedPropertyName") {
|
|
439
|
+
rest.push(part);
|
|
440
|
+
} else {
|
|
441
|
+
parts.push([part.name, "={", insertTrimmingSpace(part.value, ""), "}"]);
|
|
442
|
+
}
|
|
443
|
+
break;
|
|
444
|
+
case "SpreadProperty":
|
|
445
|
+
parts.push(["{", part.dots, part.value, "}"]);
|
|
446
|
+
break;
|
|
447
|
+
case "MethodDefinition":
|
|
448
|
+
const func = convertMethodToFunction(part);
|
|
449
|
+
if (func) {
|
|
450
|
+
parts.push([part.name, "={", convertMethodToFunction(part), "}"]);
|
|
451
|
+
} else {
|
|
452
|
+
rest.push(part);
|
|
453
|
+
}
|
|
454
|
+
break;
|
|
455
|
+
default:
|
|
456
|
+
throw new Error(`invalid object literal type in JSX attribute: ${part.type}`);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
if (rest.length) {
|
|
460
|
+
parts.push(["{...{", ...rest, "}}"]);
|
|
461
|
+
}
|
|
462
|
+
return parts;
|
|
463
|
+
}
|
|
388
464
|
function processCoffeeInterpolation(s, parts, e, $loc) {
|
|
389
465
|
if (parts.length === 0 || parts.length === 1 && parts[0].token != null) {
|
|
390
466
|
return {
|
|
@@ -474,6 +550,8 @@ var require_lib = __commonJS({
|
|
|
474
550
|
};
|
|
475
551
|
}
|
|
476
552
|
function processUnaryExpression(pre, exp, post) {
|
|
553
|
+
if (!(pre.length || post))
|
|
554
|
+
return exp;
|
|
477
555
|
if (post?.token === "?") {
|
|
478
556
|
post = {
|
|
479
557
|
$loc: post.$loc,
|
|
@@ -523,26 +601,16 @@ var require_lib = __commonJS({
|
|
|
523
601
|
};
|
|
524
602
|
}
|
|
525
603
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
return Object.assign({}, exp, { children });
|
|
531
|
-
} else if (Array.isArray(exp)) {
|
|
532
|
-
const children = [...pre, ...exp];
|
|
533
|
-
if (post)
|
|
534
|
-
children.push(post);
|
|
535
|
-
return { children };
|
|
536
|
-
} else {
|
|
537
|
-
const children = [...pre, exp];
|
|
538
|
-
if (post)
|
|
539
|
-
children.push(post);
|
|
540
|
-
return { children };
|
|
541
|
-
}
|
|
604
|
+
return {
|
|
605
|
+
type: "UnaryExpression",
|
|
606
|
+
children: [...pre, exp, post]
|
|
607
|
+
};
|
|
542
608
|
}
|
|
543
609
|
module2.exports = {
|
|
544
610
|
blockWithPrefix,
|
|
545
611
|
clone,
|
|
612
|
+
convertMethodToFunction,
|
|
613
|
+
convertObjectToJSXAttributes,
|
|
546
614
|
deepCopy,
|
|
547
615
|
findAncestor,
|
|
548
616
|
forRange,
|
|
@@ -558,6 +626,7 @@ var require_lib = __commonJS({
|
|
|
558
626
|
hoistRefDecs,
|
|
559
627
|
insertTrimmingSpace,
|
|
560
628
|
isFunction,
|
|
629
|
+
lastAccessInCallExpression,
|
|
561
630
|
literalValue,
|
|
562
631
|
modifyString,
|
|
563
632
|
processCoffeeInterpolation,
|
|
@@ -1061,6 +1130,7 @@ ${input.slice(result.pos)}
|
|
|
1061
1130
|
SliceParameters,
|
|
1062
1131
|
PropertyAccess,
|
|
1063
1132
|
PropertyGlob,
|
|
1133
|
+
PropertyBind,
|
|
1064
1134
|
SuperProperty,
|
|
1065
1135
|
MetaProperty,
|
|
1066
1136
|
ReturnValue,
|
|
@@ -1848,7 +1918,7 @@ ${input.slice(result.pos)}
|
|
|
1848
1918
|
var $R48 = $R(new RegExp("(?!\\p{ID_Continue})", "suy"));
|
|
1849
1919
|
var $R49 = $R(new RegExp("\\s", "suy"));
|
|
1850
1920
|
var $R50 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
|
|
1851
|
-
var $R51 = $R(new RegExp("[\\s>]", "suy"));
|
|
1921
|
+
var $R51 = $R(new RegExp("[\\s>]|\\/>", "suy"));
|
|
1852
1922
|
var $R52 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
|
|
1853
1923
|
var $R53 = $R(new RegExp(`"[^"]*"|'[^']*'`, "suy"));
|
|
1854
1924
|
var $R54 = $R(new RegExp("[<>]", "suy"));
|
|
@@ -3118,9 +3188,9 @@ ${input.slice(result.pos)}
|
|
|
3118
3188
|
return result;
|
|
3119
3189
|
}
|
|
3120
3190
|
}
|
|
3121
|
-
var FatArrow$0 = $TS($S(
|
|
3191
|
+
var FatArrow$0 = $TS($S($E(_), $EXPECT($L8, fail, 'FatArrow "=>"')), function($skip, $loc, $0, $1, $2) {
|
|
3122
3192
|
var ws = $1;
|
|
3123
|
-
if (!ws
|
|
3193
|
+
if (!ws)
|
|
3124
3194
|
return " =>";
|
|
3125
3195
|
return $0;
|
|
3126
3196
|
});
|
|
@@ -4131,11 +4201,8 @@ ${input.slice(result.pos)}
|
|
|
4131
4201
|
return result;
|
|
4132
4202
|
}
|
|
4133
4203
|
}
|
|
4134
|
-
var LeftHandSideExpression$0 = $
|
|
4135
|
-
|
|
4136
|
-
return $0;
|
|
4137
|
-
return $2;
|
|
4138
|
-
});
|
|
4204
|
+
var LeftHandSideExpression$0 = $S($P($S(New, $N($C($EXPECT($L5, fail, 'LeftHandSideExpression "."'), $EXPECT($L10, fail, 'LeftHandSideExpression ":"'))), __)), CallExpression, $E(TypeArguments));
|
|
4205
|
+
var LeftHandSideExpression$1 = CallExpression;
|
|
4139
4206
|
function LeftHandSideExpression(state) {
|
|
4140
4207
|
let eventData;
|
|
4141
4208
|
if (state.events) {
|
|
@@ -4147,12 +4214,12 @@ ${input.slice(result.pos)}
|
|
|
4147
4214
|
}
|
|
4148
4215
|
}
|
|
4149
4216
|
if (state.tokenize) {
|
|
4150
|
-
const result = $TOKEN("LeftHandSideExpression", state, LeftHandSideExpression$0(state));
|
|
4217
|
+
const result = $TOKEN("LeftHandSideExpression", state, LeftHandSideExpression$0(state) || LeftHandSideExpression$1(state));
|
|
4151
4218
|
if (state.events)
|
|
4152
4219
|
state.events.exit?.("LeftHandSideExpression", state, result, eventData);
|
|
4153
4220
|
return result;
|
|
4154
4221
|
} else {
|
|
4155
|
-
const result = LeftHandSideExpression$0(state);
|
|
4222
|
+
const result = LeftHandSideExpression$0(state) || LeftHandSideExpression$1(state);
|
|
4156
4223
|
if (state.events)
|
|
4157
4224
|
state.events.exit?.("LeftHandSideExpression", state, result, eventData);
|
|
4158
4225
|
return result;
|
|
@@ -4160,14 +4227,14 @@ ${input.slice(result.pos)}
|
|
|
4160
4227
|
}
|
|
4161
4228
|
var CallExpression$0 = $TS($S($EXPECT($L14, fail, 'CallExpression "super"'), ArgumentsWithTrailingMemberExpressions, $Q(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
|
|
4162
4229
|
var rest = $3;
|
|
4163
|
-
return module2.
|
|
4230
|
+
return module2.processCallMemberExpression({
|
|
4164
4231
|
type: "CallExpression",
|
|
4165
4232
|
children: [$1, ...$2, ...rest.flat()]
|
|
4166
4233
|
});
|
|
4167
4234
|
});
|
|
4168
4235
|
var CallExpression$1 = $TS($S($EXPECT($L15, fail, 'CallExpression "import"'), ArgumentsWithTrailingMemberExpressions, $Q(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
|
|
4169
4236
|
var rest = $3;
|
|
4170
|
-
return module2.
|
|
4237
|
+
return module2.processCallMemberExpression({
|
|
4171
4238
|
type: "CallExpression",
|
|
4172
4239
|
children: [$1, ...$2, ...rest.flat()]
|
|
4173
4240
|
});
|
|
@@ -4178,7 +4245,7 @@ ${input.slice(result.pos)}
|
|
|
4178
4245
|
var rest = $3;
|
|
4179
4246
|
if (rest.length || trailing.length) {
|
|
4180
4247
|
rest = rest.flat();
|
|
4181
|
-
return module2.
|
|
4248
|
+
return module2.processCallMemberExpression({
|
|
4182
4249
|
type: "CallExpression",
|
|
4183
4250
|
children: [member, ...trailing, ...rest]
|
|
4184
4251
|
});
|
|
@@ -4321,7 +4388,7 @@ ${input.slice(result.pos)}
|
|
|
4321
4388
|
var MemberExpression$0 = $TS($S($C(PrimaryExpression, SuperProperty, MetaProperty), $Q(MemberExpressionRest)), function($skip, $loc, $0, $1, $2) {
|
|
4322
4389
|
var rest = $2;
|
|
4323
4390
|
if (rest.length || Array.isArray($1)) {
|
|
4324
|
-
return module2.
|
|
4391
|
+
return module2.processCallMemberExpression({
|
|
4325
4392
|
type: "MemberExpression",
|
|
4326
4393
|
children: [$1, ...rest].flat()
|
|
4327
4394
|
});
|
|
@@ -4361,7 +4428,8 @@ ${input.slice(result.pos)}
|
|
|
4361
4428
|
});
|
|
4362
4429
|
var MemberExpressionRest$1 = PropertyAccess;
|
|
4363
4430
|
var MemberExpressionRest$2 = PropertyGlob;
|
|
4364
|
-
var MemberExpressionRest$3 =
|
|
4431
|
+
var MemberExpressionRest$3 = PropertyBind;
|
|
4432
|
+
var MemberExpressionRest$4 = NonNullAssertion;
|
|
4365
4433
|
function MemberExpressionRest(state) {
|
|
4366
4434
|
let eventData;
|
|
4367
4435
|
if (state.events) {
|
|
@@ -4373,12 +4441,12 @@ ${input.slice(result.pos)}
|
|
|
4373
4441
|
}
|
|
4374
4442
|
}
|
|
4375
4443
|
if (state.tokenize) {
|
|
4376
|
-
const result = $TOKEN("MemberExpressionRest", state, MemberExpressionRest$0(state) || MemberExpressionRest$1(state) || MemberExpressionRest$2(state) || MemberExpressionRest$3(state));
|
|
4444
|
+
const result = $TOKEN("MemberExpressionRest", state, MemberExpressionRest$0(state) || MemberExpressionRest$1(state) || MemberExpressionRest$2(state) || MemberExpressionRest$3(state) || MemberExpressionRest$4(state));
|
|
4377
4445
|
if (state.events)
|
|
4378
4446
|
state.events.exit?.("MemberExpressionRest", state, result, eventData);
|
|
4379
4447
|
return result;
|
|
4380
4448
|
} else {
|
|
4381
|
-
const result = MemberExpressionRest$0(state) || MemberExpressionRest$1(state) || MemberExpressionRest$2(state) || MemberExpressionRest$3(state);
|
|
4449
|
+
const result = MemberExpressionRest$0(state) || MemberExpressionRest$1(state) || MemberExpressionRest$2(state) || MemberExpressionRest$3(state) || MemberExpressionRest$4(state);
|
|
4382
4450
|
if (state.events)
|
|
4383
4451
|
state.events.exit?.("MemberExpressionRest", state, result, eventData);
|
|
4384
4452
|
return result;
|
|
@@ -4588,9 +4656,11 @@ ${input.slice(result.pos)}
|
|
|
4588
4656
|
}
|
|
4589
4657
|
}
|
|
4590
4658
|
var PropertyGlob$0 = $TS($S(OptionalDot, BracedObjectLiteral), function($skip, $loc, $0, $1, $2) {
|
|
4659
|
+
var dot = $1;
|
|
4591
4660
|
var object = $2;
|
|
4592
4661
|
return {
|
|
4593
4662
|
type: "PropertyGlob",
|
|
4663
|
+
dot,
|
|
4594
4664
|
object,
|
|
4595
4665
|
children: $0
|
|
4596
4666
|
};
|
|
@@ -4617,6 +4687,38 @@ ${input.slice(result.pos)}
|
|
|
4617
4687
|
return result;
|
|
4618
4688
|
}
|
|
4619
4689
|
}
|
|
4690
|
+
var PropertyBind$0 = $TS($S($E($C(QuestionMark, NonNullAssertion)), At, OptionalDot, $C(IdentifierName, PrivateIdentifier)), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
4691
|
+
var modifier = $1;
|
|
4692
|
+
var dot = $3;
|
|
4693
|
+
var id = $4;
|
|
4694
|
+
return {
|
|
4695
|
+
type: "PropertyBind",
|
|
4696
|
+
name: id.name,
|
|
4697
|
+
children: [modifier, dot, id]
|
|
4698
|
+
};
|
|
4699
|
+
});
|
|
4700
|
+
function PropertyBind(state) {
|
|
4701
|
+
let eventData;
|
|
4702
|
+
if (state.events) {
|
|
4703
|
+
const result = state.events.enter?.("PropertyBind", state);
|
|
4704
|
+
if (result) {
|
|
4705
|
+
if (result.cache)
|
|
4706
|
+
return result.cache;
|
|
4707
|
+
eventData = result.data;
|
|
4708
|
+
}
|
|
4709
|
+
}
|
|
4710
|
+
if (state.tokenize) {
|
|
4711
|
+
const result = $TOKEN("PropertyBind", state, PropertyBind$0(state));
|
|
4712
|
+
if (state.events)
|
|
4713
|
+
state.events.exit?.("PropertyBind", state, result, eventData);
|
|
4714
|
+
return result;
|
|
4715
|
+
} else {
|
|
4716
|
+
const result = PropertyBind$0(state);
|
|
4717
|
+
if (state.events)
|
|
4718
|
+
state.events.exit?.("PropertyBind", state, result, eventData);
|
|
4719
|
+
return result;
|
|
4720
|
+
}
|
|
4721
|
+
}
|
|
4620
4722
|
var SuperProperty$0 = $S($EXPECT($L14, fail, 'SuperProperty "super"'), MemberBracketContent);
|
|
4621
4723
|
var SuperProperty$1 = $S($EXPECT($L14, fail, 'SuperProperty "super"'), $N($C(QuestionMark, NonNullAssertion)), PropertyAccess);
|
|
4622
4724
|
function SuperProperty(state) {
|
|
@@ -4721,10 +4823,13 @@ ${input.slice(result.pos)}
|
|
|
4721
4823
|
}
|
|
4722
4824
|
}
|
|
4723
4825
|
var Parameters$0 = NonEmptyParameters;
|
|
4724
|
-
var Parameters$1 = $
|
|
4826
|
+
var Parameters$1 = $TS($S($E(TypeParameters), Loc), function($skip, $loc, $0, $1, $2) {
|
|
4827
|
+
var tp = $1;
|
|
4828
|
+
var p = $2;
|
|
4725
4829
|
return {
|
|
4726
4830
|
type: "Parameters",
|
|
4727
|
-
children: [{ $loc, token: "()" }],
|
|
4831
|
+
children: [tp, { $loc: p.$loc, token: "()" }],
|
|
4832
|
+
tp,
|
|
4728
4833
|
names: [],
|
|
4729
4834
|
implicit: true
|
|
4730
4835
|
};
|
|
@@ -4770,9 +4875,8 @@ ${input.slice(result.pos)}
|
|
|
4770
4875
|
}
|
|
4771
4876
|
let blockPrefix;
|
|
4772
4877
|
if (after.length) {
|
|
4773
|
-
const spliceRef = module2.getRef("splice");
|
|
4774
4878
|
blockPrefix = {
|
|
4775
|
-
children: ["[", insertTrimmingSpace(after, ""), "] = ",
|
|
4879
|
+
children: ["[", insertTrimmingSpace(after, ""), "] = ", restIdentifier, ".splice(-", after.length.toString(), ")"],
|
|
4776
4880
|
names: after.flatMap((p) => p.names)
|
|
4777
4881
|
};
|
|
4778
4882
|
}
|
|
@@ -6156,7 +6260,7 @@ ${input.slice(result.pos)}
|
|
|
6156
6260
|
async,
|
|
6157
6261
|
generator,
|
|
6158
6262
|
block: null,
|
|
6159
|
-
children: !parameters.implicit ?
|
|
6263
|
+
children: !parameters.implicit ? [async, func, generator, wid, w, parameters, suffix] : [async, func, generator, wid, parameters, w, suffix]
|
|
6160
6264
|
};
|
|
6161
6265
|
});
|
|
6162
6266
|
function FunctionSignature(state) {
|
|
@@ -6469,7 +6573,7 @@ ${input.slice(result.pos)}
|
|
|
6469
6573
|
return result;
|
|
6470
6574
|
}
|
|
6471
6575
|
}
|
|
6472
|
-
var ThinArrowFunction$0 = $TS($S($E($S(Async, _)), Parameters, $E(ReturnTypeSuffix), $
|
|
6576
|
+
var ThinArrowFunction$0 = $TS($S($E($S(Async, _)), Parameters, $E(ReturnTypeSuffix), $E(_), Arrow, BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
6473
6577
|
var async = $1;
|
|
6474
6578
|
var parameters = $2;
|
|
6475
6579
|
var suffix = $3;
|
|
@@ -8135,11 +8239,11 @@ ${input.slice(result.pos)}
|
|
|
8135
8239
|
return result;
|
|
8136
8240
|
}
|
|
8137
8241
|
}
|
|
8138
|
-
var PropertyDefinition$0 = $TS($S(__,
|
|
8242
|
+
var PropertyDefinition$0 = $TS($S(__, AtThis, IdentifierReference), function($skip, $loc, $0, $1, $2, $3) {
|
|
8139
8243
|
var ws = $1;
|
|
8140
8244
|
var at = $2;
|
|
8141
8245
|
var id = $3;
|
|
8142
|
-
const value = [
|
|
8246
|
+
const value = [at, ".", id];
|
|
8143
8247
|
return {
|
|
8144
8248
|
type: "Property",
|
|
8145
8249
|
children: [ws, id, ": ", ...value],
|
|
@@ -8197,26 +8301,19 @@ ${input.slice(result.pos)}
|
|
|
8197
8301
|
if (value.type === "Identifier") {
|
|
8198
8302
|
return { ...value, children: [ws, ...value.children] };
|
|
8199
8303
|
}
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
i = children.length - 1;
|
|
8204
|
-
while (i >= 0 && (children[i].type === "Call" || children[i].type === "NonNullAssertion" || children[i].type === "Optional"))
|
|
8205
|
-
i--;
|
|
8206
|
-
if (i < 0)
|
|
8207
|
-
return $skip;
|
|
8208
|
-
} while (children[i].type === "MemberExpression" && (exp = children[i]));
|
|
8209
|
-
const last = children[i];
|
|
8304
|
+
const last = lastAccessInCallExpression(value);
|
|
8305
|
+
if (!last)
|
|
8306
|
+
return $skip;
|
|
8210
8307
|
let name;
|
|
8211
|
-
if (last.
|
|
8212
|
-
({ name } = last);
|
|
8213
|
-
} else if (last.type === "Index") {
|
|
8308
|
+
if (last.type === "Index") {
|
|
8214
8309
|
name = {
|
|
8215
8310
|
type: "ComputedPropertyName",
|
|
8216
8311
|
children: last.children
|
|
8217
8312
|
};
|
|
8218
8313
|
} else {
|
|
8219
|
-
|
|
8314
|
+
({ name } = last);
|
|
8315
|
+
if (!name)
|
|
8316
|
+
return $skip;
|
|
8220
8317
|
}
|
|
8221
8318
|
return {
|
|
8222
8319
|
type: "Property",
|
|
@@ -8541,7 +8638,7 @@ ${input.slice(result.pos)}
|
|
|
8541
8638
|
return result;
|
|
8542
8639
|
}
|
|
8543
8640
|
}
|
|
8544
|
-
var MethodModifier$0 = $TS($S(GetOrSet, $E(_)), function($skip, $loc, $0, $1, $2) {
|
|
8641
|
+
var MethodModifier$0 = $TS($S(GetOrSet, $E(_), $Y(ClassElementName)), function($skip, $loc, $0, $1, $2, $3) {
|
|
8545
8642
|
var kind = $1;
|
|
8546
8643
|
return {
|
|
8547
8644
|
type: "MethodModifier",
|
|
@@ -12522,7 +12619,7 @@ ${input.slice(result.pos)}
|
|
|
12522
12619
|
return result;
|
|
12523
12620
|
}
|
|
12524
12621
|
}
|
|
12525
|
-
var ExportDeclaration$0 = $TS($S(Export, __, Default, __, $C(HoistableDeclaration, ClassDeclaration, ExtendedExpression)), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
12622
|
+
var ExportDeclaration$0 = $TS($S($E(Decorators), Export, __, Default, __, $C(HoistableDeclaration, ClassDeclaration, ExtendedExpression)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
12526
12623
|
return { type: "ExportDeclaration", children: $0 };
|
|
12527
12624
|
});
|
|
12528
12625
|
var ExportDeclaration$1 = $TS($S(Export, __, ExportFromClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
@@ -17203,42 +17300,7 @@ ${input.slice(result.pos)}
|
|
|
17203
17300
|
}
|
|
17204
17301
|
}
|
|
17205
17302
|
var JSXAttribute$0 = $TS($S(BracedObjectLiteral), function($skip, $loc, $0, $1) {
|
|
17206
|
-
|
|
17207
|
-
const parts = [];
|
|
17208
|
-
const rest = [];
|
|
17209
|
-
for (let i = 1; i < children.length - 1; i++) {
|
|
17210
|
-
if (i > 1)
|
|
17211
|
-
parts.push(" ");
|
|
17212
|
-
const part = children[i];
|
|
17213
|
-
switch (part.type) {
|
|
17214
|
-
case "Identifier":
|
|
17215
|
-
parts.push([part.name, "={", part.name, "}"]);
|
|
17216
|
-
break;
|
|
17217
|
-
case "Property":
|
|
17218
|
-
if (part.name.type === "ComputedPropertyName") {
|
|
17219
|
-
rest.push(part);
|
|
17220
|
-
} else {
|
|
17221
|
-
parts.push([part.name, "={", insertTrimmingSpace(part.value, ""), "}"]);
|
|
17222
|
-
}
|
|
17223
|
-
break;
|
|
17224
|
-
case "SpreadProperty":
|
|
17225
|
-
parts.push(["{", part.dots, part.value, "}"]);
|
|
17226
|
-
break;
|
|
17227
|
-
case "MethodDefinition":
|
|
17228
|
-
try {
|
|
17229
|
-
parts.push([part.name, "={", module2.convertMethodToFunction(part), "}"]);
|
|
17230
|
-
} catch {
|
|
17231
|
-
rest.push(part);
|
|
17232
|
-
}
|
|
17233
|
-
break;
|
|
17234
|
-
default:
|
|
17235
|
-
throw new Error(`invalid object literal type in JSX attribute: ${part.type}`);
|
|
17236
|
-
}
|
|
17237
|
-
}
|
|
17238
|
-
if (rest.length) {
|
|
17239
|
-
parts.push(["{...{", ...rest, "}}"]);
|
|
17240
|
-
}
|
|
17241
|
-
return parts;
|
|
17303
|
+
return convertObjectToJSXAttributes($1);
|
|
17242
17304
|
});
|
|
17243
17305
|
var JSXAttribute$1 = $TS($S(JSXAttributeName, $C(JSXAttributeInitializer, $Y(JSXAttributeSpace))), function($skip, $loc, $0, $1, $2) {
|
|
17244
17306
|
var name = $1;
|
|
@@ -17258,16 +17320,73 @@ ${input.slice(result.pos)}
|
|
|
17258
17320
|
}
|
|
17259
17321
|
});
|
|
17260
17322
|
var JSXAttribute$2 = $S(InsertInlineOpenBrace, DotDotDot, InlineJSXAttributeValue, InsertCloseBrace, $Y(JSXAttributeSpace));
|
|
17261
|
-
var JSXAttribute$3 = $TS($S($
|
|
17323
|
+
var JSXAttribute$3 = $TS($S(AtThis, $E(Identifier), $Q(InlineJSXCallExpressionRest), $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
17324
|
+
var at = $1;
|
|
17325
|
+
var id = $2;
|
|
17326
|
+
var rest = $3;
|
|
17327
|
+
const access = id && {
|
|
17328
|
+
type: "PropertyAccess",
|
|
17329
|
+
children: [".", id],
|
|
17330
|
+
name: id
|
|
17331
|
+
};
|
|
17332
|
+
const expr = module2.processCallMemberExpression({
|
|
17333
|
+
type: "CallExpression",
|
|
17334
|
+
children: [at, access, ...rest.flat()]
|
|
17335
|
+
});
|
|
17336
|
+
const last = lastAccessInCallExpression(expr);
|
|
17337
|
+
if (!last)
|
|
17338
|
+
return $skip;
|
|
17339
|
+
let name;
|
|
17340
|
+
if (last.type === "Index") {
|
|
17341
|
+
return [
|
|
17342
|
+
"{...{",
|
|
17343
|
+
{ ...last, type: "ComputedPropertyName" },
|
|
17344
|
+
": ",
|
|
17345
|
+
expr,
|
|
17346
|
+
"}}"
|
|
17347
|
+
];
|
|
17348
|
+
} else if (last.name) {
|
|
17349
|
+
return [last.name, "={", expr, "}"];
|
|
17350
|
+
}
|
|
17351
|
+
return $skip;
|
|
17352
|
+
});
|
|
17353
|
+
var JSXAttribute$4 = $TS($S(Identifier, $P(InlineJSXCallExpressionRest), $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3) {
|
|
17354
|
+
var id = $1;
|
|
17355
|
+
var rest = $2;
|
|
17356
|
+
const expr = module2.processCallMemberExpression({
|
|
17357
|
+
type: "CallExpression",
|
|
17358
|
+
children: [id, ...rest.flat()]
|
|
17359
|
+
});
|
|
17360
|
+
if (expr.type === "ObjectExpression") {
|
|
17361
|
+
return convertObjectToJSXAttributes(expr);
|
|
17362
|
+
}
|
|
17363
|
+
const last = lastAccessInCallExpression(expr);
|
|
17364
|
+
if (!last)
|
|
17365
|
+
return $skip;
|
|
17366
|
+
let name;
|
|
17367
|
+
if (last.type === "Index") {
|
|
17368
|
+
return [
|
|
17369
|
+
"{...{",
|
|
17370
|
+
{ ...last, type: "ComputedPropertyName" },
|
|
17371
|
+
": ",
|
|
17372
|
+
expr,
|
|
17373
|
+
"}}"
|
|
17374
|
+
];
|
|
17375
|
+
} else if (last.name) {
|
|
17376
|
+
return [last.name, "={", expr, "}"];
|
|
17377
|
+
}
|
|
17378
|
+
return $skip;
|
|
17379
|
+
});
|
|
17380
|
+
var JSXAttribute$5 = $TS($S($EXPECT($L13, fail, 'JSXAttribute "#"'), JSXShorthandString), function($skip, $loc, $0, $1, $2) {
|
|
17262
17381
|
return [" ", "id=", $2];
|
|
17263
17382
|
});
|
|
17264
|
-
var JSXAttribute$
|
|
17383
|
+
var JSXAttribute$6 = $TS($S(Dot, JSXShorthandString), function($skip, $loc, $0, $1, $2) {
|
|
17265
17384
|
return {
|
|
17266
17385
|
type: "JSXClass",
|
|
17267
17386
|
class: $2
|
|
17268
17387
|
};
|
|
17269
17388
|
});
|
|
17270
|
-
var JSXAttribute$
|
|
17389
|
+
var JSXAttribute$7 = $TS($S($TEXT($EXPECT($R6, fail, "JSXAttribute /[!+-]/")), JSXAttributeName, $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3) {
|
|
17271
17390
|
var toggle = $1;
|
|
17272
17391
|
var id = $2;
|
|
17273
17392
|
const value = toggle === "+" ? "true" : "false";
|
|
@@ -17284,18 +17403,18 @@ ${input.slice(result.pos)}
|
|
|
17284
17403
|
}
|
|
17285
17404
|
}
|
|
17286
17405
|
if (state.tokenize) {
|
|
17287
|
-
const result = $TOKEN("JSXAttribute", state, JSXAttribute$0(state) || JSXAttribute$1(state) || JSXAttribute$2(state) || JSXAttribute$3(state) || JSXAttribute$4(state) || JSXAttribute$5(state));
|
|
17406
|
+
const result = $TOKEN("JSXAttribute", state, JSXAttribute$0(state) || JSXAttribute$1(state) || JSXAttribute$2(state) || JSXAttribute$3(state) || JSXAttribute$4(state) || JSXAttribute$5(state) || JSXAttribute$6(state) || JSXAttribute$7(state));
|
|
17288
17407
|
if (state.events)
|
|
17289
17408
|
state.events.exit?.("JSXAttribute", state, result, eventData);
|
|
17290
17409
|
return result;
|
|
17291
17410
|
} else {
|
|
17292
|
-
const result = JSXAttribute$0(state) || JSXAttribute$1(state) || JSXAttribute$2(state) || JSXAttribute$3(state) || JSXAttribute$4(state) || JSXAttribute$5(state);
|
|
17411
|
+
const result = JSXAttribute$0(state) || JSXAttribute$1(state) || JSXAttribute$2(state) || JSXAttribute$3(state) || JSXAttribute$4(state) || JSXAttribute$5(state) || JSXAttribute$6(state) || JSXAttribute$7(state);
|
|
17293
17412
|
if (state.events)
|
|
17294
17413
|
state.events.exit?.("JSXAttribute", state, result, eventData);
|
|
17295
17414
|
return result;
|
|
17296
17415
|
}
|
|
17297
17416
|
}
|
|
17298
|
-
var JSXAttributeSpace$0 = $R$0($EXPECT($R51, fail, "JSXAttributeSpace /[\\s>]
|
|
17417
|
+
var JSXAttributeSpace$0 = $R$0($EXPECT($R51, fail, "JSXAttributeSpace /[\\s>]|\\/>/"));
|
|
17299
17418
|
function JSXAttributeSpace(state) {
|
|
17300
17419
|
let eventData;
|
|
17301
17420
|
if (state.events) {
|
|
@@ -17398,11 +17517,14 @@ ${input.slice(result.pos)}
|
|
|
17398
17517
|
var JSXAttributeValue$0 = $S(OpenBrace, PostfixedExpression, $E(Whitespace), CloseBrace);
|
|
17399
17518
|
var JSXAttributeValue$1 = JSXElement;
|
|
17400
17519
|
var JSXAttributeValue$2 = JSXFragment;
|
|
17401
|
-
var JSXAttributeValue$3 = $TS($S(InsertInlineOpenBrace, InlineJSXAttributeValue, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
|
|
17402
|
-
|
|
17520
|
+
var JSXAttributeValue$3 = $TS($S(InsertInlineOpenBrace, InlineJSXAttributeValue, InsertCloseBrace, $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
17521
|
+
var open = $1;
|
|
17522
|
+
var value = $2;
|
|
17523
|
+
var close = $3;
|
|
17524
|
+
if (value.type === "StringLiteral") {
|
|
17403
17525
|
return $skip;
|
|
17404
17526
|
}
|
|
17405
|
-
return
|
|
17527
|
+
return [open, value, close];
|
|
17406
17528
|
});
|
|
17407
17529
|
var JSXAttributeValue$4 = $R$0($EXPECT($R53, fail, `JSXAttributeValue /"[^"]*"|'[^']*'/`));
|
|
17408
17530
|
function JSXAttributeValue(state) {
|
|
@@ -17585,12 +17707,41 @@ ${input.slice(result.pos)}
|
|
|
17585
17707
|
return result;
|
|
17586
17708
|
}
|
|
17587
17709
|
}
|
|
17588
|
-
var InlineJSXCallExpression$0 = $S($EXPECT($L14, fail, 'InlineJSXCallExpression "super"'), ExplicitArguments)
|
|
17589
|
-
|
|
17710
|
+
var InlineJSXCallExpression$0 = $TS($S($EXPECT($L14, fail, 'InlineJSXCallExpression "super"'), ExplicitArguments, $Q(InlineJSXCallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
|
|
17711
|
+
var args = $2;
|
|
17712
|
+
var rest = $3;
|
|
17713
|
+
return module2.processCallMemberExpression({
|
|
17714
|
+
type: "CallExpression",
|
|
17715
|
+
children: [
|
|
17716
|
+
$1,
|
|
17717
|
+
{ type: "Call", children: args },
|
|
17718
|
+
...rest.flat()
|
|
17719
|
+
]
|
|
17720
|
+
});
|
|
17721
|
+
});
|
|
17722
|
+
var InlineJSXCallExpression$1 = $TS($S($EXPECT($L15, fail, 'InlineJSXCallExpression "import"'), ExplicitArguments, $Q(InlineJSXCallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
|
|
17723
|
+
var args = $2;
|
|
17724
|
+
var rest = $3;
|
|
17725
|
+
return module2.processCallMemberExpression({
|
|
17726
|
+
type: "CallExpression",
|
|
17727
|
+
children: [
|
|
17728
|
+
$1,
|
|
17729
|
+
{ type: "Call", children: args },
|
|
17730
|
+
...rest.flat()
|
|
17731
|
+
]
|
|
17732
|
+
});
|
|
17733
|
+
});
|
|
17590
17734
|
var InlineJSXCallExpression$2 = $TS($S(InlineJSXMemberExpression, $Q(InlineJSXCallExpressionRest)), function($skip, $loc, $0, $1, $2) {
|
|
17591
|
-
|
|
17592
|
-
|
|
17593
|
-
|
|
17735
|
+
var member = $1;
|
|
17736
|
+
var rest = $2;
|
|
17737
|
+
if (rest.length) {
|
|
17738
|
+
rest = rest.flat();
|
|
17739
|
+
return module2.processCallMemberExpression({
|
|
17740
|
+
type: "CallExpression",
|
|
17741
|
+
children: [member, ...rest]
|
|
17742
|
+
});
|
|
17743
|
+
}
|
|
17744
|
+
return member;
|
|
17594
17745
|
});
|
|
17595
17746
|
function InlineJSXCallExpression(state) {
|
|
17596
17747
|
let eventData;
|
|
@@ -17614,9 +17765,20 @@ ${input.slice(result.pos)}
|
|
|
17614
17765
|
return result;
|
|
17615
17766
|
}
|
|
17616
17767
|
}
|
|
17617
|
-
var InlineJSXCallExpressionRest$0 =
|
|
17618
|
-
var InlineJSXCallExpressionRest$1 = TemplateLiteral
|
|
17619
|
-
|
|
17768
|
+
var InlineJSXCallExpressionRest$0 = InlineJSXMemberExpressionRest;
|
|
17769
|
+
var InlineJSXCallExpressionRest$1 = $TV($C(TemplateLiteral, StringLiteral), function($skip, $loc, $0, $1) {
|
|
17770
|
+
if ($1.type === "StringLiteral") {
|
|
17771
|
+
return "`" + $1.token.slice(1, -1).replace(/(`|\$\{)/g, "\\$1") + "`";
|
|
17772
|
+
}
|
|
17773
|
+
return $1;
|
|
17774
|
+
});
|
|
17775
|
+
var InlineJSXCallExpressionRest$2 = $TS($S($E($C(OptionalShorthand, NonNullAssertion)), ExplicitArguments), function($skip, $loc, $0, $1, $2) {
|
|
17776
|
+
var args = $2;
|
|
17777
|
+
args = { type: "Call", children: args };
|
|
17778
|
+
if (!$1)
|
|
17779
|
+
return args;
|
|
17780
|
+
return [$1, args];
|
|
17781
|
+
});
|
|
17620
17782
|
function InlineJSXCallExpressionRest(state) {
|
|
17621
17783
|
let eventData;
|
|
17622
17784
|
if (state.events) {
|
|
@@ -17639,13 +17801,16 @@ ${input.slice(result.pos)}
|
|
|
17639
17801
|
return result;
|
|
17640
17802
|
}
|
|
17641
17803
|
}
|
|
17642
|
-
var InlineJSXMemberExpression$0 = $TS($S(InlineJSXPrimaryExpression, $Q(InlineJSXMemberExpressionRest)), function($skip, $loc, $0, $1, $2) {
|
|
17643
|
-
|
|
17644
|
-
|
|
17804
|
+
var InlineJSXMemberExpression$0 = $TS($S($C(InlineJSXPrimaryExpression, SuperProperty, MetaProperty), $Q(InlineJSXMemberExpressionRest)), function($skip, $loc, $0, $1, $2) {
|
|
17805
|
+
var rest = $2;
|
|
17806
|
+
if (rest.length || Array.isArray($1)) {
|
|
17807
|
+
return module2.processCallMemberExpression({
|
|
17808
|
+
type: "MemberExpression",
|
|
17809
|
+
children: [$1, ...rest].flat()
|
|
17810
|
+
});
|
|
17811
|
+
}
|
|
17645
17812
|
return $1;
|
|
17646
17813
|
});
|
|
17647
|
-
var InlineJSXMemberExpression$1 = SuperProperty;
|
|
17648
|
-
var InlineJSXMemberExpression$2 = MetaProperty;
|
|
17649
17814
|
function InlineJSXMemberExpression(state) {
|
|
17650
17815
|
let eventData;
|
|
17651
17816
|
if (state.events) {
|
|
@@ -17657,12 +17822,12 @@ ${input.slice(result.pos)}
|
|
|
17657
17822
|
}
|
|
17658
17823
|
}
|
|
17659
17824
|
if (state.tokenize) {
|
|
17660
|
-
const result = $TOKEN("InlineJSXMemberExpression", state, InlineJSXMemberExpression$0(state)
|
|
17825
|
+
const result = $TOKEN("InlineJSXMemberExpression", state, InlineJSXMemberExpression$0(state));
|
|
17661
17826
|
if (state.events)
|
|
17662
17827
|
state.events.exit?.("InlineJSXMemberExpression", state, result, eventData);
|
|
17663
17828
|
return result;
|
|
17664
17829
|
} else {
|
|
17665
|
-
const result = InlineJSXMemberExpression$0(state)
|
|
17830
|
+
const result = InlineJSXMemberExpression$0(state);
|
|
17666
17831
|
if (state.events)
|
|
17667
17832
|
state.events.exit?.("InlineJSXMemberExpression", state, result, eventData);
|
|
17668
17833
|
return result;
|
|
@@ -17678,7 +17843,9 @@ ${input.slice(result.pos)}
|
|
|
17678
17843
|
return $2;
|
|
17679
17844
|
});
|
|
17680
17845
|
var InlineJSXMemberExpressionRest$1 = PropertyAccess;
|
|
17681
|
-
var InlineJSXMemberExpressionRest$2 =
|
|
17846
|
+
var InlineJSXMemberExpressionRest$2 = PropertyGlob;
|
|
17847
|
+
var InlineJSXMemberExpressionRest$3 = PropertyBind;
|
|
17848
|
+
var InlineJSXMemberExpressionRest$4 = NonNullAssertion;
|
|
17682
17849
|
function InlineJSXMemberExpressionRest(state) {
|
|
17683
17850
|
let eventData;
|
|
17684
17851
|
if (state.events) {
|
|
@@ -17690,12 +17857,12 @@ ${input.slice(result.pos)}
|
|
|
17690
17857
|
}
|
|
17691
17858
|
}
|
|
17692
17859
|
if (state.tokenize) {
|
|
17693
|
-
const result = $TOKEN("InlineJSXMemberExpressionRest", state, InlineJSXMemberExpressionRest$0(state) || InlineJSXMemberExpressionRest$1(state) || InlineJSXMemberExpressionRest$2(state));
|
|
17860
|
+
const result = $TOKEN("InlineJSXMemberExpressionRest", state, InlineJSXMemberExpressionRest$0(state) || InlineJSXMemberExpressionRest$1(state) || InlineJSXMemberExpressionRest$2(state) || InlineJSXMemberExpressionRest$3(state) || InlineJSXMemberExpressionRest$4(state));
|
|
17694
17861
|
if (state.events)
|
|
17695
17862
|
state.events.exit?.("InlineJSXMemberExpressionRest", state, result, eventData);
|
|
17696
17863
|
return result;
|
|
17697
17864
|
} else {
|
|
17698
|
-
const result = InlineJSXMemberExpressionRest$0(state) || InlineJSXMemberExpressionRest$1(state) || InlineJSXMemberExpressionRest$2(state);
|
|
17865
|
+
const result = InlineJSXMemberExpressionRest$0(state) || InlineJSXMemberExpressionRest$1(state) || InlineJSXMemberExpressionRest$2(state) || InlineJSXMemberExpressionRest$3(state) || InlineJSXMemberExpressionRest$4(state);
|
|
17699
17866
|
if (state.events)
|
|
17700
17867
|
state.events.exit?.("InlineJSXMemberExpressionRest", state, result, eventData);
|
|
17701
17868
|
return result;
|
|
@@ -19782,7 +19949,7 @@ ${input.slice(result.pos)}
|
|
|
19782
19949
|
return result;
|
|
19783
19950
|
}
|
|
19784
19951
|
}
|
|
19785
|
-
var TypeParameters$0 = $TS($S(
|
|
19952
|
+
var TypeParameters$0 = $TS($S($E(_), $EXPECT($L132, fail, 'TypeParameters "<"'), $P(TypeParameter), __, $EXPECT($L31, fail, 'TypeParameters ">"')), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
19786
19953
|
var parameters = $3;
|
|
19787
19954
|
return {
|
|
19788
19955
|
type: "TypeParameters",
|
|
@@ -19813,7 +19980,7 @@ ${input.slice(result.pos)}
|
|
|
19813
19980
|
return result;
|
|
19814
19981
|
}
|
|
19815
19982
|
}
|
|
19816
|
-
var TypeParameter$0 = $S(__, Identifier, $E(TypeConstraint), $E(TypeInitializer), TypeParameterDelimiter);
|
|
19983
|
+
var TypeParameter$0 = $S(__, $E($S($EXPECT($L129, fail, 'TypeParameter "const"'), $E(_))), Identifier, $E(TypeConstraint), $E(TypeInitializer), TypeParameterDelimiter);
|
|
19817
19984
|
function TypeParameter(state) {
|
|
19818
19985
|
let eventData;
|
|
19819
19986
|
if (state.events) {
|
|
@@ -21312,12 +21479,12 @@ ${input.slice(result.pos)}
|
|
|
21312
21479
|
Object.assign(module2.config, directive.config);
|
|
21313
21480
|
}
|
|
21314
21481
|
});
|
|
21315
|
-
module2.
|
|
21482
|
+
module2.processCallMemberExpression = (node) => {
|
|
21316
21483
|
const { children } = node;
|
|
21317
21484
|
for (let i = 0; i < children.length; i++) {
|
|
21318
21485
|
const glob = children[i];
|
|
21319
21486
|
if (glob?.type === "PropertyGlob") {
|
|
21320
|
-
const prefix = children.slice(0, i).concat(glob.
|
|
21487
|
+
const prefix = children.slice(0, i).concat(glob.dot);
|
|
21321
21488
|
const parts = [];
|
|
21322
21489
|
for (const part of glob.object.content) {
|
|
21323
21490
|
if (part.type === "MethodDefinition") {
|
|
@@ -21342,7 +21509,7 @@ ${input.slice(result.pos)}
|
|
|
21342
21509
|
});
|
|
21343
21510
|
} else {
|
|
21344
21511
|
parts.push({
|
|
21345
|
-
type: part.type,
|
|
21512
|
+
type: part.type === "Identifier" ? "Property" : part.type,
|
|
21346
21513
|
name: part.name,
|
|
21347
21514
|
value,
|
|
21348
21515
|
delim: part.delim,
|
|
@@ -21360,6 +21527,7 @@ ${input.slice(result.pos)}
|
|
|
21360
21527
|
}
|
|
21361
21528
|
const object = {
|
|
21362
21529
|
type: "ObjectExpression",
|
|
21530
|
+
content: parts,
|
|
21363
21531
|
children: [
|
|
21364
21532
|
glob.object.children[0],
|
|
21365
21533
|
...parts,
|
|
@@ -21368,10 +21536,24 @@ ${input.slice(result.pos)}
|
|
|
21368
21536
|
};
|
|
21369
21537
|
if (i === children.length - 1)
|
|
21370
21538
|
return object;
|
|
21371
|
-
return module2.
|
|
21539
|
+
return module2.processCallMemberExpression({
|
|
21372
21540
|
...node,
|
|
21373
21541
|
children: [object, ...children.slice(i + 1)]
|
|
21374
21542
|
});
|
|
21543
|
+
} else if (glob?.type === "PropertyBind") {
|
|
21544
|
+
const prefix = children.slice(0, i);
|
|
21545
|
+
return module2.processCallMemberExpression({
|
|
21546
|
+
...node,
|
|
21547
|
+
children: [
|
|
21548
|
+
prefix,
|
|
21549
|
+
{
|
|
21550
|
+
...glob,
|
|
21551
|
+
type: "PropertyAccess",
|
|
21552
|
+
children: [...glob.children, ".bind(", prefix, ")"]
|
|
21553
|
+
},
|
|
21554
|
+
...children.slice(i + 1)
|
|
21555
|
+
]
|
|
21556
|
+
});
|
|
21375
21557
|
}
|
|
21376
21558
|
}
|
|
21377
21559
|
return node;
|
|
@@ -21933,10 +22115,9 @@ ${input.slice(result.pos)}
|
|
|
21933
22115
|
names.push(...rest.names);
|
|
21934
22116
|
}
|
|
21935
22117
|
if (after.length) {
|
|
21936
|
-
const spliceRef = module2.getRef("splice");
|
|
21937
22118
|
blockPrefix = {
|
|
21938
22119
|
type: "PostRestBindingElements",
|
|
21939
|
-
children: ["[", insertTrimmingSpace(after, ""), "] = ",
|
|
22120
|
+
children: ["[", insertTrimmingSpace(after, ""), "] = ", restIdentifier, ".splice(-", after.length.toString(), ")"],
|
|
21940
22121
|
names: after.flatMap((p) => p.names)
|
|
21941
22122
|
};
|
|
21942
22123
|
}
|
|
@@ -22297,16 +22478,6 @@ ${input.slice(result.pos)}
|
|
|
22297
22478
|
exp.children.push(...post);
|
|
22298
22479
|
});
|
|
22299
22480
|
}
|
|
22300
|
-
function checkSpliceRef(statements) {
|
|
22301
|
-
const spliceRef = module2.getRef("splice");
|
|
22302
|
-
if (gatherRecursiveAll(statements, (n) => n === spliceRef).length) {
|
|
22303
|
-
const typeSuffix = {
|
|
22304
|
-
ts: true,
|
|
22305
|
-
children: [": <T>(this: T[], start: number, deleteCount?: number) => T[]"]
|
|
22306
|
-
};
|
|
22307
|
-
module2.prelude.push(["", ["const ", spliceRef, typeSuffix, " = [].splice", module2.asAny, "\n"]]);
|
|
22308
|
-
}
|
|
22309
|
-
}
|
|
22310
22481
|
module2.attachPostfixStatementAsExpression = function(exp, post) {
|
|
22311
22482
|
let clause;
|
|
22312
22483
|
switch (post[1].type) {
|
|
@@ -22326,31 +22497,6 @@ ${input.slice(result.pos)}
|
|
|
22326
22497
|
throw new Error("Unknown postfix statement");
|
|
22327
22498
|
}
|
|
22328
22499
|
};
|
|
22329
|
-
module2.convertMethodToFunction = function(method) {
|
|
22330
|
-
const { signature, block } = method;
|
|
22331
|
-
let { modifier } = signature;
|
|
22332
|
-
if (modifier) {
|
|
22333
|
-
if (modifier.get || modifier.set) {
|
|
22334
|
-
throw new Error("cannot convert get/set method to function");
|
|
22335
|
-
} else if (modifier.async) {
|
|
22336
|
-
modifier = [modifier.children[0][0], " function ", ...modifier.children.slice(1)];
|
|
22337
|
-
} else {
|
|
22338
|
-
modifier = ["function ", ...modifier.children];
|
|
22339
|
-
}
|
|
22340
|
-
} else {
|
|
22341
|
-
modifier = "function ";
|
|
22342
|
-
}
|
|
22343
|
-
return {
|
|
22344
|
-
...signature,
|
|
22345
|
-
id: signature.name,
|
|
22346
|
-
type: "FunctionExpression",
|
|
22347
|
-
children: [
|
|
22348
|
-
[modifier, ...signature.children.slice(1)],
|
|
22349
|
-
block
|
|
22350
|
-
],
|
|
22351
|
-
block
|
|
22352
|
-
};
|
|
22353
|
-
};
|
|
22354
22500
|
function getPatternConditions(pattern, ref, conditions) {
|
|
22355
22501
|
switch (pattern.type) {
|
|
22356
22502
|
case "ArrayMatchingPattern": {
|
|
@@ -22794,7 +22940,6 @@ ${input.slice(result.pos)}
|
|
|
22794
22940
|
processTryExpressions(statements);
|
|
22795
22941
|
hoistRefDecs(statements);
|
|
22796
22942
|
gatherRecursiveAll(statements, (n) => n.type === "IterationExpression").forEach((e) => expressionizeIteration(e));
|
|
22797
|
-
checkSpliceRef(statements);
|
|
22798
22943
|
statements.unshift(...module2.prelude);
|
|
22799
22944
|
if (module2.config.autoLet) {
|
|
22800
22945
|
createLetDecs(statements, []);
|
|
@@ -23324,6 +23469,8 @@ ${input.slice(result.pos)}
|
|
|
23324
23469
|
var {
|
|
23325
23470
|
blockWithPrefix,
|
|
23326
23471
|
clone,
|
|
23472
|
+
convertMethodToFunction,
|
|
23473
|
+
convertObjectToJSXAttributes,
|
|
23327
23474
|
deepCopy,
|
|
23328
23475
|
findAncestor,
|
|
23329
23476
|
forRange,
|
|
@@ -23339,6 +23486,7 @@ ${input.slice(result.pos)}
|
|
|
23339
23486
|
hoistRefDecs,
|
|
23340
23487
|
insertTrimmingSpace,
|
|
23341
23488
|
isFunction,
|
|
23489
|
+
lastAccessInCallExpression,
|
|
23342
23490
|
literalValue,
|
|
23343
23491
|
modifyString,
|
|
23344
23492
|
processCoffeeInterpolation,
|
|
@@ -23606,17 +23754,17 @@ SourceMap.parseWithLines = function(base64encodedJSONstr) {
|
|
|
23606
23754
|
smRegexp = /\n\/\/# sourceMappingURL=data:application\/json;charset=utf-8;base64,([+a-zA-Z0-9\/]*=?=?)$/;
|
|
23607
23755
|
SourceMap.remap = function(codeWithSourceMap, upstreamMap, sourcePath, targetPath) {
|
|
23608
23756
|
var codeWithoutSourceMap, composedLines, newSourceMap, parsed, remappedCodeWithSourceMap, remappedSourceMapJSON, sourceMapText;
|
|
23609
|
-
sourceMapText =
|
|
23757
|
+
sourceMapText = null;
|
|
23758
|
+
codeWithoutSourceMap = codeWithSourceMap.replace(smRegexp, (match, sm) => {
|
|
23759
|
+
sourceMapText = sm;
|
|
23760
|
+
return "";
|
|
23761
|
+
});
|
|
23610
23762
|
if (sourceMapText) {
|
|
23611
|
-
parsed = SourceMap.parseWithLines(sourceMapText
|
|
23612
|
-
|
|
23613
|
-
|
|
23614
|
-
return codeWithSourceMap;
|
|
23763
|
+
parsed = SourceMap.parseWithLines(sourceMapText);
|
|
23764
|
+
composedLines = SourceMap.composeLines(upstreamMap.data.lines, parsed.lines);
|
|
23765
|
+
upstreamMap.data.lines = composedLines;
|
|
23615
23766
|
}
|
|
23616
|
-
composedLines = SourceMap.composeLines(upstreamMap.data.lines, parsed.lines);
|
|
23617
|
-
upstreamMap.data.lines = composedLines;
|
|
23618
23767
|
remappedSourceMapJSON = upstreamMap.json(sourcePath, targetPath);
|
|
23619
|
-
codeWithoutSourceMap = codeWithSourceMap.replace(smRegexp, "");
|
|
23620
23768
|
newSourceMap = `${"sourceMapping"}URL=data:application/json;charset=utf-8;base64,${base64Encode(JSON.stringify(remappedSourceMapJSON))}`;
|
|
23621
23769
|
remappedCodeWithSourceMap = `${codeWithoutSourceMap}
|
|
23622
23770
|
//# ${newSourceMap}`;
|
|
@@ -23786,15 +23934,14 @@ remapPosition = function(position, sourcemapLines) {
|
|
|
23786
23934
|
// source/main.coffee
|
|
23787
23935
|
"civet coffeeCompat";
|
|
23788
23936
|
var SourceMap2;
|
|
23789
|
-
var base64Encode2;
|
|
23790
23937
|
var makeCache;
|
|
23791
23938
|
var parse;
|
|
23792
23939
|
var uncacheable;
|
|
23793
23940
|
({ parse } = import_parser.default);
|
|
23794
|
-
({ SourceMap: SourceMap2
|
|
23941
|
+
({ SourceMap: SourceMap2 } = util_exports);
|
|
23795
23942
|
uncacheable = /* @__PURE__ */ new Set(["ActualAssignment", "AllowAll", "AllowClassImplicitCall", "AllowIndentedApplication", "AllowMultiLineImplicitObjectLiteral", "AllowTrailingMemberProperty", "AllowedTrailingMemberExpressions", "ApplicationStart", "Arguments", "ArgumentsWithTrailingMemberExpressions", "ArrowFunction", "ArrowFunctionTail", "AssignmentExpression", "AssignmentExpressionTail", "BinaryOpExpression", "BinaryOpRHS", "BracedBlock", "BracedObjectLiteralContent", "BracedOrEmptyBlock", "CallExpression", "CallExpressionRest", "ClassImplicitCallForbidden", "CoffeeCommentEnabled", "CommaDelimiter", "ConditionalExpression", "Declaration", "Debugger", "Dedented", "ElementListWithIndentedApplicationForbidden", "ElseClause", "Expression", "ExpressionStatement", "ExpressionWithIndentedApplicationForbidden", "ExtendedExpression", "FatArrowBody", "ForbidClassImplicitCall", "ForbidIndentedApplication", "ForbidMultiLineImplicitObjectLiteral", "ForbidTrailingMemberProperty", "FunctionDeclaration", "FunctionExpression", "HoistableDeclaration", "ImplicitArguments", "ImplicitInlineObjectPropertyDelimiter", "ImplicitNestedBlock", "IndentedApplicationAllowed", "IndentedFurther", "IndentedJSXChildExpression", "InlineObjectLiteral", "InsertIndent", "JSXChild", "JSXChildren", "JSXElement", "JSXFragment", "JSXImplicitFragment", "JSXMixedChildren", "JSXNested", "JSXNestedChildren", "JSXOptionalClosingElement", "JSXOptionalClosingFragment", "JSXTag", "LeftHandSideExpression", "MemberExpression", "MemberExpressionRest", "Nested", "NestedBindingElement", "NestedBindingElements", "NestedBlockExpression", "NestedBlockExpression", "NestedBlockStatement", "NestedBlockStatements", "NestedClassSignatureElement", "NestedClassSignatureElements", "NestedDeclareElement", "NestedDeclareElements", "NestedElement", "NestedElementList", "NestedImplicitObjectLiteral", "NestedImplicitPropertyDefinition", "NestedImplicitPropertyDefinitions", "NestedInterfaceProperty", "NestedJSXChildExpression", "NestedModuleItem", "NestedModuleItems", "NestedNonAssignmentExtendedExpression", "NestedObject", "NestedPropertyDefinitions", "NonSingleBracedBlock", "NotDedented", "ObjectLiteral", "PopIndent", "PopJSXStack", "PostfixedExpression", "PostfixedStatement", "PrimaryExpression", "PushIndent", "PushJSXOpeningElement", "PushJSXOpeningFragment", "RestoreAll", "RestoreClassImplicitCall", "RestoreMultiLineImplicitObjectLiteral", "RestoreIndentedApplication", "RestoreTrailingMemberProperty", "RHS", "Samedent", "ShortCircuitExpression", "SingleLineAssignmentExpression", "SingleLineComment", "SingleLineStatements", "SnugNamedProperty", "Statement", "StatementListItem", "SuffixedExpression", "SuffixedStatement", "ThinArrowFunction", "TrackIndented", "TrailingMemberExpressions", "TrailingMemberPropertyAllowed", "TypedJSXElement", "TypedJSXFragment", "UnaryExpression", "UpdateExpression"]);
|
|
23796
23943
|
var compile = function(src, options) {
|
|
23797
|
-
var ast, code, events, filename, ref, result, sm
|
|
23944
|
+
var ast, code, events, filename, ref, result, sm;
|
|
23798
23945
|
if (!options) {
|
|
23799
23946
|
options = {};
|
|
23800
23947
|
} else {
|
|
@@ -23816,10 +23963,7 @@ var compile = function(src, options) {
|
|
|
23816
23963
|
options.updateSourceMap = sm.updateSourceMap;
|
|
23817
23964
|
code = generate_default(ast, options);
|
|
23818
23965
|
if (options.inlineMap) {
|
|
23819
|
-
|
|
23820
|
-
return `${code}
|
|
23821
|
-
${"//#"} sourceMappingURL=data:application/json;base64,${base64Encode2(JSON.stringify(srcMapJSON))}
|
|
23822
|
-
`;
|
|
23966
|
+
return SourceMap2.remap(code, sm, filename, filename + ".tsx");
|
|
23823
23967
|
} else {
|
|
23824
23968
|
return {
|
|
23825
23969
|
code,
|