@oomol-lab/open-flow 0.1.0-alpha.9 → 0.1.0-beta.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/README.md +5 -1
- package/dist/browser/createResourceDialog-BkZns-oZ.js +504 -0
- package/dist/browser/diagnostics-giPSzyMo.js +9346 -0
- package/dist/browser/{dist-DhsGR_K3.js → dist-3Mj8q8Pr.js} +27 -27
- package/dist/browser/{dist-n9WmBm5w.js → dist-BKuSVKCC.js} +1 -1
- package/dist/browser/{dist-DQVavPcf.js → dist-BMqL-qR5.js} +469 -903
- package/dist/browser/{dist-D5mdziGP.js → dist-BN4ZCyOB.js} +9 -9
- package/dist/browser/{dist-CVtP-E2c.js → dist-BpopSHwP.js} +1 -1
- package/dist/browser/{dist-B0Q2Mn0n.js → dist-CJpzJrLM.js} +191 -191
- package/dist/browser/{dist-DXgEYMFx.js → dist-CPuF50D9.js} +196 -196
- package/dist/browser/{dist-CUkceEvN.js → dist-CUSrALSX.js} +113 -113
- package/dist/browser/dist-CeSZ2xSM.js +444 -0
- package/dist/browser/{dist-Bc9TvHYl.js → dist-DUzA0Ukh.js} +20 -20
- package/dist/browser/{dist-DWzdGVm9.js → dist-DWADUsVB.js} +74 -74
- package/dist/browser/{esm-YIGXG-Js.js → esm-B_PbUobB.js} +13 -13
- package/dist/browser/flow-authoring-node.d.ts +4 -2
- package/dist/browser/flow-authoring.d.ts +2 -1
- package/dist/browser/flow-authoring.js +400 -100
- package/dist/browser/flow-change.d.ts +9 -4
- package/dist/browser/flow-change.js +49 -46
- package/dist/browser/{flowRunInputEditorStore-DXOyyY7o.js → flowRunInputEditorStore-BeyUSWpO.js} +1644 -908
- package/dist/browser/{flowWorkspace-D7-rBA1-.js → flowWorkspace-DAMLVMcF.js} +18416 -16444
- package/dist/browser/getPseudoElementBounds-ESJExRFX.js +7642 -0
- package/dist/browser/languages-DgJehE1g.js +62 -0
- package/dist/browser/lib-C5Ipyfps.js +7856 -0
- package/dist/browser/licenses.md +119 -1
- package/dist/browser/main-DmjVyuWr.js +76 -0
- package/dist/browser/{markdownContent-ColGUxHy.js → markdownContent-DdlIRN3_.js} +4811 -4795
- package/dist/browser/theme.css +63 -0
- package/dist/browser/theme.css.d.ts +1 -0
- package/dist/browser/typeScriptSession-mPCiA9sV.js +2579 -0
- package/dist/browser/workbench-contract.d.ts +2 -1
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +46 -1
- package/dist/browser/workbench.js +1132 -1474
- package/dist/browser/workbenchSelect-B2s1HV-Y.js +1374 -0
- package/dist/common/connector-action.d.ts +6 -0
- package/dist/common/connector-action.js +37 -29
- package/dist/common/control-api-conformance.js +80 -29
- package/dist/common/control-api-errors.d.ts +24 -0
- package/dist/common/control-api.d.ts +54 -7
- package/dist/common/control-api.js +226 -95
- package/dist/common/flow-encoding.d.ts +2 -2
- package/dist/common/flow-encoding.js +4 -1
- package/dist/common/flow-semantics.d.ts +3 -0
- package/dist/common/flow-semantics.js +939 -851
- package/dist/common/integration-trigger.d.ts +1 -0
- package/dist/common/licenses.md +1 -25
- package/dist/common/localization.d.ts +21 -0
- package/dist/common/localization.js +62 -0
- package/dist/common/provider-triggers.js +4 -1
- package/dist/common/scheduler.d.ts +5 -5
- package/dist/common/scheduler.js +250 -236
- package/package.json +10 -1
- package/dist/browser/addNodeOptions-DRndy4EK.js +0 -6910
- package/dist/browser/createLucideIcon-CqjqCezK.js +0 -5537
- package/dist/browser/createResourceDialog-A64dDFCG.js +0 -467
- package/dist/browser/field-CKGQHCIi.js +0 -312
|
@@ -518,7 +518,7 @@ var ne = (t) => class extends t {
|
|
|
518
518
|
resetEndLocation(e, t = this.state.lastTokEndLoc) {
|
|
519
519
|
super.resetEndLocation(e, t), _(e);
|
|
520
520
|
}
|
|
521
|
-
}, v = !0, y = !0, re = !0,
|
|
521
|
+
}, v = !0, y = !0, re = !0, ie = !0, b = !0, ae = !0, oe = class {
|
|
522
522
|
label;
|
|
523
523
|
keyword;
|
|
524
524
|
beforeExpr;
|
|
@@ -532,324 +532,324 @@ var ne = (t) => class extends t {
|
|
|
532
532
|
constructor(e, t = {}) {
|
|
533
533
|
this.label = e, this.keyword = t.keyword, this.beforeExpr = !!t.beforeExpr, this.startsExpr = !!t.startsExpr, this.rightAssociative = !!t.rightAssociative, this.isLoop = !!t.isLoop, this.isAssign = !!t.isAssign, this.prefix = !!t.prefix, this.postfix = !!t.postfix, this.binop = t.binop == null ? null : t.binop;
|
|
534
534
|
}
|
|
535
|
-
},
|
|
536
|
-
function
|
|
535
|
+
}, se = /* @__PURE__ */ new Map();
|
|
536
|
+
function x(e, t = {}) {
|
|
537
537
|
t.keyword = e;
|
|
538
|
-
let n =
|
|
539
|
-
return
|
|
538
|
+
let n = w(e, t);
|
|
539
|
+
return se.set(e, n), n;
|
|
540
540
|
}
|
|
541
|
-
function
|
|
542
|
-
return
|
|
541
|
+
function S(e, t) {
|
|
542
|
+
return w(e, {
|
|
543
543
|
beforeExpr: v,
|
|
544
544
|
binop: t
|
|
545
545
|
});
|
|
546
546
|
}
|
|
547
|
-
var
|
|
548
|
-
function
|
|
549
|
-
return ++
|
|
547
|
+
var C = -1, ce = [], le = [], ue = [], de = [], fe = [], pe = [];
|
|
548
|
+
function w(e, t = {}) {
|
|
549
|
+
return ++C, le.push(e), ue.push(t.binop ?? -1), de.push(t.beforeExpr ?? !1), fe.push(t.startsExpr ?? !1), pe.push(t.prefix ?? !1), ce.push(new oe(e, t)), C;
|
|
550
550
|
}
|
|
551
|
-
function
|
|
552
|
-
return ++
|
|
551
|
+
function T(e, t = {}) {
|
|
552
|
+
return ++C, se.set(e, C), le.push(e), ue.push(t.binop ?? -1), de.push(t.beforeExpr ?? !1), fe.push(t.startsExpr ?? !1), pe.push(t.prefix ?? !1), ce.push(new oe("name", t)), C;
|
|
553
553
|
}
|
|
554
|
-
var
|
|
555
|
-
bracketL:
|
|
554
|
+
var me = {
|
|
555
|
+
bracketL: w("[", {
|
|
556
556
|
beforeExpr: v,
|
|
557
557
|
startsExpr: y
|
|
558
558
|
}),
|
|
559
|
-
bracketR:
|
|
560
|
-
braceL:
|
|
559
|
+
bracketR: w("]"),
|
|
560
|
+
braceL: w("{", {
|
|
561
561
|
beforeExpr: v,
|
|
562
562
|
startsExpr: y
|
|
563
563
|
}),
|
|
564
|
-
braceBarL:
|
|
564
|
+
braceBarL: w("{|", {
|
|
565
565
|
beforeExpr: v,
|
|
566
566
|
startsExpr: y
|
|
567
567
|
}),
|
|
568
|
-
braceR:
|
|
569
|
-
braceBarR:
|
|
570
|
-
parenL:
|
|
568
|
+
braceR: w("}"),
|
|
569
|
+
braceBarR: w("|}"),
|
|
570
|
+
parenL: w("(", {
|
|
571
571
|
beforeExpr: v,
|
|
572
572
|
startsExpr: y
|
|
573
573
|
}),
|
|
574
|
-
parenR:
|
|
575
|
-
comma:
|
|
576
|
-
semi:
|
|
577
|
-
colon:
|
|
578
|
-
doubleColon:
|
|
579
|
-
dot:
|
|
580
|
-
question:
|
|
581
|
-
questionDot:
|
|
582
|
-
arrow:
|
|
583
|
-
template:
|
|
584
|
-
ellipsis:
|
|
585
|
-
backQuote:
|
|
586
|
-
dollarBraceL:
|
|
574
|
+
parenR: w(")"),
|
|
575
|
+
comma: w(",", { beforeExpr: v }),
|
|
576
|
+
semi: w(";", { beforeExpr: v }),
|
|
577
|
+
colon: w(":", { beforeExpr: v }),
|
|
578
|
+
doubleColon: w("::", { beforeExpr: v }),
|
|
579
|
+
dot: w("."),
|
|
580
|
+
question: w("?", { beforeExpr: v }),
|
|
581
|
+
questionDot: w("?."),
|
|
582
|
+
arrow: w("=>", { beforeExpr: v }),
|
|
583
|
+
template: w("template"),
|
|
584
|
+
ellipsis: w("...", { beforeExpr: v }),
|
|
585
|
+
backQuote: w("`", { startsExpr: y }),
|
|
586
|
+
dollarBraceL: w("${", {
|
|
587
587
|
beforeExpr: v,
|
|
588
588
|
startsExpr: y
|
|
589
589
|
}),
|
|
590
|
-
templateTail:
|
|
591
|
-
templateNonTail:
|
|
590
|
+
templateTail: w("...`", { startsExpr: y }),
|
|
591
|
+
templateNonTail: w("...${", {
|
|
592
592
|
beforeExpr: v,
|
|
593
593
|
startsExpr: y
|
|
594
594
|
}),
|
|
595
|
-
at:
|
|
596
|
-
hash:
|
|
597
|
-
interpreterDirective:
|
|
598
|
-
eq:
|
|
595
|
+
at: w("@"),
|
|
596
|
+
hash: w("#", { startsExpr: y }),
|
|
597
|
+
interpreterDirective: w("#!..."),
|
|
598
|
+
eq: w("=", {
|
|
599
599
|
beforeExpr: v,
|
|
600
|
-
isAssign:
|
|
600
|
+
isAssign: ie
|
|
601
601
|
}),
|
|
602
|
-
assign:
|
|
602
|
+
assign: w("_=", {
|
|
603
603
|
beforeExpr: v,
|
|
604
|
-
isAssign:
|
|
604
|
+
isAssign: ie
|
|
605
605
|
}),
|
|
606
|
-
slashAssign:
|
|
606
|
+
slashAssign: w("_=", {
|
|
607
607
|
beforeExpr: v,
|
|
608
|
-
isAssign:
|
|
608
|
+
isAssign: ie
|
|
609
609
|
}),
|
|
610
|
-
xorAssign:
|
|
610
|
+
xorAssign: w("_=", {
|
|
611
611
|
beforeExpr: v,
|
|
612
|
-
isAssign:
|
|
612
|
+
isAssign: ie
|
|
613
613
|
}),
|
|
614
|
-
moduloAssign:
|
|
614
|
+
moduloAssign: w("_=", {
|
|
615
615
|
beforeExpr: v,
|
|
616
|
-
isAssign:
|
|
616
|
+
isAssign: ie
|
|
617
617
|
}),
|
|
618
|
-
incDec:
|
|
619
|
-
prefix:
|
|
620
|
-
postfix:
|
|
618
|
+
incDec: w("++/--", {
|
|
619
|
+
prefix: b,
|
|
620
|
+
postfix: ae,
|
|
621
621
|
startsExpr: y
|
|
622
622
|
}),
|
|
623
|
-
bang:
|
|
623
|
+
bang: w("!", {
|
|
624
624
|
beforeExpr: v,
|
|
625
|
-
prefix:
|
|
625
|
+
prefix: b,
|
|
626
626
|
startsExpr: y
|
|
627
627
|
}),
|
|
628
|
-
tilde:
|
|
628
|
+
tilde: w("~", {
|
|
629
629
|
beforeExpr: v,
|
|
630
|
-
prefix:
|
|
630
|
+
prefix: b,
|
|
631
631
|
startsExpr: y
|
|
632
632
|
}),
|
|
633
|
-
doubleCaret:
|
|
634
|
-
doubleAt:
|
|
635
|
-
pipeline:
|
|
636
|
-
nullishCoalescing:
|
|
637
|
-
logicalOR:
|
|
638
|
-
logicalAND:
|
|
639
|
-
bitwiseOR:
|
|
640
|
-
bitwiseXOR:
|
|
641
|
-
bitwiseAND:
|
|
642
|
-
equality:
|
|
643
|
-
lt:
|
|
644
|
-
gt:
|
|
645
|
-
relational:
|
|
646
|
-
bitShift:
|
|
647
|
-
bitShiftL:
|
|
648
|
-
bitShiftR:
|
|
649
|
-
plusMin:
|
|
633
|
+
doubleCaret: w("^^", { startsExpr: y }),
|
|
634
|
+
doubleAt: w("@@", { startsExpr: y }),
|
|
635
|
+
pipeline: S("|>", 0),
|
|
636
|
+
nullishCoalescing: S("??", 1),
|
|
637
|
+
logicalOR: S("||", 1),
|
|
638
|
+
logicalAND: S("&&", 2),
|
|
639
|
+
bitwiseOR: S("|", 3),
|
|
640
|
+
bitwiseXOR: S("^", 4),
|
|
641
|
+
bitwiseAND: S("&", 5),
|
|
642
|
+
equality: S("==/!=/===/!==", 6),
|
|
643
|
+
lt: S("</>/<=/>=", 7),
|
|
644
|
+
gt: S("</>/<=/>=", 7),
|
|
645
|
+
relational: S("</>/<=/>=", 7),
|
|
646
|
+
bitShift: S("<</>>/>>>", 8),
|
|
647
|
+
bitShiftL: S("<</>>/>>>", 8),
|
|
648
|
+
bitShiftR: S("<</>>/>>>", 8),
|
|
649
|
+
plusMin: w("+/-", {
|
|
650
650
|
beforeExpr: v,
|
|
651
651
|
binop: 9,
|
|
652
|
-
prefix:
|
|
652
|
+
prefix: b,
|
|
653
653
|
startsExpr: y
|
|
654
654
|
}),
|
|
655
|
-
modulo:
|
|
655
|
+
modulo: w("%", {
|
|
656
656
|
binop: 10,
|
|
657
657
|
startsExpr: y
|
|
658
658
|
}),
|
|
659
|
-
star:
|
|
660
|
-
slash:
|
|
661
|
-
exponent:
|
|
659
|
+
star: w("*", { binop: 10 }),
|
|
660
|
+
slash: S("/", 10),
|
|
661
|
+
exponent: w("**", {
|
|
662
662
|
beforeExpr: v,
|
|
663
663
|
binop: 11,
|
|
664
664
|
rightAssociative: !0
|
|
665
665
|
}),
|
|
666
|
-
_in:
|
|
666
|
+
_in: x("in", {
|
|
667
667
|
beforeExpr: v,
|
|
668
668
|
binop: 7
|
|
669
669
|
}),
|
|
670
|
-
_instanceof:
|
|
670
|
+
_instanceof: x("instanceof", {
|
|
671
671
|
beforeExpr: v,
|
|
672
672
|
binop: 7
|
|
673
673
|
}),
|
|
674
|
-
_break:
|
|
675
|
-
_case:
|
|
676
|
-
_catch:
|
|
677
|
-
_continue:
|
|
678
|
-
_debugger:
|
|
679
|
-
_default:
|
|
680
|
-
_else:
|
|
681
|
-
_finally:
|
|
682
|
-
_function:
|
|
683
|
-
_if:
|
|
684
|
-
_return:
|
|
685
|
-
_switch:
|
|
686
|
-
_throw:
|
|
674
|
+
_break: x("break"),
|
|
675
|
+
_case: x("case", { beforeExpr: v }),
|
|
676
|
+
_catch: x("catch"),
|
|
677
|
+
_continue: x("continue"),
|
|
678
|
+
_debugger: x("debugger"),
|
|
679
|
+
_default: x("default", { beforeExpr: v }),
|
|
680
|
+
_else: x("else", { beforeExpr: v }),
|
|
681
|
+
_finally: x("finally"),
|
|
682
|
+
_function: x("function", { startsExpr: y }),
|
|
683
|
+
_if: x("if"),
|
|
684
|
+
_return: x("return", { beforeExpr: v }),
|
|
685
|
+
_switch: x("switch"),
|
|
686
|
+
_throw: x("throw", {
|
|
687
687
|
beforeExpr: v,
|
|
688
|
-
prefix:
|
|
688
|
+
prefix: b,
|
|
689
689
|
startsExpr: y
|
|
690
690
|
}),
|
|
691
|
-
_try:
|
|
692
|
-
_var:
|
|
693
|
-
_const:
|
|
694
|
-
_with:
|
|
695
|
-
_new:
|
|
691
|
+
_try: x("try"),
|
|
692
|
+
_var: x("var"),
|
|
693
|
+
_const: x("const"),
|
|
694
|
+
_with: x("with"),
|
|
695
|
+
_new: x("new", {
|
|
696
696
|
beforeExpr: v,
|
|
697
697
|
startsExpr: y
|
|
698
698
|
}),
|
|
699
|
-
_this:
|
|
700
|
-
_super:
|
|
701
|
-
_class:
|
|
702
|
-
_extends:
|
|
703
|
-
_export:
|
|
704
|
-
_import:
|
|
705
|
-
_null:
|
|
706
|
-
_true:
|
|
707
|
-
_false:
|
|
708
|
-
_typeof:
|
|
699
|
+
_this: x("this", { startsExpr: y }),
|
|
700
|
+
_super: x("super", { startsExpr: y }),
|
|
701
|
+
_class: x("class", { startsExpr: y }),
|
|
702
|
+
_extends: x("extends", { beforeExpr: v }),
|
|
703
|
+
_export: x("export"),
|
|
704
|
+
_import: x("import", { startsExpr: y }),
|
|
705
|
+
_null: x("null", { startsExpr: y }),
|
|
706
|
+
_true: x("true", { startsExpr: y }),
|
|
707
|
+
_false: x("false", { startsExpr: y }),
|
|
708
|
+
_typeof: x("typeof", {
|
|
709
709
|
beforeExpr: v,
|
|
710
|
-
prefix:
|
|
710
|
+
prefix: b,
|
|
711
711
|
startsExpr: y
|
|
712
712
|
}),
|
|
713
|
-
_void:
|
|
713
|
+
_void: x("void", {
|
|
714
714
|
beforeExpr: v,
|
|
715
|
-
prefix:
|
|
715
|
+
prefix: b,
|
|
716
716
|
startsExpr: y
|
|
717
717
|
}),
|
|
718
|
-
_delete:
|
|
718
|
+
_delete: x("delete", {
|
|
719
719
|
beforeExpr: v,
|
|
720
|
-
prefix:
|
|
720
|
+
prefix: b,
|
|
721
721
|
startsExpr: y
|
|
722
722
|
}),
|
|
723
|
-
_do:
|
|
723
|
+
_do: x("do", {
|
|
724
724
|
isLoop: re,
|
|
725
725
|
beforeExpr: v
|
|
726
726
|
}),
|
|
727
|
-
_for:
|
|
728
|
-
_while:
|
|
729
|
-
_as:
|
|
730
|
-
_assert:
|
|
731
|
-
_async:
|
|
732
|
-
_await:
|
|
733
|
-
_defer:
|
|
734
|
-
_from:
|
|
735
|
-
_get:
|
|
736
|
-
_let:
|
|
737
|
-
_meta:
|
|
738
|
-
_of:
|
|
739
|
-
_sent:
|
|
740
|
-
_set:
|
|
741
|
-
_source:
|
|
742
|
-
_static:
|
|
743
|
-
_using:
|
|
744
|
-
_yield:
|
|
745
|
-
_asserts:
|
|
746
|
-
_checks:
|
|
747
|
-
_exports:
|
|
748
|
-
_global:
|
|
749
|
-
_implements:
|
|
750
|
-
_intrinsic:
|
|
751
|
-
_infer:
|
|
752
|
-
_is:
|
|
753
|
-
_mixins:
|
|
754
|
-
_proto:
|
|
755
|
-
_require:
|
|
756
|
-
_satisfies:
|
|
757
|
-
_keyof:
|
|
758
|
-
_readonly:
|
|
759
|
-
_unique:
|
|
760
|
-
_abstract:
|
|
761
|
-
_declare:
|
|
762
|
-
_enum:
|
|
763
|
-
_module:
|
|
764
|
-
_namespace:
|
|
765
|
-
_interface:
|
|
766
|
-
_type:
|
|
767
|
-
_opaque:
|
|
768
|
-
name:
|
|
769
|
-
placeholder:
|
|
770
|
-
string:
|
|
771
|
-
num:
|
|
772
|
-
bigint:
|
|
773
|
-
regexp:
|
|
774
|
-
privateName:
|
|
775
|
-
eof:
|
|
776
|
-
jsxName:
|
|
777
|
-
jsxText:
|
|
778
|
-
jsxTagStart:
|
|
779
|
-
jsxTagEnd:
|
|
727
|
+
_for: x("for", { isLoop: re }),
|
|
728
|
+
_while: x("while", { isLoop: re }),
|
|
729
|
+
_as: T("as", { startsExpr: y }),
|
|
730
|
+
_assert: T("assert", { startsExpr: y }),
|
|
731
|
+
_async: T("async", { startsExpr: y }),
|
|
732
|
+
_await: T("await", { startsExpr: y }),
|
|
733
|
+
_defer: T("defer", { startsExpr: y }),
|
|
734
|
+
_from: T("from", { startsExpr: y }),
|
|
735
|
+
_get: T("get", { startsExpr: y }),
|
|
736
|
+
_let: T("let", { startsExpr: y }),
|
|
737
|
+
_meta: T("meta", { startsExpr: y }),
|
|
738
|
+
_of: T("of", { startsExpr: y }),
|
|
739
|
+
_sent: T("sent", { startsExpr: y }),
|
|
740
|
+
_set: T("set", { startsExpr: y }),
|
|
741
|
+
_source: T("source", { startsExpr: y }),
|
|
742
|
+
_static: T("static", { startsExpr: y }),
|
|
743
|
+
_using: T("using", { startsExpr: y }),
|
|
744
|
+
_yield: T("yield", { startsExpr: y }),
|
|
745
|
+
_asserts: T("asserts", { startsExpr: y }),
|
|
746
|
+
_checks: T("checks", { startsExpr: y }),
|
|
747
|
+
_exports: T("exports", { startsExpr: y }),
|
|
748
|
+
_global: T("global", { startsExpr: y }),
|
|
749
|
+
_implements: T("implements", { startsExpr: y }),
|
|
750
|
+
_intrinsic: T("intrinsic", { startsExpr: y }),
|
|
751
|
+
_infer: T("infer", { startsExpr: y }),
|
|
752
|
+
_is: T("is", { startsExpr: y }),
|
|
753
|
+
_mixins: T("mixins", { startsExpr: y }),
|
|
754
|
+
_proto: T("proto", { startsExpr: y }),
|
|
755
|
+
_require: T("require", { startsExpr: y }),
|
|
756
|
+
_satisfies: T("satisfies", { startsExpr: y }),
|
|
757
|
+
_keyof: T("keyof", { startsExpr: y }),
|
|
758
|
+
_readonly: T("readonly", { startsExpr: y }),
|
|
759
|
+
_unique: T("unique", { startsExpr: y }),
|
|
760
|
+
_abstract: T("abstract", { startsExpr: y }),
|
|
761
|
+
_declare: T("declare", { startsExpr: y }),
|
|
762
|
+
_enum: T("enum", { startsExpr: y }),
|
|
763
|
+
_module: T("module", { startsExpr: y }),
|
|
764
|
+
_namespace: T("namespace", { startsExpr: y }),
|
|
765
|
+
_interface: T("interface", { startsExpr: y }),
|
|
766
|
+
_type: T("type", { startsExpr: y }),
|
|
767
|
+
_opaque: T("opaque", { startsExpr: y }),
|
|
768
|
+
name: w("name", { startsExpr: y }),
|
|
769
|
+
placeholder: w("%%", { startsExpr: y }),
|
|
770
|
+
string: w("string", { startsExpr: y }),
|
|
771
|
+
num: w("num", { startsExpr: y }),
|
|
772
|
+
bigint: w("bigint", { startsExpr: y }),
|
|
773
|
+
regexp: w("regexp", { startsExpr: y }),
|
|
774
|
+
privateName: w("#name", { startsExpr: y }),
|
|
775
|
+
eof: w("eof"),
|
|
776
|
+
jsxName: w("jsxName"),
|
|
777
|
+
jsxText: w("jsxText", { beforeExpr: v }),
|
|
778
|
+
jsxTagStart: w("jsxTagStart", { startsExpr: y }),
|
|
779
|
+
jsxTagEnd: w("jsxTagEnd")
|
|
780
780
|
};
|
|
781
|
-
function
|
|
781
|
+
function E(e) {
|
|
782
782
|
return e >= 89 && e <= 129;
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function he(e) {
|
|
785
785
|
return e <= 88;
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function D(e) {
|
|
788
788
|
return e >= 54 && e <= 129;
|
|
789
789
|
}
|
|
790
|
-
function he(e) {
|
|
791
|
-
return e >= 54 && e <= 132;
|
|
792
|
-
}
|
|
793
790
|
function ge(e) {
|
|
794
|
-
return
|
|
791
|
+
return e >= 54 && e <= 132;
|
|
795
792
|
}
|
|
796
|
-
function
|
|
793
|
+
function _e(e) {
|
|
797
794
|
return de[e];
|
|
798
795
|
}
|
|
799
|
-
function
|
|
800
|
-
return e
|
|
796
|
+
function O(e) {
|
|
797
|
+
return fe[e];
|
|
801
798
|
}
|
|
802
799
|
function ve(e) {
|
|
803
|
-
return e >=
|
|
800
|
+
return e >= 25 && e <= 29;
|
|
804
801
|
}
|
|
805
802
|
function ye(e) {
|
|
806
|
-
return e >=
|
|
803
|
+
return e >= 125 && e <= 127;
|
|
807
804
|
}
|
|
808
805
|
function be(e) {
|
|
809
|
-
return e >=
|
|
806
|
+
return e >= 86 && e <= 88;
|
|
810
807
|
}
|
|
811
808
|
function xe(e) {
|
|
812
|
-
return e >=
|
|
809
|
+
return e >= 54 && e <= 88;
|
|
813
810
|
}
|
|
814
811
|
function Se(e) {
|
|
815
|
-
return e
|
|
812
|
+
return e >= 35 && e <= 55;
|
|
816
813
|
}
|
|
817
814
|
function Ce(e) {
|
|
818
|
-
return
|
|
815
|
+
return e === 30;
|
|
819
816
|
}
|
|
820
817
|
function we(e) {
|
|
821
|
-
return e
|
|
818
|
+
return pe[e];
|
|
822
819
|
}
|
|
823
820
|
function Te(e) {
|
|
824
|
-
return e >=
|
|
825
|
-
}
|
|
826
|
-
function A(e) {
|
|
827
|
-
return ce[e];
|
|
821
|
+
return e >= 117 && e <= 119;
|
|
828
822
|
}
|
|
829
823
|
function Ee(e) {
|
|
824
|
+
return e >= 120 && e <= 126;
|
|
825
|
+
}
|
|
826
|
+
function k(e) {
|
|
830
827
|
return le[e];
|
|
831
828
|
}
|
|
832
829
|
function De(e) {
|
|
833
|
-
return e
|
|
830
|
+
return ue[e];
|
|
834
831
|
}
|
|
835
832
|
function Oe(e) {
|
|
836
|
-
return e
|
|
833
|
+
return e === 53;
|
|
837
834
|
}
|
|
838
835
|
function ke(e) {
|
|
839
|
-
return
|
|
836
|
+
return e >= 20 && e <= 21;
|
|
837
|
+
}
|
|
838
|
+
function Ae(e) {
|
|
839
|
+
return ce[e];
|
|
840
840
|
}
|
|
841
|
-
var
|
|
841
|
+
var je = class {
|
|
842
842
|
constructor(e, t) {
|
|
843
843
|
this.token = e, this.preserveSpace = !!t;
|
|
844
844
|
}
|
|
845
845
|
token;
|
|
846
846
|
preserveSpace;
|
|
847
|
-
},
|
|
848
|
-
brace: new
|
|
849
|
-
j_oTag: new
|
|
850
|
-
j_cTag: new
|
|
851
|
-
j_expr: new
|
|
852
|
-
},
|
|
847
|
+
}, A = {
|
|
848
|
+
brace: new je("{"),
|
|
849
|
+
j_oTag: new je("<tag"),
|
|
850
|
+
j_cTag: new je("</tag"),
|
|
851
|
+
j_expr: new je("<tag>...</tag>", !0)
|
|
852
|
+
}, Me = /[\p{ID_Start}\u088f\u0c5c\u0cdc\ua7ce\ua7cf\ua7d2\ua7d4\ua7f1]/u, Ne = /[\p{ID_Continue}\u088f\u0c5c\u0cdc\ua7ce\ua7cf\ua7d2\ua7d4\ua7f1\u1acf-\u1add\u1ae0-\u1aeb]/u, Pe = [
|
|
853
853
|
2368,
|
|
854
854
|
25,
|
|
855
855
|
1388,
|
|
@@ -886,7 +886,7 @@ var Ae = class {
|
|
|
886
886
|
11,
|
|
887
887
|
21763,
|
|
888
888
|
4297
|
|
889
|
-
],
|
|
889
|
+
], Fe = [
|
|
890
890
|
3834,
|
|
891
891
|
1,
|
|
892
892
|
3173,
|
|
@@ -902,7 +902,7 @@ var Ae = class {
|
|
|
902
902
|
6,
|
|
903
903
|
0
|
|
904
904
|
];
|
|
905
|
-
function
|
|
905
|
+
function Ie(e, t) {
|
|
906
906
|
let n = 65536;
|
|
907
907
|
for (let r = 0, i = t.length; r < i; r += 2) {
|
|
908
908
|
if (n += t[r], n > e) return !1;
|
|
@@ -910,13 +910,13 @@ function Fe(e, t) {
|
|
|
910
910
|
}
|
|
911
911
|
return !1;
|
|
912
912
|
}
|
|
913
|
-
function
|
|
914
|
-
return e < 65 ? e === 36 : e <= 90 ? !0 : e < 97 ? e === 95 : e <= 122 ? !0 : e <= 65535 ? e >= 170 &&
|
|
913
|
+
function j(e) {
|
|
914
|
+
return e < 65 ? e === 36 : e <= 90 ? !0 : e < 97 ? e === 95 : e <= 122 ? !0 : e <= 65535 ? e >= 170 && Me.test(String.fromCharCode(e)) : !isNaN(e) && e <= 1114111 && (Me.test(String.fromCodePoint(e)) || Ie(e, Pe));
|
|
915
915
|
}
|
|
916
|
-
function
|
|
917
|
-
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e <= 90 ? !0 : e < 97 ? e === 95 : e <= 122 ? !0 : e <= 65535 ? e >= 170 &&
|
|
916
|
+
function M(e) {
|
|
917
|
+
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e <= 90 ? !0 : e < 97 ? e === 95 : e <= 122 ? !0 : e <= 65535 ? e >= 170 && Ne.test(String.fromCharCode(e)) : !isNaN(e) && e <= 1114111 && (Ne.test(String.fromCodePoint(e)) || Ie(e, Pe) || Ie(e, Fe));
|
|
918
918
|
}
|
|
919
|
-
var
|
|
919
|
+
var Le = {
|
|
920
920
|
keyword: /* @__PURE__ */ "break.case.catch.continue.debugger.default.do.else.finally.for.function.if.return.switch.throw.try.var.const.while.with.new.this.super.class.extends.export.import.null.true.false.in.instanceof.typeof.void.delete".split("."),
|
|
921
921
|
strict: [
|
|
922
922
|
"implements",
|
|
@@ -930,37 +930,37 @@ var Ie = {
|
|
|
930
930
|
"yield"
|
|
931
931
|
],
|
|
932
932
|
strictBind: ["eval", "arguments"]
|
|
933
|
-
},
|
|
934
|
-
function
|
|
933
|
+
}, Re = new Set(Le.keyword), ze = new Set(Le.strict), Be = new Set(Le.strictBind);
|
|
934
|
+
function Ve(e, t) {
|
|
935
935
|
return t && e === "await" || e === "enum";
|
|
936
936
|
}
|
|
937
|
-
function
|
|
938
|
-
return
|
|
937
|
+
function He(e, t) {
|
|
938
|
+
return Ve(e, t) || ze.has(e);
|
|
939
939
|
}
|
|
940
|
-
function
|
|
941
|
-
return
|
|
940
|
+
function Ue(e) {
|
|
941
|
+
return Be.has(e);
|
|
942
942
|
}
|
|
943
|
-
function
|
|
944
|
-
return
|
|
943
|
+
function We(e, t) {
|
|
944
|
+
return He(e, t) || Ue(e);
|
|
945
945
|
}
|
|
946
|
-
function
|
|
947
|
-
return
|
|
946
|
+
function Ge(e) {
|
|
947
|
+
return Re.has(e);
|
|
948
948
|
}
|
|
949
|
-
function
|
|
950
|
-
return e === 64 && t === 64 &&
|
|
949
|
+
function Ke(e, t, n) {
|
|
950
|
+
return e === 64 && t === 64 && j(n);
|
|
951
951
|
}
|
|
952
|
-
var
|
|
953
|
-
function
|
|
954
|
-
return
|
|
952
|
+
var qe = /* @__PURE__ */ new Set(/* @__PURE__ */ "break.case.catch.continue.debugger.default.do.else.finally.for.function.if.return.switch.throw.try.var.const.while.with.new.this.super.class.extends.export.import.null.true.false.in.instanceof.typeof.void.delete.implements.interface.let.package.private.protected.public.static.yield.eval.arguments.enum.await".split("."));
|
|
953
|
+
function Je(e) {
|
|
954
|
+
return qe.has(e);
|
|
955
955
|
}
|
|
956
|
-
var
|
|
956
|
+
var Ye = class {
|
|
957
957
|
flags = 0;
|
|
958
958
|
names = /* @__PURE__ */ new Map();
|
|
959
959
|
firstLexicalName = "";
|
|
960
960
|
constructor(e) {
|
|
961
961
|
this.flags = e;
|
|
962
962
|
}
|
|
963
|
-
},
|
|
963
|
+
}, Xe = class {
|
|
964
964
|
parser;
|
|
965
965
|
scopeStack = [];
|
|
966
966
|
inModule;
|
|
@@ -1007,7 +1007,7 @@ var Je = class {
|
|
|
1007
1007
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
1008
1008
|
}
|
|
1009
1009
|
createScope(e) {
|
|
1010
|
-
return new
|
|
1010
|
+
return new Ye(e);
|
|
1011
1011
|
}
|
|
1012
1012
|
enter(e) {
|
|
1013
1013
|
this.scopeStack.push(this.createScope(e));
|
|
@@ -1058,11 +1058,11 @@ var Je = class {
|
|
|
1058
1058
|
if (t & 3779 && !(t & 4)) return t;
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
|
-
}, Xe = class extends Je {
|
|
1062
|
-
declareFunctions = /* @__PURE__ */ new Set();
|
|
1063
1061
|
}, Ze = class extends Ye {
|
|
1062
|
+
declareFunctions = /* @__PURE__ */ new Set();
|
|
1063
|
+
}, Qe = class extends Xe {
|
|
1064
1064
|
createScope(e) {
|
|
1065
|
-
return new
|
|
1065
|
+
return new Ze(e);
|
|
1066
1066
|
}
|
|
1067
1067
|
declareName(e, t, n) {
|
|
1068
1068
|
let r = this.currentScope();
|
|
@@ -1083,7 +1083,7 @@ var Je = class {
|
|
|
1083
1083
|
checkLocalExport(e) {
|
|
1084
1084
|
this.scopeStack[0].declareFunctions.has(e.name) || super.checkLocalExport(e);
|
|
1085
1085
|
}
|
|
1086
|
-
},
|
|
1086
|
+
}, $e = /* @__PURE__ */ new Set([
|
|
1087
1087
|
"_",
|
|
1088
1088
|
"any",
|
|
1089
1089
|
"bool",
|
|
@@ -1100,7 +1100,7 @@ var Je = class {
|
|
|
1100
1100
|
"true",
|
|
1101
1101
|
"typeof",
|
|
1102
1102
|
"void"
|
|
1103
|
-
]),
|
|
1103
|
+
]), N = h`flow`({
|
|
1104
1104
|
AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",
|
|
1105
1105
|
AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",
|
|
1106
1106
|
AssignReservedType: ({ reservedType: e }) => `Cannot overwrite reserved type ${e}.`,
|
|
@@ -1149,27 +1149,27 @@ var Je = class {
|
|
|
1149
1149
|
UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.",
|
|
1150
1150
|
UnterminatedFlowComment: "Unterminated flow-comment."
|
|
1151
1151
|
});
|
|
1152
|
-
function
|
|
1152
|
+
function et(e) {
|
|
1153
1153
|
return e.type === "DeclareExportAllDeclaration" || e.type === "DeclareExportDeclaration" && (!e.declaration || e.declaration.type !== "TypeAlias" && e.declaration.type !== "InterfaceDeclaration");
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1155
|
+
function tt(e) {
|
|
1156
1156
|
return e.importKind === "type" || e.importKind === "typeof";
|
|
1157
1157
|
}
|
|
1158
|
-
var
|
|
1158
|
+
var nt = {
|
|
1159
1159
|
const: "declare export var",
|
|
1160
1160
|
let: "declare export var",
|
|
1161
1161
|
type: "export type",
|
|
1162
1162
|
interface: "export interface"
|
|
1163
1163
|
};
|
|
1164
|
-
function
|
|
1164
|
+
function rt(e, t) {
|
|
1165
1165
|
let n = [], r = [];
|
|
1166
1166
|
for (let i = 0; i < e.length; i++) (t(e[i], i, e) ? n : r).push(e[i]);
|
|
1167
1167
|
return [n, r];
|
|
1168
1168
|
}
|
|
1169
|
-
var
|
|
1169
|
+
var it = /\*?\s*@((?:no)?flow)\b/, at = (e) => class extends e {
|
|
1170
1170
|
flowPragma = void 0;
|
|
1171
1171
|
getScopeHandler() {
|
|
1172
|
-
return
|
|
1172
|
+
return Qe;
|
|
1173
1173
|
}
|
|
1174
1174
|
shouldParseTypes() {
|
|
1175
1175
|
return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
|
|
@@ -1179,7 +1179,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1179
1179
|
}
|
|
1180
1180
|
addComment(e) {
|
|
1181
1181
|
if (this.flowPragma === void 0) {
|
|
1182
|
-
let t =
|
|
1182
|
+
let t = it.exec(e.value);
|
|
1183
1183
|
if (t) {
|
|
1184
1184
|
if (t[1] === "flow") this.flowPragma = "flow";
|
|
1185
1185
|
else if (t[1] === "noflow") this.flowPragma = "noflow";
|
|
@@ -1196,7 +1196,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
flowParsePredicate() {
|
|
1198
1198
|
let e = this.startNode(), t = this.state.startLoc;
|
|
1199
|
-
return this.next(), this.expectContextual(106), this.state.lastTokStartLoc.index > t.index + 1 && this.raise(
|
|
1199
|
+
return this.next(), this.expectContextual(106), this.state.lastTokStartLoc.index > t.index + 1 && this.raise(N.UnexpectedSpaceBetweenModuloChecks, t), this.eat(6) ? (e.value = super.parseExpression(), this.expect(7), this.finishNode(e, "DeclaredPredicate")) : this.finishNode(e, "InferredPredicate");
|
|
1200
1200
|
}
|
|
1201
1201
|
flowParseTypeAndPredicateInitialiser(e) {
|
|
1202
1202
|
let t = this.state.inType;
|
|
@@ -1218,7 +1218,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1218
1218
|
if (this.match(76)) return this.flowParseDeclareClass(e);
|
|
1219
1219
|
if (this.match(64)) return this.flowParseDeclareFunction(e);
|
|
1220
1220
|
if (this.match(70)) return this.flowParseDeclareVariable(e);
|
|
1221
|
-
if (this.eatContextual(123)) return this.match(12) ? this.flowParseDeclareModuleExports(e) : (t && this.raise(
|
|
1221
|
+
if (this.eatContextual(123)) return this.match(12) ? this.flowParseDeclareModuleExports(e) : (t && this.raise(N.NestedDeclareModule, this.state.lastTokStartLoc), this.flowParseDeclareModule(e));
|
|
1222
1222
|
if (this.isContextual(126)) return this.flowParseDeclareTypeAlias(e);
|
|
1223
1223
|
if (this.isContextual(127)) return this.flowParseDeclareOpaqueType(e);
|
|
1224
1224
|
if (this.isContextual(125)) return this.flowParseDeclareInterface(e);
|
|
@@ -1233,21 +1233,21 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1233
1233
|
let t = this.startNode(), n = t.body = [];
|
|
1234
1234
|
for (this.expect(2); !this.match(4);) {
|
|
1235
1235
|
let e = this.startNode();
|
|
1236
|
-
this.match(79) ? (this.next(), !this.isContextual(126) && !this.match(83) && this.raise(
|
|
1236
|
+
this.match(79) ? (this.next(), !this.isContextual(126) && !this.match(83) && this.raise(N.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc), n.push(super.parseImport(e))) : (this.expectContextual(121, N.UnsupportedStatementInDeclareModule), n.push(this.flowParseDeclare(e, !0)));
|
|
1237
1237
|
}
|
|
1238
1238
|
this.scope.exit(), this.expect(4), e.body = this.finishNode(t, "BlockStatement");
|
|
1239
1239
|
let r = null, i = !1;
|
|
1240
1240
|
return n.forEach((e) => {
|
|
1241
|
-
|
|
1241
|
+
et(e) ? (r === "CommonJS" && this.raise(N.AmbiguousDeclareModuleKind, e), r = "ES") : e.type === "DeclareModuleExports" && (i && this.raise(N.DuplicateDeclareModuleExports, e), r === "ES" && this.raise(N.AmbiguousDeclareModuleKind, e), r = "CommonJS", i = !0);
|
|
1242
1242
|
}), e.kind = r || "CommonJS", this.finishNode(e, "DeclareModule");
|
|
1243
1243
|
}
|
|
1244
1244
|
flowParseDeclareExportDeclaration(e, t) {
|
|
1245
1245
|
if (this.expect(78), this.eat(61)) return this.match(64) || this.match(76) ? e.declaration = this.flowParseDeclare(this.startNode()) : (e.declaration = this.flowParseType(), this.semicolon()), e.default = !0, this.finishNode(e, "DeclareExportDeclaration");
|
|
1246
1246
|
if (this.match(71) || this.isLet() || (this.isContextual(126) || this.isContextual(125)) && !t) {
|
|
1247
1247
|
let e = this.state.value;
|
|
1248
|
-
throw this.raise(
|
|
1248
|
+
throw this.raise(N.UnsupportedDeclareExportKind, this.state.startLoc, {
|
|
1249
1249
|
unsupportedExportKind: e,
|
|
1250
|
-
suggestion:
|
|
1250
|
+
suggestion: nt[e]
|
|
1251
1251
|
});
|
|
1252
1252
|
}
|
|
1253
1253
|
if (this.match(70) || this.match(64) || this.match(76) || this.isContextual(127)) return e.declaration = this.flowParseDeclare(this.startNode()), e.default = !1, this.finishNode(e, "DeclareExportDeclaration");
|
|
@@ -1301,10 +1301,10 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1301
1301
|
return this.flowParseInterfaceish(e, !1), this.finishNode(e, "InterfaceDeclaration");
|
|
1302
1302
|
}
|
|
1303
1303
|
checkNotUnderscore(e) {
|
|
1304
|
-
e === "_" && this.raise(
|
|
1304
|
+
e === "_" && this.raise(N.UnexpectedReservedUnderscore, this.state.startLoc);
|
|
1305
1305
|
}
|
|
1306
1306
|
checkReservedType(e, t, n) {
|
|
1307
|
-
|
|
1307
|
+
$e.has(e) && this.raise(n ? N.AssignReservedType : N.UnexpectedReservedType, t, { reservedType: e });
|
|
1308
1308
|
}
|
|
1309
1309
|
flowParseRestrictedIdentifierName(e, t) {
|
|
1310
1310
|
return this.checkReservedType(this.state.value, this.state.startLoc, t), this.parseIdentifierName(e);
|
|
@@ -1327,7 +1327,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1327
1327
|
}
|
|
1328
1328
|
flowParseTypeParameter(e = !1) {
|
|
1329
1329
|
let t = this.state.startLoc, n = this.startNode(), r = this.flowParseVariance();
|
|
1330
|
-
return n.name = this.flowParseRestrictedIdentifierName(), n.variance = r, n.bound = this.flowParseTypeParameterBound(), this.match(25) ? (this.eat(25), n.default = this.flowParseType()) : e && this.raise(
|
|
1330
|
+
return n.name = this.flowParseRestrictedIdentifierName(), n.variance = r, n.bound = this.flowParseTypeParameterBound(), this.match(25) ? (this.eat(25), n.default = this.flowParseType()) : e && this.raise(N.MissingTypeParamDefault, t), this.finishNode(n, "TypeParameter");
|
|
1331
1331
|
}
|
|
1332
1332
|
flowParseTypeParameterDeclaration() {
|
|
1333
1333
|
let e = this.state.inType, t = this.startNode();
|
|
@@ -1340,7 +1340,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1340
1340
|
return this.expect(44), this.state.inType = e, this.finishNode(t, "TypeParameterDeclaration");
|
|
1341
1341
|
}
|
|
1342
1342
|
flowInTopLevelContext(e) {
|
|
1343
|
-
if (this.curContext() !==
|
|
1343
|
+
if (this.curContext() !== A.brace) {
|
|
1344
1344
|
let t = this.state.context;
|
|
1345
1345
|
this.state.context = [t[0]];
|
|
1346
1346
|
try {
|
|
@@ -1360,7 +1360,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1360
1360
|
let t = this.state.noAnonFunctionType;
|
|
1361
1361
|
for (this.state.noAnonFunctionType = !1; !this.match(44);) e.params.push(this.flowParseType()), this.match(44) || this.expect(8);
|
|
1362
1362
|
this.state.noAnonFunctionType = t;
|
|
1363
|
-
}), this.state.inType = t, !this.state.inType && this.curContext() ===
|
|
1363
|
+
}), this.state.inType = t, !this.state.inType && this.curContext() === A.brace && this.reScan_lt_gt(), this.expect(44), this.finishNode(e, "TypeParameterInstantiation");
|
|
1364
1364
|
}
|
|
1365
1365
|
flowParseTypeParameterInstantiationCallOrNew() {
|
|
1366
1366
|
if (this.reScan_lt() !== 43) return null;
|
|
@@ -1419,27 +1419,27 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1419
1419
|
else if (this.match(6) || this.match(43)) a != null && this.unexpected(a), d && this.unexpected(d.start), o.callProperties.push(this.flowParseObjectTypeCallProperty(u, t));
|
|
1420
1420
|
else {
|
|
1421
1421
|
let e = "init";
|
|
1422
|
-
(this.isContextual(95) || this.isContextual(100)) &&
|
|
1422
|
+
(this.isContextual(95) || this.isContextual(100)) && ge(this.lookahead().type) && (e = this.state.value, this.next());
|
|
1423
1423
|
let r = this.flowParseObjectTypeProperty(u, t, a, d, e, n, i ?? !c);
|
|
1424
1424
|
r === null ? (l = !0, s = this.state.lastTokStartLoc) : o.properties.push(r);
|
|
1425
1425
|
}
|
|
1426
|
-
this.flowObjectTypeSemicolon(), s && !this.match(4) && !this.match(5) && this.raise(
|
|
1426
|
+
this.flowObjectTypeSemicolon(), s && !this.match(4) && !this.match(5) && this.raise(N.UnexpectedExplicitInexactInObject, s);
|
|
1427
1427
|
}
|
|
1428
1428
|
this.expect(s), n && (o.inexact = l);
|
|
1429
1429
|
let u = this.finishNode(o, "ObjectTypeAnnotation");
|
|
1430
1430
|
return this.state.inType = a, u;
|
|
1431
1431
|
}
|
|
1432
1432
|
flowParseObjectTypeProperty(e, t, n, r, i, a, o) {
|
|
1433
|
-
if (this.eat(17)) return this.match(8) || this.match(9) || this.match(4) || this.match(5) ? (a ? o || this.raise(
|
|
1433
|
+
if (this.eat(17)) return this.match(8) || this.match(9) || this.match(4) || this.match(5) ? (a ? o || this.raise(N.InexactInsideExact, this.state.lastTokStartLoc) : this.raise(N.InexactInsideNonObject, this.state.lastTokStartLoc), r && this.raise(N.InexactVariance, r), null) : (a || this.raise(N.UnexpectedSpreadType, this.state.lastTokStartLoc), n != null && this.unexpected(n), r && this.raise(N.SpreadVariance, r), e.argument = this.flowParseType(), this.finishNode(e, "ObjectTypeSpreadProperty"));
|
|
1434
1434
|
{
|
|
1435
1435
|
e.key = this.flowParseObjectPropertyKey(), e.static = t, e.proto = n != null, e.kind = i;
|
|
1436
1436
|
let o = !1;
|
|
1437
|
-
return this.match(43) || this.match(6) ? (e.method = !0, n != null && this.unexpected(n), r && this.unexpected(r.start), e.value = this.flowParseObjectTypeMethodish(this.startNodeAtNode(e)), i === "get" || i === "set" ? this.flowCheckGetterSetterParams(e) : !t && !a && e.key.name === "constructor" && e.value.this && this.raise(
|
|
1437
|
+
return this.match(43) || this.match(6) ? (e.method = !0, n != null && this.unexpected(n), r && this.unexpected(r.start), e.value = this.flowParseObjectTypeMethodish(this.startNodeAtNode(e)), i === "get" || i === "set" ? this.flowCheckGetterSetterParams(e) : !t && !a && e.key.name === "constructor" && e.value.this && this.raise(N.ThisParamBannedInConstructor, e.value.this)) : (i !== "init" && this.unexpected(), e.method = !1, this.eat(13) && (o = !0), e.value = this.flowParseTypeInitialiser(), e.variance = r), e.optional = o, this.finishNode(e, "ObjectTypeProperty");
|
|
1438
1438
|
}
|
|
1439
1439
|
}
|
|
1440
1440
|
flowCheckGetterSetterParams(e) {
|
|
1441
1441
|
let t = e.kind === "get" ? 0 : 1, n = e.value, r = n.params.length + +!!n.rest;
|
|
1442
|
-
n.this && this.raise(e.kind === "get" ?
|
|
1442
|
+
n.this && this.raise(e.kind === "get" ? N.GetterMayNotHaveThisParam : N.SetterMayNotHaveThisParam, n.this), r !== t && this.raise(e.kind === "get" ? g.BadGetterArity : g.BadSetterArity, e), e.kind === "set" && n.rest && this.raise(g.BadSetterRestParameter, e);
|
|
1443
1443
|
}
|
|
1444
1444
|
flowObjectTypeSemicolon() {
|
|
1445
1445
|
!this.eat(9) && !this.eat(8) && !this.match(4) && !this.match(5) && this.unexpected();
|
|
@@ -1468,7 +1468,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1468
1468
|
}
|
|
1469
1469
|
flowParseFunctionTypeParam(e) {
|
|
1470
1470
|
let t = null, n = !1, r, i = this.startNode(), a = this.lookahead(), o = this.state.type === 74;
|
|
1471
|
-
return a.type === 10 || a.type === 13 ? (o && !e && this.raise(
|
|
1471
|
+
return a.type === 10 || a.type === 13 ? (o && !e && this.raise(N.ThisParamMustBeFirst, i), t = this.parseIdentifier(o), this.eat(13) && (n = !0, o && this.raise(N.ThisParamMayNotBeOptional, i)), r = this.flowParseTypeInitialiser()) : r = this.flowParseType(), i.name = t, i.optional = n, i.typeAnnotation = r, this.finishNode(i, "FunctionTypeParam");
|
|
1472
1472
|
}
|
|
1473
1473
|
reinterpretTypeAsFunctionTypeParam(e) {
|
|
1474
1474
|
let t = this.startNodeAtNode(e);
|
|
@@ -1521,7 +1521,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1521
1521
|
case 6: {
|
|
1522
1522
|
let e = this.startNode();
|
|
1523
1523
|
if (this.next(), !this.match(7) && !this.match(17)) {
|
|
1524
|
-
if (
|
|
1524
|
+
if (E(this.state.type) || this.match(74)) {
|
|
1525
1525
|
let e = this.lookahead().type;
|
|
1526
1526
|
i = e !== 13 && e !== 10;
|
|
1527
1527
|
} else i = !0;
|
|
@@ -1539,7 +1539,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1539
1539
|
if (this.state.value === "-") {
|
|
1540
1540
|
if (this.next(), this.match(131)) return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", t);
|
|
1541
1541
|
if (this.match(132)) return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", t);
|
|
1542
|
-
throw this.raise(
|
|
1542
|
+
throw this.raise(N.UnexpectedSubtractionOperand, this.state.startLoc);
|
|
1543
1543
|
}
|
|
1544
1544
|
throw this.unexpected();
|
|
1545
1545
|
case 131: return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
|
|
@@ -1550,11 +1550,11 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1550
1550
|
case 51: return this.next(), this.finishNode(t, "ExistsTypeAnnotation");
|
|
1551
1551
|
case 83: return this.flowParseTypeofType();
|
|
1552
1552
|
default:
|
|
1553
|
-
if (
|
|
1554
|
-
let e =
|
|
1553
|
+
if (xe(this.state.type)) {
|
|
1554
|
+
let e = k(this.state.type);
|
|
1555
1555
|
return this.next(), super.createIdentifier(t, e);
|
|
1556
1556
|
}
|
|
1557
|
-
if (
|
|
1557
|
+
if (E(this.state.type)) return this.isContextual(125) ? this.flowParseInterfaceType() : this.flowIdentToTypeAnnotation(e, t, this.parseIdentifier());
|
|
1558
1558
|
}
|
|
1559
1559
|
throw this.unexpected();
|
|
1560
1560
|
}
|
|
@@ -1636,7 +1636,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1636
1636
|
}
|
|
1637
1637
|
parseStatementLike(e) {
|
|
1638
1638
|
if (this.state.strict && this.isContextual(125)) {
|
|
1639
|
-
if (
|
|
1639
|
+
if (D(this.lookahead().type)) {
|
|
1640
1640
|
let e = this.startNode();
|
|
1641
1641
|
return this.next(), this.flowParseInterface(e);
|
|
1642
1642
|
}
|
|
@@ -1650,8 +1650,8 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1650
1650
|
parseExpressionStatement(e, t, n) {
|
|
1651
1651
|
if (t.type === "Identifier") {
|
|
1652
1652
|
if (t.name === "declare") {
|
|
1653
|
-
if (this.match(76) ||
|
|
1654
|
-
} else if (
|
|
1653
|
+
if (this.match(76) || E(this.state.type) || this.match(64) || this.match(70) || this.match(78)) return this.flowParseDeclare(e);
|
|
1654
|
+
} else if (E(this.state.type)) {
|
|
1655
1655
|
if (t.name === "interface") return this.flowParseInterface(e);
|
|
1656
1656
|
if (t.name === "type") return this.flowParseTypeAlias(e);
|
|
1657
1657
|
if (t.name === "opaque") return this.flowParseOpaqueType(e, !1);
|
|
@@ -1661,11 +1661,11 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1661
1661
|
}
|
|
1662
1662
|
shouldParseExportDeclaration() {
|
|
1663
1663
|
let { type: e } = this.state;
|
|
1664
|
-
return e === 122 ||
|
|
1664
|
+
return e === 122 || ye(e) ? !this.state.containsEsc : super.shouldParseExportDeclaration();
|
|
1665
1665
|
}
|
|
1666
1666
|
isExportDefaultSpecifier() {
|
|
1667
1667
|
let { type: e } = this.state;
|
|
1668
|
-
return e === 122 ||
|
|
1668
|
+
return e === 122 || ye(e) ? this.state.containsEsc : super.isExportDefaultSpecifier();
|
|
1669
1669
|
}
|
|
1670
1670
|
parseExportDefaultExpression() {
|
|
1671
1671
|
if (this.isContextual(122)) {
|
|
@@ -1689,7 +1689,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1689
1689
|
for (let t = 0; t < u.length; t++) e.push(u[t].start);
|
|
1690
1690
|
({consequent: o, failed: s} = this.tryParseConditionalConsequent()), [l] = this.getArrowLikeExpressions(o);
|
|
1691
1691
|
}
|
|
1692
|
-
s && l.length > 1 && this.raise(
|
|
1692
|
+
s && l.length > 1 && this.raise(N.AmbiguousConditionalArrow, r.startLoc), s && l.length === 1 && (this.state = r, e.push(l[0].start), this.state.noArrowAt = e, {consequent: o} = this.tryParseConditionalConsequent());
|
|
1693
1693
|
}
|
|
1694
1694
|
return this.getArrowLikeExpressions(o, !0), this.state.noArrowAt = i, this.expect(10), a.test = e, a.consequent = o, a.alternate = this.forwardNoArrowParamsConversionAt(a, () => this.parseMaybeAssign(void 0, void 0)), this.finishNode(a, "ConditionalExpression");
|
|
1695
1695
|
}
|
|
@@ -1707,7 +1707,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1707
1707
|
let e = n.pop();
|
|
1708
1708
|
e.type === "ArrowFunctionExpression" && e.body.type !== "BlockStatement" ? (e.typeParameters || !e.returnType ? this.finishArrowValidation(e) : r.push(e), n.push(e.body)) : e.type === "ConditionalExpression" && (n.push(e.consequent), n.push(e.alternate));
|
|
1709
1709
|
}
|
|
1710
|
-
return t ? (r.forEach((e) => this.finishArrowValidation(e)), [r, []]) :
|
|
1710
|
+
return t ? (r.forEach((e) => this.finishArrowValidation(e)), [r, []]) : rt(r, (e) => e.params.every((e) => this.isAssignable(e, !0)));
|
|
1711
1711
|
}
|
|
1712
1712
|
finishArrowValidation(e) {
|
|
1713
1713
|
this.toAssignableList(e.params, e.extra?.trailingCommaLoc, !1), this.scope.enter(518), super.checkParams(e, !1, !0), this.scope.exit();
|
|
@@ -1770,7 +1770,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1770
1770
|
if (super.parseClassMemberFromModifier(e, t)) return;
|
|
1771
1771
|
t.declare = !0;
|
|
1772
1772
|
}
|
|
1773
|
-
super.parseClassMember(e, t, n), t.declare && (t.type !== "ClassProperty" && t.type !== "ClassPrivateProperty" && t.type !== "PropertyDefinition" ? this.raise(
|
|
1773
|
+
super.parseClassMember(e, t, n), t.declare && (t.type !== "ClassProperty" && t.type !== "ClassPrivateProperty" && t.type !== "PropertyDefinition" ? this.raise(N.DeclareClassElement, r) : t.value && this.raise(N.DeclareClassFieldInitializer, t.value));
|
|
1774
1774
|
}
|
|
1775
1775
|
isIterator(e) {
|
|
1776
1776
|
return e === "iterator" || e === "asyncIterator";
|
|
@@ -1781,7 +1781,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1781
1781
|
}
|
|
1782
1782
|
getTokenFromCode(e) {
|
|
1783
1783
|
let t = this.input.charCodeAt(this.state.pos + 1);
|
|
1784
|
-
e === 123 && t === 124 ? this.finishOp(3, 2) : this.state.inType && (e === 62 || e === 60) ? this.finishOp(e === 62 ? 44 : 43, 1) : this.state.inType && e === 63 ? t === 46 ? this.finishOp(14, 2) : this.finishOp(13, 1) :
|
|
1784
|
+
e === 123 && t === 124 ? this.finishOp(3, 2) : this.state.inType && (e === 62 || e === 60) ? this.finishOp(e === 62 ? 44 : 43, 1) : this.state.inType && e === 63 ? t === 46 ? this.finishOp(14, 2) : this.finishOp(13, 1) : Ke(e, t, this.input.charCodeAt(this.state.pos + 2)) ? (this.state.pos += 2, this.readIterator()) : super.getTokenFromCode(e);
|
|
1785
1785
|
}
|
|
1786
1786
|
isAssignable(e, t) {
|
|
1787
1787
|
return e.type === "TypeCastExpression" ? this.isAssignable(e.expression, t) : super.isAssignable(e, t);
|
|
@@ -1796,7 +1796,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1796
1796
|
toReferencedList(e, t) {
|
|
1797
1797
|
for (let n = 0; n < e.length; n++) {
|
|
1798
1798
|
let r = e[n];
|
|
1799
|
-
r?.type === "TypeCastExpression" && !r.extra?.parenthesized && (e.length > 1 || !t) && this.raise(
|
|
1799
|
+
r?.type === "TypeCastExpression" && !r.extra?.parenthesized && (e.length > 1 || !t) && this.raise(N.TypeCastInPattern, r.typeAnnotation);
|
|
1800
1800
|
}
|
|
1801
1801
|
return e;
|
|
1802
1802
|
}
|
|
@@ -1825,10 +1825,10 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1825
1825
|
pushClassMethod(e, t, n, r, i, a) {
|
|
1826
1826
|
if (t.variance && this.unexpected(t.variance.start), delete t.variance, this.match(43) && (t.typeParameters = this.flowParseTypeParameterDeclaration()), super.pushClassMethod(e, t, n, r, i, a), t.params && i) {
|
|
1827
1827
|
let e = t.params;
|
|
1828
|
-
e.length > 0 && this.isThisParam(e[0]) && this.raise(
|
|
1828
|
+
e.length > 0 && this.isThisParam(e[0]) && this.raise(N.ThisParamBannedInConstructor, t);
|
|
1829
1829
|
} else if (t.type === "MethodDefinition" && i && t.value.params) {
|
|
1830
1830
|
let e = t.value.params;
|
|
1831
|
-
e.length > 0 && this.isThisParam(e[0]) && this.raise(
|
|
1831
|
+
e.length > 0 && this.isThisParam(e[0]) && this.raise(N.ThisParamBannedInConstructor, t);
|
|
1832
1832
|
}
|
|
1833
1833
|
}
|
|
1834
1834
|
pushClassPrivateMethod(e, t, n, r) {
|
|
@@ -1851,7 +1851,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1851
1851
|
let t = this.getObjectOrClassMethodParams(e);
|
|
1852
1852
|
if (t.length > 0) {
|
|
1853
1853
|
let n = t[0];
|
|
1854
|
-
this.isThisParam(n) && e.kind === "get" ? this.raise(
|
|
1854
|
+
this.isThisParam(n) && e.kind === "get" ? this.raise(N.GetterMayNotHaveThisParam, n) : this.isThisParam(n) && this.raise(N.SetterMayNotHaveThisParam, n);
|
|
1855
1855
|
}
|
|
1856
1856
|
}
|
|
1857
1857
|
parsePropertyNamePrefixOperator(e) {
|
|
@@ -1865,14 +1865,14 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1865
1865
|
return s && ((c.value || c).typeParameters = s), c;
|
|
1866
1866
|
}
|
|
1867
1867
|
parseFunctionParamType(e) {
|
|
1868
|
-
return this.eat(13) && (e.type !== "Identifier" && this.raise(
|
|
1868
|
+
return this.eat(13) && (e.type !== "Identifier" && this.raise(N.PatternIsOptional, e), this.isThisParam(e) && this.raise(N.ThisParamMayNotBeOptional, e), e.optional = !0), this.match(10) ? e.typeAnnotation = this.flowParseTypeAnnotation() : this.isThisParam(e) && this.raise(N.ThisParamAnnotationRequired, e), this.match(25) && this.isThisParam(e) && this.raise(N.ThisParamNoDefault, e), this.resetEndLocation(e), e;
|
|
1869
1869
|
}
|
|
1870
1870
|
parseMaybeDefault(e, t) {
|
|
1871
1871
|
let n = super.parseMaybeDefault(e, t);
|
|
1872
|
-
return n.type === "AssignmentPattern" && n.typeAnnotation && n.right.start < n.typeAnnotation.start && this.raise(
|
|
1872
|
+
return n.type === "AssignmentPattern" && n.typeAnnotation && n.right.start < n.typeAnnotation.start && this.raise(N.TypeBeforeInitializer, n.typeAnnotation), n;
|
|
1873
1873
|
}
|
|
1874
1874
|
parseImportSpecifierLocal(e, t, n) {
|
|
1875
|
-
t.local =
|
|
1875
|
+
t.local = tt(e) ? this.flowParseRestrictedIdentifier(!0, !0) : this.parseIdentifier(), e.specifiers.push(this.finishImportSpecifier(t, n));
|
|
1876
1876
|
}
|
|
1877
1877
|
isPotentialImportPhase(e) {
|
|
1878
1878
|
if (super.isPotentialImportPhase(e)) return !0;
|
|
@@ -1895,17 +1895,17 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1895
1895
|
let s = !1;
|
|
1896
1896
|
if (this.isContextual(89) && !this.isLookaheadContextual("as")) {
|
|
1897
1897
|
let t = this.parseIdentifier(!0);
|
|
1898
|
-
o !== null && !
|
|
1898
|
+
o !== null && !D(this.state.type) ? (e.imported = t, e.importKind = o, e.local = this.cloneIdentifier(t)) : (e.imported = a, e.importKind = null, e.local = this.parseIdentifier());
|
|
1899
1899
|
} else {
|
|
1900
|
-
if (o !== null &&
|
|
1900
|
+
if (o !== null && D(this.state.type)) e.imported = this.parseIdentifier(!0), e.importKind = o;
|
|
1901
1901
|
else {
|
|
1902
1902
|
if (t) throw this.raise(g.ImportBindingIsString, e, { importName: a.value });
|
|
1903
1903
|
e.imported = a, e.importKind = null;
|
|
1904
1904
|
}
|
|
1905
1905
|
this.eatContextual(89) ? e.local = this.parseIdentifier() : (s = !0, e.local = this.cloneIdentifier(e.imported));
|
|
1906
1906
|
}
|
|
1907
|
-
let c =
|
|
1908
|
-
return n && c && this.raise(
|
|
1907
|
+
let c = tt(e);
|
|
1908
|
+
return n && c && this.raise(N.ImportTypeShorthandOnlyInPureImport, e), (n || c) && this.checkReservedType(e.local.name, e.local.start, !0), s && !n && !c && this.checkReservedWord(e.local.name, e.start, !0, !0), this.finishImportSpecifier(e, "ImportSpecifier");
|
|
1909
1909
|
}
|
|
1910
1910
|
parseBindingAtom() {
|
|
1911
1911
|
switch (this.state.type) {
|
|
@@ -1935,7 +1935,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1935
1935
|
if (this.hasPlugin("jsx") && (this.match(138) || this.match(43))) {
|
|
1936
1936
|
if (n = this.state.clone(), r = this.tryParse(() => super.parseMaybeAssign(e, t), n), !r.error) return r.node;
|
|
1937
1937
|
let { context: i } = this.state, a = i[i.length - 1];
|
|
1938
|
-
(a ===
|
|
1938
|
+
(a === A.j_oTag || a === A.j_expr) && i.pop();
|
|
1939
1939
|
}
|
|
1940
1940
|
if (r?.error || this.match(43)) {
|
|
1941
1941
|
n ||= this.state.clone();
|
|
@@ -1950,12 +1950,12 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1950
1950
|
return a.type !== "ArrowFunctionExpression" && n(), a.typeParameters = i, this.resetStartLocationFromNode(a, i), r;
|
|
1951
1951
|
}, n), o = null;
|
|
1952
1952
|
if (a.node && this.maybeUnwrapTypeCastExpression(a.node).type === "ArrowFunctionExpression") {
|
|
1953
|
-
if (!a.error && !a.aborted) return a.node.async && this.raise(
|
|
1953
|
+
if (!a.error && !a.aborted) return a.node.async && this.raise(N.UnexpectedTypeParameterBeforeAsyncArrowFunction, i), a.node;
|
|
1954
1954
|
o = a.node;
|
|
1955
1955
|
}
|
|
1956
1956
|
if (r?.node) return this.state = r.failState, r.node;
|
|
1957
1957
|
if (o) return this.state = a.failState, o;
|
|
1958
|
-
throw r?.thrown ? r.error : a.thrown ? a.error : this.raise(
|
|
1958
|
+
throw r?.thrown ? r.error : a.thrown ? a.error : this.raise(N.UnexpectedTokenAfterTypeParameter, i);
|
|
1959
1959
|
}
|
|
1960
1960
|
return super.parseMaybeAssign(e, t);
|
|
1961
1961
|
}
|
|
@@ -1980,7 +1980,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
1980
1980
|
}
|
|
1981
1981
|
checkParams(e, t, n, r = !0) {
|
|
1982
1982
|
if (!(n && this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))) {
|
|
1983
|
-
for (let t = 0; t < e.params.length; t++) this.isThisParam(e.params[t]) && t > 0 && this.raise(
|
|
1983
|
+
for (let t = 0; t < e.params.length; t++) this.isThisParam(e.params[t]) && t > 0 && this.raise(N.ThisParamMustBeFirst, e.params[t]);
|
|
1984
1984
|
super.checkParams(e, t, n, r);
|
|
1985
1985
|
}
|
|
1986
1986
|
}
|
|
@@ -2045,11 +2045,11 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
2045
2045
|
}
|
|
2046
2046
|
parseTopLevel(e, t) {
|
|
2047
2047
|
let n = super.parseTopLevel(e, t);
|
|
2048
|
-
return this.state.hasFlowComment && this.raise(
|
|
2048
|
+
return this.state.hasFlowComment && this.raise(N.UnterminatedFlowComment, this.state.curPosition()), n;
|
|
2049
2049
|
}
|
|
2050
2050
|
skipBlockComment() {
|
|
2051
2051
|
if (this.hasPlugin("flowComments") && this.skipFlowComment()) {
|
|
2052
|
-
if (this.state.hasFlowComment) throw this.raise(
|
|
2052
|
+
if (this.state.hasFlowComment) throw this.raise(N.NestedFlowComment, this.state.startLoc);
|
|
2053
2053
|
this.hasFlowCommentCompletion();
|
|
2054
2054
|
let e = this.skipFlowComment();
|
|
2055
2055
|
e && (this.state.pos += e, this.state.hasFlowComment = !0);
|
|
@@ -2067,16 +2067,16 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
2067
2067
|
if (this.input.indexOf("*/", this.state.pos) === -1) throw this.raise(g.UnterminatedComment, this.state.curPosition());
|
|
2068
2068
|
}
|
|
2069
2069
|
flowEnumErrorBooleanMemberNotInitialized(e, t) {
|
|
2070
|
-
this.raise(
|
|
2070
|
+
this.raise(N.EnumBooleanMemberNotInitialized, e, t);
|
|
2071
2071
|
}
|
|
2072
2072
|
flowEnumErrorInvalidMemberInitializer(e, t) {
|
|
2073
|
-
return this.raise(t.explicitType ? t.explicitType === "symbol" ?
|
|
2073
|
+
return this.raise(t.explicitType ? t.explicitType === "symbol" ? N.EnumInvalidMemberInitializerSymbolType : N.EnumInvalidMemberInitializerPrimaryType : N.EnumInvalidMemberInitializerUnknownType, e, t);
|
|
2074
2074
|
}
|
|
2075
2075
|
flowEnumErrorNumberMemberNotInitialized(e, t) {
|
|
2076
|
-
this.raise(
|
|
2076
|
+
this.raise(N.EnumNumberMemberNotInitialized, e, t);
|
|
2077
2077
|
}
|
|
2078
2078
|
flowEnumErrorStringMemberInconsistentlyInitialized(e, t) {
|
|
2079
|
-
this.raise(
|
|
2079
|
+
this.raise(N.EnumStringMemberInconsistentlyInitialized, e, t);
|
|
2080
2080
|
}
|
|
2081
2081
|
flowEnumMemberInit() {
|
|
2082
2082
|
let e = this.state.startLoc, t = () => this.match(8) || this.match(4);
|
|
@@ -2142,11 +2142,11 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
2142
2142
|
}
|
|
2143
2143
|
let a = this.startNode(), { id: o, init: s } = this.flowEnumMemberRaw(), c = o.name;
|
|
2144
2144
|
if (c === "") continue;
|
|
2145
|
-
/^[a-z]/.test(c) && this.raise(
|
|
2145
|
+
/^[a-z]/.test(c) && this.raise(N.EnumInvalidMemberName, o, {
|
|
2146
2146
|
memberName: c,
|
|
2147
2147
|
suggestion: c[0].toUpperCase() + c.slice(1),
|
|
2148
2148
|
enumName: e
|
|
2149
|
-
}), n.has(c) && this.raise(
|
|
2149
|
+
}), n.has(c) && this.raise(N.EnumDuplicateMemberName, o, {
|
|
2150
2150
|
memberName: c,
|
|
2151
2151
|
enumName: e
|
|
2152
2152
|
}), n.add(c);
|
|
@@ -2195,9 +2195,9 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
2195
2195
|
}
|
|
2196
2196
|
flowEnumParseExplicitType({ enumName: e }) {
|
|
2197
2197
|
if (!this.eatContextual(98)) return null;
|
|
2198
|
-
if (!
|
|
2198
|
+
if (!E(this.state.type)) throw this.raise(N.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, { enumName: e });
|
|
2199
2199
|
let { value: t } = this.state;
|
|
2200
|
-
return this.next(), t !== "boolean" && t !== "number" && t !== "string" && t !== "symbol" && this.raise(
|
|
2200
|
+
return this.next(), t !== "boolean" && t !== "number" && t !== "string" && t !== "symbol" && this.raise(N.EnumInvalidExplicitType, this.state.startLoc, {
|
|
2201
2201
|
enumName: e,
|
|
2202
2202
|
invalidEnumType: t
|
|
2203
2203
|
}), t;
|
|
@@ -2234,7 +2234,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
2234
2234
|
});
|
|
2235
2235
|
return e.members = a.numberMembers, this.expect(4), this.finishNode(e, "EnumNumberBody");
|
|
2236
2236
|
}
|
|
2237
|
-
return this.raise(
|
|
2237
|
+
return this.raise(N.EnumInconsistentMemberValues, r, { enumName: n }), t();
|
|
2238
2238
|
}
|
|
2239
2239
|
}
|
|
2240
2240
|
}
|
|
@@ -2264,7 +2264,7 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
2264
2264
|
maybeUnwrapTypeCastExpression(e) {
|
|
2265
2265
|
return e.type === "TypeCastExpression" ? e.expression : e;
|
|
2266
2266
|
}
|
|
2267
|
-
},
|
|
2267
|
+
}, ot = {
|
|
2268
2268
|
__proto__: null,
|
|
2269
2269
|
quot: "\"",
|
|
2270
2270
|
amp: "&",
|
|
@@ -2519,8 +2519,8 @@ var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
|
2519
2519
|
clubs: "♣",
|
|
2520
2520
|
hearts: "♥",
|
|
2521
2521
|
diams: "♦"
|
|
2522
|
-
},
|
|
2523
|
-
function
|
|
2522
|
+
}, st = /* @__PURE__ */ RegExp("\\r\\n|[\\r\\n\\u2028\\u2029]", "g");
|
|
2523
|
+
function P(e) {
|
|
2524
2524
|
switch (e) {
|
|
2525
2525
|
case 10:
|
|
2526
2526
|
case 13:
|
|
@@ -2529,12 +2529,12 @@ function F(e) {
|
|
|
2529
2529
|
default: return !1;
|
|
2530
2530
|
}
|
|
2531
2531
|
}
|
|
2532
|
-
function
|
|
2533
|
-
for (let r = t; r < n; r++) if (
|
|
2532
|
+
function ct(e, t, n) {
|
|
2533
|
+
for (let r = t; r < n; r++) if (P(e.charCodeAt(r))) return !0;
|
|
2534
2534
|
return !1;
|
|
2535
2535
|
}
|
|
2536
|
-
var
|
|
2537
|
-
function
|
|
2536
|
+
var lt = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, ut = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;
|
|
2537
|
+
function dt(e) {
|
|
2538
2538
|
switch (e) {
|
|
2539
2539
|
case 9:
|
|
2540
2540
|
case 11:
|
|
@@ -2560,7 +2560,7 @@ function ut(e) {
|
|
|
2560
2560
|
default: return !1;
|
|
2561
2561
|
}
|
|
2562
2562
|
}
|
|
2563
|
-
var
|
|
2563
|
+
var F = h`jsx`({
|
|
2564
2564
|
AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.",
|
|
2565
2565
|
MissingClosingTagElement: ({ openingTagName: e }) => `Expected corresponding JSX closing tag for <${e}>.`,
|
|
2566
2566
|
MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.",
|
|
@@ -2570,20 +2570,20 @@ var I = h`jsx`({
|
|
|
2570
2570
|
UnterminatedJsxContent: "Unterminated JSX contents.",
|
|
2571
2571
|
UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"
|
|
2572
2572
|
});
|
|
2573
|
-
function
|
|
2573
|
+
function I(e) {
|
|
2574
2574
|
return e ? e.type === "JSXOpeningFragment" || e.type === "JSXClosingFragment" : !1;
|
|
2575
2575
|
}
|
|
2576
|
-
function
|
|
2576
|
+
function L(e) {
|
|
2577
2577
|
if (e.type === "JSXIdentifier") return e.name;
|
|
2578
2578
|
if (e.type === "JSXNamespacedName") return e.namespace.name + ":" + e.name.name;
|
|
2579
|
-
if (e.type === "JSXMemberExpression") return
|
|
2579
|
+
if (e.type === "JSXMemberExpression") return L(e.object) + "." + L(e.property);
|
|
2580
2580
|
throw Error("Node had unexpected type: " + e.type);
|
|
2581
2581
|
}
|
|
2582
|
-
var
|
|
2582
|
+
var ft = (e) => class extends e {
|
|
2583
2583
|
jsxReadToken() {
|
|
2584
2584
|
let e = "", t = this.state.pos;
|
|
2585
2585
|
for (;;) {
|
|
2586
|
-
if (this.state.pos >= this.length) throw this.raise(
|
|
2586
|
+
if (this.state.pos >= this.length) throw this.raise(F.UnterminatedJsxContent, this.state.startLoc);
|
|
2587
2587
|
let n = this.input.charCodeAt(this.state.pos);
|
|
2588
2588
|
switch (n) {
|
|
2589
2589
|
case 60:
|
|
@@ -2598,11 +2598,11 @@ var dt = (e) => class extends e {
|
|
|
2598
2598
|
e += this.input.slice(t, this.state.pos), e += this.jsxReadEntity(), t = this.state.pos;
|
|
2599
2599
|
break;
|
|
2600
2600
|
case 62:
|
|
2601
|
-
case 125: this.raise(
|
|
2601
|
+
case 125: this.raise(F.UnexpectedToken, this.state.curPosition(), {
|
|
2602
2602
|
unexpected: this.input[this.state.pos],
|
|
2603
2603
|
HTMLEntity: n === 125 ? "}" : ">"
|
|
2604
2604
|
});
|
|
2605
|
-
default:
|
|
2605
|
+
default: P(n) ? (e += this.input.slice(t, this.state.pos), e += this.jsxReadNewLine(!0), t = this.state.pos) : ++this.state.pos;
|
|
2606
2606
|
}
|
|
2607
2607
|
}
|
|
2608
2608
|
}
|
|
@@ -2616,7 +2616,7 @@ var dt = (e) => class extends e {
|
|
|
2616
2616
|
if (this.state.pos >= this.length) throw this.raise(g.UnterminatedString, this.state.startLoc);
|
|
2617
2617
|
let r = this.input.charCodeAt(this.state.pos);
|
|
2618
2618
|
if (r === e) break;
|
|
2619
|
-
r === 38 ? (t += this.input.slice(n, this.state.pos), t += this.jsxReadEntity(), n = this.state.pos) :
|
|
2619
|
+
r === 38 ? (t += this.input.slice(n, this.state.pos), t += this.jsxReadEntity(), n = this.state.pos) : P(r) ? (t += this.input.slice(n, this.state.pos), t += this.jsxReadNewLine(!1), n = this.state.pos) : ++this.state.pos;
|
|
2620
2620
|
}
|
|
2621
2621
|
t += this.input.slice(n, this.state.pos++), this.finishToken(130, t);
|
|
2622
2622
|
}
|
|
@@ -2632,7 +2632,7 @@ var dt = (e) => class extends e {
|
|
|
2632
2632
|
let t = 0, n = !1;
|
|
2633
2633
|
for (; t++ < 10 && this.state.pos < this.length && !(n = this.codePointAtPos(this.state.pos) === 59);) ++this.state.pos;
|
|
2634
2634
|
if (n) {
|
|
2635
|
-
let t =
|
|
2635
|
+
let t = ot[this.input.slice(e, this.state.pos)];
|
|
2636
2636
|
if (++this.state.pos, t) return t;
|
|
2637
2637
|
}
|
|
2638
2638
|
}
|
|
@@ -2642,12 +2642,12 @@ var dt = (e) => class extends e {
|
|
|
2642
2642
|
let e, t = this.state.pos;
|
|
2643
2643
|
do
|
|
2644
2644
|
e = this.input.charCodeAt(++this.state.pos);
|
|
2645
|
-
while (
|
|
2645
|
+
while (M(e) || e === 45);
|
|
2646
2646
|
this.finishToken(136, this.input.slice(t, this.state.pos));
|
|
2647
2647
|
}
|
|
2648
2648
|
jsxParseIdentifier() {
|
|
2649
2649
|
let e = this.startNode();
|
|
2650
|
-
return this.match(136) ? e.name = this.state.value :
|
|
2650
|
+
return this.match(136) ? e.name = this.state.value : xe(this.state.type) ? e.name = k(this.state.type) : this.unexpected(), this.next(), this.finishNode(e, "JSXIdentifier");
|
|
2651
2651
|
}
|
|
2652
2652
|
jsxParseNamespacedName() {
|
|
2653
2653
|
let e = this.state.startLoc, t = this.jsxParseIdentifier();
|
|
@@ -2667,10 +2667,10 @@ var dt = (e) => class extends e {
|
|
|
2667
2667
|
jsxParseAttributeValue() {
|
|
2668
2668
|
let e;
|
|
2669
2669
|
switch (this.state.type) {
|
|
2670
|
-
case 2: return e = this.startNode(), this.setContext(
|
|
2670
|
+
case 2: return e = this.startNode(), this.setContext(A.brace), this.next(), e = this.jsxParseExpressionContainer(e, A.j_oTag), e.expression.type === "JSXEmptyExpression" && this.raise(F.AttributeIsEmpty, e), e;
|
|
2671
2671
|
case 138:
|
|
2672
2672
|
case 130: return this.parseExprAtom();
|
|
2673
|
-
default: throw this.raise(
|
|
2673
|
+
default: throw this.raise(F.UnsupportedJsxValue, this.state.startLoc);
|
|
2674
2674
|
}
|
|
2675
2675
|
}
|
|
2676
2676
|
jsxParseEmptyExpression() {
|
|
@@ -2678,20 +2678,20 @@ var dt = (e) => class extends e {
|
|
|
2678
2678
|
return this.finishNodeAt(e, "JSXEmptyExpression", this.state.startLoc);
|
|
2679
2679
|
}
|
|
2680
2680
|
jsxParseSpreadChild(e) {
|
|
2681
|
-
return this.next(), e.expression = this.parseExpression(), this.setContext(
|
|
2681
|
+
return this.next(), e.expression = this.parseExpression(), this.setContext(A.j_expr), this.state.canStartJSXElement = !0, this.expect(4), this.finishNode(e, "JSXSpreadChild");
|
|
2682
2682
|
}
|
|
2683
2683
|
jsxParseExpressionContainer(e, t) {
|
|
2684
2684
|
if (this.match(4)) e.expression = this.jsxParseEmptyExpression();
|
|
2685
2685
|
else {
|
|
2686
2686
|
let t = this.parseExpression();
|
|
2687
|
-
t.type === "SequenceExpression" && !t.extra?.parenthesized && this.raise(
|
|
2687
|
+
t.type === "SequenceExpression" && !t.extra?.parenthesized && this.raise(F.UnexpectedSequenceExpression, t.expressions[1]), e.expression = t;
|
|
2688
2688
|
}
|
|
2689
2689
|
return this.setContext(t), this.state.canStartJSXElement = !0, this.expect(4), this.finishNode(e, "JSXExpressionContainer");
|
|
2690
2690
|
}
|
|
2691
2691
|
jsxParseAttribute() {
|
|
2692
2692
|
if (this.match(2)) {
|
|
2693
2693
|
let e = this.startNode();
|
|
2694
|
-
return this.setContext(
|
|
2694
|
+
return this.setContext(A.brace), this.next(), this.expect(17), e.argument = this.parseMaybeAssignAllowIn(), this.setContext(A.j_oTag), this.state.canStartJSXElement = !0, this.expect(4), this.finishNode(e, "JSXSpreadAttribute");
|
|
2695
2695
|
}
|
|
2696
2696
|
let e = this.startNode();
|
|
2697
2697
|
return e.name = this.jsxParseNamespacedName(), e.value = this.eat(25) ? this.jsxParseAttributeValue() : null, this.finishNode(e, "JSXAttribute");
|
|
@@ -2733,15 +2733,15 @@ var dt = (e) => class extends e {
|
|
|
2733
2733
|
break;
|
|
2734
2734
|
case 2: {
|
|
2735
2735
|
let e = this.startNode();
|
|
2736
|
-
this.setContext(
|
|
2736
|
+
this.setContext(A.brace), this.next(), this.match(17) ? n.push(this.jsxParseSpreadChild(e)) : n.push(this.jsxParseExpressionContainer(e, A.j_expr));
|
|
2737
2737
|
break;
|
|
2738
2738
|
}
|
|
2739
2739
|
default: this.unexpected();
|
|
2740
2740
|
}
|
|
2741
|
-
|
|
2741
|
+
I(r) && !I(i) && i !== null ? this.raise(F.MissingClosingTagFragment, i) : (!I(r) && I(i) || !I(r) && !I(i) && L(i.name) !== L(r.name)) && this.raise(F.MissingClosingTagElement, i, { openingTagName: L(r.name) });
|
|
2742
2742
|
}
|
|
2743
|
-
if (
|
|
2744
|
-
return
|
|
2743
|
+
if (I(r) ? (t.openingFragment = r, t.closingFragment = i) : (t.openingElement = r, t.closingElement = i), t.children = n, this.match(43)) throw this.raise(F.UnwrappedAdjacentJSXElements, this.state.startLoc);
|
|
2744
|
+
return I(r) ? this.finishNode(t, "JSXFragment") : this.finishNode(t, "JSXElement");
|
|
2745
2745
|
}
|
|
2746
2746
|
jsxParseElement() {
|
|
2747
2747
|
let e = this.state.startLoc;
|
|
@@ -2759,12 +2759,12 @@ var dt = (e) => class extends e {
|
|
|
2759
2759
|
}
|
|
2760
2760
|
getTokenFromCode(e) {
|
|
2761
2761
|
let t = this.curContext();
|
|
2762
|
-
if (t ===
|
|
2762
|
+
if (t === A.j_expr) {
|
|
2763
2763
|
this.jsxReadToken();
|
|
2764
2764
|
return;
|
|
2765
2765
|
}
|
|
2766
|
-
if (t ===
|
|
2767
|
-
if (
|
|
2766
|
+
if (t === A.j_oTag || t === A.j_cTag) {
|
|
2767
|
+
if (j(e)) {
|
|
2768
2768
|
this.jsxReadWord();
|
|
2769
2769
|
return;
|
|
2770
2770
|
}
|
|
@@ -2772,7 +2772,7 @@ var dt = (e) => class extends e {
|
|
|
2772
2772
|
++this.state.pos, this.finishToken(139);
|
|
2773
2773
|
return;
|
|
2774
2774
|
}
|
|
2775
|
-
if ((e === 34 || e === 39) && t ===
|
|
2775
|
+
if ((e === 34 || e === 39) && t === A.j_oTag) {
|
|
2776
2776
|
this.jsxReadString(e);
|
|
2777
2777
|
return;
|
|
2778
2778
|
}
|
|
@@ -2785,23 +2785,23 @@ var dt = (e) => class extends e {
|
|
|
2785
2785
|
}
|
|
2786
2786
|
updateContext(e) {
|
|
2787
2787
|
let { context: t, type: n } = this.state;
|
|
2788
|
-
if (n === 52 && e === 138) t.splice(-2, 2,
|
|
2789
|
-
else if (n === 138) t.push(
|
|
2788
|
+
if (n === 52 && e === 138) t.splice(-2, 2, A.j_cTag), this.state.canStartJSXElement = !1;
|
|
2789
|
+
else if (n === 138) t.push(A.j_oTag);
|
|
2790
2790
|
else if (n === 139) {
|
|
2791
2791
|
let n = t[t.length - 1];
|
|
2792
|
-
n ===
|
|
2793
|
-
} else this.state.canStartJSXElement =
|
|
2792
|
+
n === A.j_oTag && e === 52 || n === A.j_cTag ? (t.pop(), this.state.canStartJSXElement = t[t.length - 1] === A.j_expr) : (this.setContext(A.j_expr), this.state.canStartJSXElement = !0);
|
|
2793
|
+
} else this.state.canStartJSXElement = _e(n);
|
|
2794
2794
|
}
|
|
2795
|
-
}, ft = class extends Je {
|
|
2796
|
-
tsNames = /* @__PURE__ */ new Map();
|
|
2797
2795
|
}, pt = class extends Ye {
|
|
2796
|
+
tsNames = /* @__PURE__ */ new Map();
|
|
2797
|
+
}, mt = class extends Xe {
|
|
2798
2798
|
get inTSNamespace() {
|
|
2799
2799
|
let e = this.scopeStack;
|
|
2800
2800
|
return e.length >= 2 && e[e.length - 1].flags === 0 && (e[e.length - 2].flags & 2048) > 0;
|
|
2801
2801
|
}
|
|
2802
2802
|
importsStack = [];
|
|
2803
2803
|
createScope(e) {
|
|
2804
|
-
return this.importsStack.push(/* @__PURE__ */ new Set()), new
|
|
2804
|
+
return this.importsStack.push(/* @__PURE__ */ new Set()), new pt(e);
|
|
2805
2805
|
}
|
|
2806
2806
|
enter(e) {
|
|
2807
2807
|
e & 3072 && this.importsStack.push(/* @__PURE__ */ new Set()), super.enter(e);
|
|
@@ -2844,7 +2844,7 @@ var dt = (e) => class extends e {
|
|
|
2844
2844
|
}
|
|
2845
2845
|
super.checkLocalExport(e);
|
|
2846
2846
|
}
|
|
2847
|
-
},
|
|
2847
|
+
}, ht = class {
|
|
2848
2848
|
sawUnambiguousESM = !1;
|
|
2849
2849
|
ambiguousScriptDifferentAst = !1;
|
|
2850
2850
|
sourceToOffsetPos(e) {
|
|
@@ -2867,21 +2867,21 @@ var dt = (e) => class extends e {
|
|
|
2867
2867
|
return this.plugins.get(e)?.[t];
|
|
2868
2868
|
}
|
|
2869
2869
|
};
|
|
2870
|
-
function
|
|
2870
|
+
function gt(e, t) {
|
|
2871
2871
|
e.trailingComments === void 0 ? e.trailingComments = t : e.trailingComments.unshift(...t);
|
|
2872
2872
|
}
|
|
2873
|
-
function
|
|
2873
|
+
function _t(e, t) {
|
|
2874
2874
|
e.leadingComments === void 0 ? e.leadingComments = t : e.leadingComments.unshift(...t);
|
|
2875
2875
|
}
|
|
2876
|
-
function
|
|
2876
|
+
function R(e, t) {
|
|
2877
2877
|
e.innerComments === void 0 ? e.innerComments = t : e.innerComments.unshift(...t);
|
|
2878
2878
|
}
|
|
2879
|
-
function
|
|
2879
|
+
function z(e, t, n) {
|
|
2880
2880
|
let r = null, i = t.length;
|
|
2881
2881
|
for (; r === null && i > 0;) r = t[--i];
|
|
2882
|
-
r === null || r.start > n.start ?
|
|
2882
|
+
r === null || r.start > n.start ? R(e, n.comments) : gt(r, n.comments);
|
|
2883
2883
|
}
|
|
2884
|
-
var
|
|
2884
|
+
var vt = class extends ht {
|
|
2885
2885
|
addComment(e) {
|
|
2886
2886
|
this.filename && (e.loc.filename = this.filename);
|
|
2887
2887
|
let { commentsLen: t } = this.state;
|
|
@@ -2904,21 +2904,21 @@ var _t = class extends mt {
|
|
|
2904
2904
|
}
|
|
2905
2905
|
finalizeComment(e) {
|
|
2906
2906
|
let { comments: t } = e;
|
|
2907
|
-
if (e.leadingNode !== null || e.trailingNode !== null) e.leadingNode !== null &&
|
|
2907
|
+
if (e.leadingNode !== null || e.trailingNode !== null) e.leadingNode !== null && gt(e.leadingNode, t), e.trailingNode !== null && _t(e.trailingNode, t);
|
|
2908
2908
|
else {
|
|
2909
2909
|
let n = e.containingNode, r = e.start;
|
|
2910
2910
|
if (this.input.charCodeAt(this.offsetToSourcePos(r) - 1) === 44) switch (n.type) {
|
|
2911
2911
|
case "ObjectExpression":
|
|
2912
2912
|
case "ObjectPattern":
|
|
2913
|
-
|
|
2913
|
+
z(n, n.properties, e);
|
|
2914
2914
|
break;
|
|
2915
2915
|
case "CallExpression":
|
|
2916
2916
|
case "NewExpression":
|
|
2917
2917
|
case "OptionalCallExpression":
|
|
2918
|
-
|
|
2918
|
+
z(n, n.arguments, e);
|
|
2919
2919
|
break;
|
|
2920
2920
|
case "ImportExpression":
|
|
2921
|
-
|
|
2921
|
+
z(n, [n.source, n.options ?? null], e);
|
|
2922
2922
|
break;
|
|
2923
2923
|
case "FunctionDeclaration":
|
|
2924
2924
|
case "FunctionExpression":
|
|
@@ -2927,25 +2927,25 @@ var _t = class extends mt {
|
|
|
2927
2927
|
case "ClassMethod":
|
|
2928
2928
|
case "ClassPrivateMethod":
|
|
2929
2929
|
case "TSTypeParameterDeclaration":
|
|
2930
|
-
|
|
2930
|
+
z(n, n.params, e);
|
|
2931
2931
|
break;
|
|
2932
2932
|
case "ArrayExpression":
|
|
2933
2933
|
case "ArrayPattern":
|
|
2934
|
-
|
|
2934
|
+
z(n, n.elements, e);
|
|
2935
2935
|
break;
|
|
2936
2936
|
case "ExportNamedDeclaration":
|
|
2937
2937
|
case "ImportDeclaration":
|
|
2938
|
-
|
|
2938
|
+
z(n, n.specifiers, e);
|
|
2939
2939
|
break;
|
|
2940
2940
|
case "TSEnumBody":
|
|
2941
|
-
|
|
2941
|
+
z(n, n.members, e);
|
|
2942
2942
|
break;
|
|
2943
2943
|
case "TSInterfaceBody":
|
|
2944
|
-
|
|
2944
|
+
z(n, n.body, e);
|
|
2945
2945
|
break;
|
|
2946
|
-
default:
|
|
2946
|
+
default: R(n, t);
|
|
2947
2947
|
}
|
|
2948
|
-
else
|
|
2948
|
+
else R(n, t);
|
|
2949
2949
|
}
|
|
2950
2950
|
}
|
|
2951
2951
|
finalizeRemainingComments() {
|
|
@@ -2970,7 +2970,7 @@ var _t = class extends mt {
|
|
|
2970
2970
|
else if (o < t) break;
|
|
2971
2971
|
}
|
|
2972
2972
|
}
|
|
2973
|
-
},
|
|
2973
|
+
}, yt = class t {
|
|
2974
2974
|
flags = 2048;
|
|
2975
2975
|
get strict() {
|
|
2976
2976
|
return (this.flags & 1) > 0;
|
|
@@ -3059,7 +3059,7 @@ var _t = class extends mt {
|
|
|
3059
3059
|
end = 0;
|
|
3060
3060
|
lastTokEndLoc = null;
|
|
3061
3061
|
lastTokStartLoc = null;
|
|
3062
|
-
context = [
|
|
3062
|
+
context = [A.brace];
|
|
3063
3063
|
get canStartJSXElement() {
|
|
3064
3064
|
return (this.flags & 2048) > 0;
|
|
3065
3065
|
}
|
|
@@ -3088,9 +3088,9 @@ var _t = class extends mt {
|
|
|
3088
3088
|
let e = new t();
|
|
3089
3089
|
return e.flags = this.flags, e.startIndex = this.startIndex, e.curLine = this.curLine, e.lineStart = this.lineStart, e.startLoc = this.startLoc, e.endLoc = this.endLoc, e.errors = this.errors.slice(), e.noArrowAt = this.noArrowAt.slice(), e.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice(), e.labels = this.labels.slice(), e.commentsLen = this.commentsLen, e.commentStack = this.commentStack.slice(), e.pos = this.pos, e.type = this.type, e.value = this.value, e.start = this.start, e.end = this.end, e.lastTokEndLoc = this.lastTokEndLoc, e.lastTokStartLoc = this.lastTokStartLoc, e.context = this.context.slice(), e.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos, e.strictErrors = this.strictErrors, e.tokensLength = this.tokensLength, e;
|
|
3090
3090
|
}
|
|
3091
|
-
},
|
|
3091
|
+
}, bt = function(e) {
|
|
3092
3092
|
return e >= 48 && e <= 57;
|
|
3093
|
-
},
|
|
3093
|
+
}, xt = {
|
|
3094
3094
|
decBinOct: /* @__PURE__ */ new Set([
|
|
3095
3095
|
46,
|
|
3096
3096
|
66,
|
|
@@ -3107,13 +3107,13 @@ var _t = class extends mt {
|
|
|
3107
3107
|
95,
|
|
3108
3108
|
120
|
|
3109
3109
|
])
|
|
3110
|
-
},
|
|
3110
|
+
}, St = {
|
|
3111
3111
|
bin: (e) => e === 48 || e === 49,
|
|
3112
3112
|
oct: (e) => e >= 48 && e <= 55,
|
|
3113
3113
|
dec: (e) => e >= 48 && e <= 57,
|
|
3114
3114
|
hex: (e) => e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102
|
|
3115
3115
|
};
|
|
3116
|
-
function
|
|
3116
|
+
function Ct(e, t, n, r, i, a) {
|
|
3117
3117
|
let o = n, s = r, c = i, l = "", u = null, d = n, { length: f } = t;
|
|
3118
3118
|
for (;;) {
|
|
3119
3119
|
if (n >= f) {
|
|
@@ -3121,13 +3121,13 @@ function St(e, t, n, r, i, a) {
|
|
|
3121
3121
|
break;
|
|
3122
3122
|
}
|
|
3123
3123
|
let p = t.charCodeAt(n);
|
|
3124
|
-
if (
|
|
3124
|
+
if (wt(e, p, t, n)) {
|
|
3125
3125
|
l += t.slice(d, n);
|
|
3126
3126
|
break;
|
|
3127
3127
|
}
|
|
3128
3128
|
if (p === 92) {
|
|
3129
3129
|
l += t.slice(d, n);
|
|
3130
|
-
let o =
|
|
3130
|
+
let o = Tt(t, n, r, i, e === "template", a);
|
|
3131
3131
|
o.ch === null && !u ? u = {
|
|
3132
3132
|
pos: n,
|
|
3133
3133
|
lineStart: r,
|
|
@@ -3143,10 +3143,10 @@ function St(e, t, n, r, i, a) {
|
|
|
3143
3143
|
curLine: i
|
|
3144
3144
|
};
|
|
3145
3145
|
}
|
|
3146
|
-
function
|
|
3146
|
+
function wt(e, t, n, r) {
|
|
3147
3147
|
return e === "template" ? t === 96 || t === 36 && n.charCodeAt(r + 1) === 123 : t === (e === "double" ? 34 : 39);
|
|
3148
3148
|
}
|
|
3149
|
-
function
|
|
3149
|
+
function Tt(e, t, n, r, i, a) {
|
|
3150
3150
|
let o = !i;
|
|
3151
3151
|
t++;
|
|
3152
3152
|
let s = (e) => ({
|
|
@@ -3160,11 +3160,11 @@ function wt(e, t, n, r, i, a) {
|
|
|
3160
3160
|
case 114: return s("\r");
|
|
3161
3161
|
case 120: {
|
|
3162
3162
|
let i;
|
|
3163
|
-
return {code: i, pos: t} =
|
|
3163
|
+
return {code: i, pos: t} = Et(e, t, n, r, 2, !1, o, a), s(i === null ? null : String.fromCharCode(i));
|
|
3164
3164
|
}
|
|
3165
3165
|
case 117: {
|
|
3166
3166
|
let i;
|
|
3167
|
-
return {code: i, pos: t} =
|
|
3167
|
+
return {code: i, pos: t} = Ot(e, t, n, r, o, a), s(i === null ? null : String.fromCodePoint(i));
|
|
3168
3168
|
}
|
|
3169
3169
|
case 116: return s(" ");
|
|
3170
3170
|
case 98: return s("\b");
|
|
@@ -3192,15 +3192,15 @@ function wt(e, t, n, r, i, a) {
|
|
|
3192
3192
|
return s(String.fromCharCode(c));
|
|
3193
3193
|
}
|
|
3194
3194
|
}
|
|
3195
|
-
function
|
|
3195
|
+
function Et(e, t, n, r, i, a, o, s) {
|
|
3196
3196
|
let c = t, l;
|
|
3197
|
-
return {n: l, pos: t} =
|
|
3197
|
+
return {n: l, pos: t} = Dt(e, t, n, r, 16, i, a, !1, s, !o), l === null && (o ? s.invalidEscapeSequence(c, n, r) : t = c - 1), {
|
|
3198
3198
|
code: l,
|
|
3199
3199
|
pos: t
|
|
3200
3200
|
};
|
|
3201
3201
|
}
|
|
3202
|
-
function
|
|
3203
|
-
let u = t, d = i === 16 ?
|
|
3202
|
+
function Dt(e, t, n, r, i, a, o, s, c, l) {
|
|
3203
|
+
let u = t, d = i === 16 ? xt.hex : xt.decBinOct, f = i === 16 ? St.hex : i === 10 ? St.dec : i === 8 ? St.oct : St.bin, p = !1, m = 0;
|
|
3204
3204
|
for (let u = 0, h = a ?? Infinity; u < h; ++u) {
|
|
3205
3205
|
let a = e.charCodeAt(t), u;
|
|
3206
3206
|
if (a === 95 && s !== "bail") {
|
|
@@ -3221,7 +3221,7 @@ function Et(e, t, n, r, i, a, o, s, c, l) {
|
|
|
3221
3221
|
++t;
|
|
3222
3222
|
continue;
|
|
3223
3223
|
}
|
|
3224
|
-
if (u = a >= 97 ? a - 97 + 10 : a >= 65 ? a - 65 + 10 :
|
|
3224
|
+
if (u = a >= 97 ? a - 97 + 10 : a >= 65 ? a - 65 + 10 : bt(a) ? a - 48 : Infinity, u >= i) {
|
|
3225
3225
|
if (u <= 9 && l) return {
|
|
3226
3226
|
n: null,
|
|
3227
3227
|
pos: t
|
|
@@ -3240,26 +3240,26 @@ function Et(e, t, n, r, i, a, o, s, c, l) {
|
|
|
3240
3240
|
pos: t
|
|
3241
3241
|
};
|
|
3242
3242
|
}
|
|
3243
|
-
function
|
|
3243
|
+
function Ot(e, t, n, r, i, a) {
|
|
3244
3244
|
let o = e.charCodeAt(t), s;
|
|
3245
3245
|
if (o === 123) {
|
|
3246
|
-
if (++t, {code: s, pos: t} =
|
|
3246
|
+
if (++t, {code: s, pos: t} = Et(e, t, n, r, e.indexOf("}", t) - t, !0, i, a), ++t, s !== null && s > 1114111) {
|
|
3247
3247
|
if (i) a.invalidCodePoint(t, n, r);
|
|
3248
3248
|
else return {
|
|
3249
3249
|
code: null,
|
|
3250
3250
|
pos: t
|
|
3251
3251
|
};
|
|
3252
3252
|
}
|
|
3253
|
-
} else ({code: s, pos: t} =
|
|
3253
|
+
} else ({code: s, pos: t} = Et(e, t, n, r, 4, !1, i, a));
|
|
3254
3254
|
return {
|
|
3255
3255
|
code: s,
|
|
3256
3256
|
pos: t
|
|
3257
3257
|
};
|
|
3258
3258
|
}
|
|
3259
|
-
function
|
|
3259
|
+
function B(t, n, r) {
|
|
3260
3260
|
return new e(r, t - n, t);
|
|
3261
3261
|
}
|
|
3262
|
-
var
|
|
3262
|
+
var kt = /* @__PURE__ */ new Set([
|
|
3263
3263
|
103,
|
|
3264
3264
|
109,
|
|
3265
3265
|
115,
|
|
@@ -3268,16 +3268,16 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3268
3268
|
117,
|
|
3269
3269
|
100,
|
|
3270
3270
|
118
|
|
3271
|
-
]),
|
|
3271
|
+
]), At = class {
|
|
3272
3272
|
constructor(e) {
|
|
3273
3273
|
let n = e.startIndex || 0;
|
|
3274
3274
|
this.type = e.type, this.value = e.value, this.start = n + e.start, this.end = n + e.end, this.loc = new t(e.startLoc, e.endLoc);
|
|
3275
3275
|
}
|
|
3276
|
-
},
|
|
3276
|
+
}, jt, Mt = class extends vt {
|
|
3277
3277
|
isLookahead;
|
|
3278
3278
|
tokens = [];
|
|
3279
3279
|
constructor(e, t) {
|
|
3280
|
-
super(), this.state = new
|
|
3280
|
+
super(), this.state = new yt(), this.state.init(e), this.input = t, this.length = t.length, this.comments = [], this.isLookahead = !1, (!jt || jt.length < (this.length + 1) * 2) && (jt = new Uint32Array((this.length + 1) * 2)), this.locData = jt;
|
|
3281
3281
|
}
|
|
3282
3282
|
setLoc(e) {
|
|
3283
3283
|
let t = this.offsetToSourcePos(e.index);
|
|
@@ -3291,7 +3291,7 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3291
3291
|
this.tokens.length = this.state.tokensLength, this.tokens.push(e), ++this.state.tokensLength;
|
|
3292
3292
|
}
|
|
3293
3293
|
next() {
|
|
3294
|
-
this.checkKeywordEscapes(), this.optionFlags & 512 && this.pushToken(new
|
|
3294
|
+
this.checkKeywordEscapes(), this.optionFlags & 512 && this.pushToken(new At(this.state)), this.state.lastTokEndLoc = this.state.endLoc, this.state.lastTokStartLoc = this.state.startLoc, this.nextToken();
|
|
3295
3295
|
}
|
|
3296
3296
|
eat(e) {
|
|
3297
3297
|
return this.match(e) ? (this.next(), !0) : !1;
|
|
@@ -3325,7 +3325,7 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3325
3325
|
return this.nextTokenStartSince(this.state.pos);
|
|
3326
3326
|
}
|
|
3327
3327
|
nextTokenStartSince(e) {
|
|
3328
|
-
return
|
|
3328
|
+
return lt.lastIndex = e, lt.test(this.input) ? lt.lastIndex : e;
|
|
3329
3329
|
}
|
|
3330
3330
|
lookaheadCharCode() {
|
|
3331
3331
|
return this.lookaheadCharCodeSince(this.state.pos);
|
|
@@ -3337,7 +3337,7 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3337
3337
|
return this.nextTokenInLineStartSince(this.state.pos);
|
|
3338
3338
|
}
|
|
3339
3339
|
nextTokenInLineStartSince(e) {
|
|
3340
|
-
return
|
|
3340
|
+
return ut.lastIndex = e, ut.test(this.input) ? ut.lastIndex : e;
|
|
3341
3341
|
}
|
|
3342
3342
|
lookaheadInLineCharCode() {
|
|
3343
3343
|
return this.input.charCodeAt(this.nextTokenInLineStart());
|
|
@@ -3368,7 +3368,7 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3368
3368
|
this.isLookahead || (n = this.state.curPosition());
|
|
3369
3369
|
let r = this.state.pos, i = this.input.indexOf(e, r + 2);
|
|
3370
3370
|
if (i === -1) throw this.raise(g.UnterminatedComment, this.state.curPosition());
|
|
3371
|
-
for (this.state.pos = i + e.length,
|
|
3371
|
+
for (this.state.pos = i + e.length, st.lastIndex = r + 2; st.test(this.input) && st.lastIndex <= i;) ++this.state.curLine, this.state.lineStart = st.lastIndex;
|
|
3372
3372
|
if (this.isLookahead) return;
|
|
3373
3373
|
let a = {
|
|
3374
3374
|
type: "CommentBlock",
|
|
@@ -3383,7 +3383,7 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3383
3383
|
let n = this.state.pos, r;
|
|
3384
3384
|
this.isLookahead || (r = this.state.curPosition());
|
|
3385
3385
|
let i = this.input.charCodeAt(this.state.pos += e);
|
|
3386
|
-
if (this.state.pos < this.length) for (; !
|
|
3386
|
+
if (this.state.pos < this.length) for (; !P(i) && ++this.state.pos < this.length;) i = this.input.charCodeAt(this.state.pos);
|
|
3387
3387
|
if (this.isLookahead) return;
|
|
3388
3388
|
let a = this.state.pos, o = {
|
|
3389
3389
|
type: "CommentLine",
|
|
@@ -3425,7 +3425,7 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3425
3425
|
default: break loop;
|
|
3426
3426
|
}
|
|
3427
3427
|
break;
|
|
3428
|
-
default: if (
|
|
3428
|
+
default: if (dt(n)) ++this.state.pos;
|
|
3429
3429
|
else if (n === 45 && !this.inModule && this.optionFlags & 16384) {
|
|
3430
3430
|
let n = this.state.pos;
|
|
3431
3431
|
if (this.input.charCodeAt(n + 1) === 45 && this.input.charCodeAt(n + 2) === 62 && (e === 0 || this.state.lineStart > e)) {
|
|
@@ -3465,7 +3465,7 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3465
3465
|
if (this.state.pos === 0 && this.readToken_interpreter()) return;
|
|
3466
3466
|
let e = this.state.pos + 1, t = this.codePointAtPos(e);
|
|
3467
3467
|
if (t >= 48 && t <= 57) throw this.raise(g.UnexpectedDigitAfterHash, this.state.curPosition());
|
|
3468
|
-
|
|
3468
|
+
j(t) ? (++this.state.pos, this.finishToken(134, this.readWord1(t))) : t === 92 ? (++this.state.pos, this.finishToken(134, this.readWord1())) : this.finishOp(23, 1);
|
|
3469
3469
|
}
|
|
3470
3470
|
readToken_dot() {
|
|
3471
3471
|
let e = this.input.charCodeAt(this.state.pos + 1);
|
|
@@ -3483,7 +3483,7 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3483
3483
|
let e = this.input.charCodeAt(this.state.pos + 1);
|
|
3484
3484
|
if (e !== 33) return !1;
|
|
3485
3485
|
let t = this.state.pos;
|
|
3486
|
-
for (this.state.pos += 1; !
|
|
3486
|
+
for (this.state.pos += 1; !P(e) && ++this.state.pos < this.length;) e = this.input.charCodeAt(this.state.pos);
|
|
3487
3487
|
let n = this.input.slice(t + 2, this.state.pos);
|
|
3488
3488
|
return this.finishToken(24, n), !0;
|
|
3489
3489
|
}
|
|
@@ -3685,7 +3685,7 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3685
3685
|
case 92:
|
|
3686
3686
|
this.readWord();
|
|
3687
3687
|
return;
|
|
3688
|
-
default: if (
|
|
3688
|
+
default: if (j(e)) {
|
|
3689
3689
|
this.readWord(e);
|
|
3690
3690
|
return;
|
|
3691
3691
|
}
|
|
@@ -3701,7 +3701,7 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3701
3701
|
for (;; ++a) {
|
|
3702
3702
|
if (a >= this.length) throw this.raise(g.UnterminatedRegExp, n(e, 1));
|
|
3703
3703
|
let t = this.input.charCodeAt(a);
|
|
3704
|
-
if (
|
|
3704
|
+
if (P(t)) throw this.raise(g.UnterminatedRegExp, n(e, 1));
|
|
3705
3705
|
if (r) r = !1;
|
|
3706
3706
|
else {
|
|
3707
3707
|
if (t === 91) i = !0;
|
|
@@ -3715,8 +3715,8 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3715
3715
|
let s = "", c = () => n(e, a + 2 - t);
|
|
3716
3716
|
for (; a < this.length;) {
|
|
3717
3717
|
let e = this.codePointAtPos(a), t = String.fromCharCode(e);
|
|
3718
|
-
if (
|
|
3719
|
-
else if (
|
|
3718
|
+
if (kt.has(e)) e === 118 ? s.includes("u") && this.raise(g.IncompatibleRegExpUVFlags, c()) : e === 117 && s.includes("v") && this.raise(g.IncompatibleRegExpUVFlags, c()), s.includes(t) && this.raise(g.DuplicateRegExpFlags, c());
|
|
3719
|
+
else if (M(e) || e === 92) this.raise(g.MalformedRegExpFlags, c());
|
|
3720
3720
|
else break;
|
|
3721
3721
|
++a, s += t;
|
|
3722
3722
|
}
|
|
@@ -3726,14 +3726,14 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3726
3726
|
});
|
|
3727
3727
|
}
|
|
3728
3728
|
readInt(e, t, n = !1, r = !0) {
|
|
3729
|
-
let { n: i, pos: a } =
|
|
3729
|
+
let { n: i, pos: a } = Dt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, e, t, n, r, this.errorHandlers_readInt, !1);
|
|
3730
3730
|
return this.state.pos = a, i;
|
|
3731
3731
|
}
|
|
3732
3732
|
readRadixNumber(e) {
|
|
3733
3733
|
let t = this.state.pos, r = this.state.curPosition(), i = !1;
|
|
3734
3734
|
this.state.pos += 2;
|
|
3735
3735
|
let a = this.readInt(e);
|
|
3736
|
-
if (a ?? this.raise(g.InvalidDigit, n(r, 2), { radix: e }), this.input.charCodeAt(this.state.pos) === 110 && (++this.state.pos, i = !0),
|
|
3736
|
+
if (a ?? this.raise(g.InvalidDigit, n(r, 2), { radix: e }), this.input.charCodeAt(this.state.pos) === 110 && (++this.state.pos, i = !0), j(this.codePointAtPos(this.state.pos))) throw this.raise(g.NumberIdentifier, this.state.curPosition());
|
|
3737
3737
|
if (i) {
|
|
3738
3738
|
let e = this.input.slice(t, this.state.pos).replace(/[_n]/g, "");
|
|
3739
3739
|
this.finishToken(132, e);
|
|
@@ -3756,7 +3756,7 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3756
3756
|
let c = this.input.charCodeAt(this.state.pos);
|
|
3757
3757
|
c === 46 && !o && (++this.state.pos, this.readInt(10), i = !0, c = this.input.charCodeAt(this.state.pos)), (c === 69 || c === 101) && !o && (c = this.input.charCodeAt(++this.state.pos), (c === 43 || c === 45) && ++this.state.pos, this.readInt(10) === null && this.raise(g.InvalidOrMissingExponent, r), i = !0, c = this.input.charCodeAt(this.state.pos));
|
|
3758
3758
|
let l = this.input.slice(t, this.state.pos).replaceAll("_", "");
|
|
3759
|
-
if (c === 110 && ((i || s) && this.raise(g.InvalidBigIntLiteral, r), ++this.state.pos, a = !0),
|
|
3759
|
+
if (c === 110 && ((i || s) && this.raise(g.InvalidBigIntLiteral, r), ++this.state.pos, a = !0), j(this.codePointAtPos(this.state.pos))) throw this.raise(g.NumberIdentifier, this.state.curPosition());
|
|
3760
3760
|
if (a) {
|
|
3761
3761
|
this.finishToken(132, l);
|
|
3762
3762
|
return;
|
|
@@ -3765,18 +3765,18 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3765
3765
|
this.finishToken(131, u);
|
|
3766
3766
|
}
|
|
3767
3767
|
readCodePoint(e) {
|
|
3768
|
-
let { code: t, pos: n } =
|
|
3768
|
+
let { code: t, pos: n } = Ot(this.input, this.state.pos, this.state.lineStart, this.state.curLine, e, this.errorHandlers_readCodePoint);
|
|
3769
3769
|
return this.state.pos = n, t;
|
|
3770
3770
|
}
|
|
3771
3771
|
readString(e) {
|
|
3772
|
-
let { str: t, pos: n, curLine: r, lineStart: i } =
|
|
3772
|
+
let { str: t, pos: n, curLine: r, lineStart: i } = Ct(e === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string);
|
|
3773
3773
|
this.state.pos = n + 1, this.state.lineStart = i, this.state.curLine = r, this.finishToken(130, t);
|
|
3774
3774
|
}
|
|
3775
3775
|
readTemplateContinuation() {
|
|
3776
3776
|
this.match(4) || this.unexpected(null, 4), this.state.pos--, this.readTemplateToken();
|
|
3777
3777
|
}
|
|
3778
3778
|
readTemplateToken() {
|
|
3779
|
-
let t = this.input[this.state.pos], { str: n, firstInvalidLoc: r, pos: i, curLine: a, lineStart: o } =
|
|
3779
|
+
let t = this.input[this.state.pos], { str: n, firstInvalidLoc: r, pos: i, curLine: a, lineStart: o } = Ct("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template);
|
|
3780
3780
|
this.state.pos = i + 1, this.state.lineStart = o, this.state.curLine = a, r && (this.state.firstInvalidTemplateEscapePos = new e(r.curLine, r.pos - r.lineStart, this.sourceToOffsetPos(r.pos))), this.input.codePointAt(i) === 96 ? this.finishToken(20, r ? null : t + n + "`") : (this.state.pos++, this.finishToken(21, r ? null : t + n + "${"));
|
|
3781
3781
|
}
|
|
3782
3782
|
recordStrictModeErrors(e, t) {
|
|
@@ -3788,10 +3788,10 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3788
3788
|
let t = "", n = this.state.pos, r = this.state.pos;
|
|
3789
3789
|
for (e !== void 0 && (this.state.pos += e <= 65535 ? 1 : 2); this.state.pos < this.length;) {
|
|
3790
3790
|
let e = this.codePointAtPos(this.state.pos);
|
|
3791
|
-
if (
|
|
3791
|
+
if (M(e)) this.state.pos += e <= 65535 ? 1 : 2;
|
|
3792
3792
|
else if (e === 92) {
|
|
3793
3793
|
this.state.containsEsc = !0, t += this.input.slice(r, this.state.pos);
|
|
3794
|
-
let e = this.state.curPosition(), i = this.state.pos === n ?
|
|
3794
|
+
let e = this.state.curPosition(), i = this.state.pos === n ? j : M;
|
|
3795
3795
|
if (this.input.charCodeAt(++this.state.pos) !== 117) {
|
|
3796
3796
|
this.raise(g.MissingUnicodeEscape, this.state.curPosition()), r = this.state.pos - 1;
|
|
3797
3797
|
continue;
|
|
@@ -3804,12 +3804,12 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3804
3804
|
return t + this.input.slice(r, this.state.pos);
|
|
3805
3805
|
}
|
|
3806
3806
|
readWord(e) {
|
|
3807
|
-
let t = this.readWord1(e), n =
|
|
3808
|
-
n === void 0 ? this.finishToken(128, t) : this.finishToken(n,
|
|
3807
|
+
let t = this.readWord1(e), n = se.get(t);
|
|
3808
|
+
n === void 0 ? this.finishToken(128, t) : this.finishToken(n, k(n));
|
|
3809
3809
|
}
|
|
3810
3810
|
checkKeywordEscapes() {
|
|
3811
3811
|
let { type: e } = this.state;
|
|
3812
|
-
|
|
3812
|
+
xe(e) && this.state.containsEsc && this.raise(g.InvalidEscapedReservedWord, this.state.startLoc, { reservedWord: k(e) });
|
|
3813
3813
|
}
|
|
3814
3814
|
raise(t, n, r = {}) {
|
|
3815
3815
|
let i = n instanceof e ? n : typeof n == "number" ? this.getLoc(n) : this.optionFlags & 256 ? n.loc.start : this.getLoc(n.start), a = t(i, n instanceof e ? i.index : typeof n == "number" ? n : n.start, r);
|
|
@@ -3827,7 +3827,7 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3827
3827
|
}
|
|
3828
3828
|
updateContext(e) {}
|
|
3829
3829
|
unexpected(e, t) {
|
|
3830
|
-
throw this.raise(g.UnexpectedToken, e ?? this.state.startLoc, { expected: t ?
|
|
3830
|
+
throw this.raise(g.UnexpectedToken, e ?? this.state.startLoc, { expected: t ? k(t) : null });
|
|
3831
3831
|
}
|
|
3832
3832
|
expectPlugin(e, t) {
|
|
3833
3833
|
if (this.hasPlugin(e)) return !0;
|
|
@@ -3838,11 +3838,11 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3838
3838
|
}
|
|
3839
3839
|
errorBuilder(e) {
|
|
3840
3840
|
return (t, n, r) => {
|
|
3841
|
-
this.raise(e,
|
|
3841
|
+
this.raise(e, B(t, n, r));
|
|
3842
3842
|
};
|
|
3843
3843
|
}
|
|
3844
3844
|
errorHandlers_readInt = {
|
|
3845
|
-
invalidDigit: (e, t, n, r) => this.optionFlags & 4096 ? (this.raise(g.InvalidDigit,
|
|
3845
|
+
invalidDigit: (e, t, n, r) => this.optionFlags & 4096 ? (this.raise(g.InvalidDigit, B(e, t, n), { radix: r }), !0) : !1,
|
|
3846
3846
|
numericSeparatorInEscapeSequence: this.errorBuilder(g.NumericSeparatorInEscapeSequence),
|
|
3847
3847
|
unexpectedNumericSeparator: this.errorBuilder(g.UnexpectedNumericSeparator)
|
|
3848
3848
|
};
|
|
@@ -3854,24 +3854,24 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3854
3854
|
errorHandlers_readStringContents_string = {
|
|
3855
3855
|
...this.errorHandlers_readCodePoint,
|
|
3856
3856
|
strictNumericEscape: (e, t, n) => {
|
|
3857
|
-
this.recordStrictModeErrors(g.StrictNumericEscape,
|
|
3857
|
+
this.recordStrictModeErrors(g.StrictNumericEscape, B(e, t, n));
|
|
3858
3858
|
},
|
|
3859
3859
|
unterminated: (e, t, n) => {
|
|
3860
|
-
throw this.raise(g.UnterminatedString,
|
|
3860
|
+
throw this.raise(g.UnterminatedString, B(e - 1, t, n));
|
|
3861
3861
|
}
|
|
3862
3862
|
};
|
|
3863
3863
|
errorHandlers_readStringContents_template = {
|
|
3864
3864
|
...this.errorHandlers_readCodePoint,
|
|
3865
3865
|
strictNumericEscape: this.errorBuilder(g.StrictNumericEscape),
|
|
3866
3866
|
unterminated: (e, t, n) => {
|
|
3867
|
-
throw this.raise(g.UnterminatedTemplate,
|
|
3867
|
+
throw this.raise(g.UnterminatedTemplate, B(e, t, n));
|
|
3868
3868
|
}
|
|
3869
3869
|
};
|
|
3870
|
-
},
|
|
3870
|
+
}, Nt = class {
|
|
3871
3871
|
privateNames = /* @__PURE__ */ new Set();
|
|
3872
3872
|
loneAccessors = /* @__PURE__ */ new Map();
|
|
3873
3873
|
undefinedPrivateNames = /* @__PURE__ */ new Map();
|
|
3874
|
-
},
|
|
3874
|
+
}, Pt = class {
|
|
3875
3875
|
parser;
|
|
3876
3876
|
stack = [];
|
|
3877
3877
|
constructor(e) {
|
|
@@ -3881,7 +3881,7 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3881
3881
|
return this.stack[this.stack.length - 1];
|
|
3882
3882
|
}
|
|
3883
3883
|
enter() {
|
|
3884
|
-
this.stack.push(new
|
|
3884
|
+
this.stack.push(new Nt());
|
|
3885
3885
|
}
|
|
3886
3886
|
exit() {
|
|
3887
3887
|
let e = this.stack.pop(), t = this.current();
|
|
@@ -3903,7 +3903,7 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3903
3903
|
for (n of this.stack) if (n.privateNames.has(e)) return;
|
|
3904
3904
|
n ? n.undefinedPrivateNames.set(e, t) : this.parser.raise(g.InvalidPrivateFieldResolution, t, { identifierName: e });
|
|
3905
3905
|
}
|
|
3906
|
-
},
|
|
3906
|
+
}, Ft = class {
|
|
3907
3907
|
constructor(e = 0) {
|
|
3908
3908
|
this.type = e;
|
|
3909
3909
|
}
|
|
@@ -3913,7 +3913,7 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3913
3913
|
isCertainlyParameterDeclaration() {
|
|
3914
3914
|
return this.type === 3;
|
|
3915
3915
|
}
|
|
3916
|
-
},
|
|
3916
|
+
}, It = class extends Ft {
|
|
3917
3917
|
declarationErrors = /* @__PURE__ */ new Map();
|
|
3918
3918
|
constructor(e) {
|
|
3919
3919
|
super(e);
|
|
@@ -3927,9 +3927,9 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3927
3927
|
iterateErrors(e) {
|
|
3928
3928
|
this.declarationErrors.forEach(e);
|
|
3929
3929
|
}
|
|
3930
|
-
},
|
|
3930
|
+
}, Lt = class {
|
|
3931
3931
|
parser;
|
|
3932
|
-
stack = [new
|
|
3932
|
+
stack = [new Ft()];
|
|
3933
3933
|
constructor(e) {
|
|
3934
3934
|
this.parser = e;
|
|
3935
3935
|
}
|
|
@@ -3967,19 +3967,19 @@ var Ot = /* @__PURE__ */ new Set([
|
|
|
3967
3967
|
});
|
|
3968
3968
|
}
|
|
3969
3969
|
};
|
|
3970
|
-
function Lt() {
|
|
3971
|
-
return new Pt(3);
|
|
3972
|
-
}
|
|
3973
3970
|
function Rt() {
|
|
3974
|
-
return new Ft(
|
|
3971
|
+
return new Ft(3);
|
|
3975
3972
|
}
|
|
3976
3973
|
function zt() {
|
|
3977
|
-
return new
|
|
3974
|
+
return new It(1);
|
|
3978
3975
|
}
|
|
3979
3976
|
function Bt() {
|
|
3980
|
-
return new
|
|
3977
|
+
return new It(2);
|
|
3981
3978
|
}
|
|
3982
|
-
|
|
3979
|
+
function Vt() {
|
|
3980
|
+
return new Ft();
|
|
3981
|
+
}
|
|
3982
|
+
var Ht = class {
|
|
3983
3983
|
stacks = [];
|
|
3984
3984
|
enter(e) {
|
|
3985
3985
|
this.stacks.push(e);
|
|
@@ -4006,10 +4006,10 @@ var Vt = class {
|
|
|
4006
4006
|
return !(this.currentFlags() & 16);
|
|
4007
4007
|
}
|
|
4008
4008
|
};
|
|
4009
|
-
function
|
|
4009
|
+
function Ut(e, t) {
|
|
4010
4010
|
return (e ? 2 : 0) | !!t;
|
|
4011
4011
|
}
|
|
4012
|
-
var
|
|
4012
|
+
var Wt = class extends Mt {
|
|
4013
4013
|
addExtra(e, t, n, r = !0) {
|
|
4014
4014
|
if (!e) return;
|
|
4015
4015
|
let { extra: i } = e;
|
|
@@ -4024,7 +4024,7 @@ var Ut = class extends jt {
|
|
|
4024
4024
|
isUnparsedContextual(e, t) {
|
|
4025
4025
|
if (this.input.startsWith(t, e)) {
|
|
4026
4026
|
let n = this.input.charCodeAt(e + t.length);
|
|
4027
|
-
return !(
|
|
4027
|
+
return !(M(n) || (n & 64512) == 55296);
|
|
4028
4028
|
}
|
|
4029
4029
|
return !1;
|
|
4030
4030
|
}
|
|
@@ -4045,10 +4045,10 @@ var Ut = class extends jt {
|
|
|
4045
4045
|
return this.match(135) || this.match(4) || this.hasPrecedingLineBreak();
|
|
4046
4046
|
}
|
|
4047
4047
|
hasPrecedingLineBreak() {
|
|
4048
|
-
return
|
|
4048
|
+
return ct(this.input, this.offsetToSourcePos(this.state.lastTokEndLoc.index), this.state.start);
|
|
4049
4049
|
}
|
|
4050
4050
|
hasFollowingLineBreak() {
|
|
4051
|
-
return
|
|
4051
|
+
return ct(this.input, this.state.end, this.nextTokenStart());
|
|
4052
4052
|
}
|
|
4053
4053
|
isLineTerminator() {
|
|
4054
4054
|
return this.eat(9) || this.canInsertSemicolon();
|
|
@@ -4108,7 +4108,7 @@ var Ut = class extends jt {
|
|
|
4108
4108
|
n != null && this.raise(g.InvalidCoverInitializedName, n), r != null && this.raise(g.DuplicateProto, r), i != null && this.raise(g.UnexpectedPrivateField, i), a != null && this.unexpected(a), o != null && this.raise(g.InvalidCoverDiscardElement, o);
|
|
4109
4109
|
}
|
|
4110
4110
|
isLiteralPropertyName() {
|
|
4111
|
-
return
|
|
4111
|
+
return ge(this.state.type);
|
|
4112
4112
|
}
|
|
4113
4113
|
isPrivateName(e) {
|
|
4114
4114
|
return e.type === "PrivateName";
|
|
@@ -4135,11 +4135,11 @@ var Ut = class extends jt {
|
|
|
4135
4135
|
let i = this.scope, a = this.getScopeHandler();
|
|
4136
4136
|
this.scope = new a(this, e);
|
|
4137
4137
|
let o = this.prodParam;
|
|
4138
|
-
this.prodParam = new
|
|
4138
|
+
this.prodParam = new Ht();
|
|
4139
4139
|
let s = this.classScope;
|
|
4140
|
-
this.classScope = new
|
|
4140
|
+
this.classScope = new Pt(this);
|
|
4141
4141
|
let c = this.expressionScope;
|
|
4142
|
-
return this.expressionScope = new
|
|
4142
|
+
return this.expressionScope = new Lt(this), () => {
|
|
4143
4143
|
this.state.labels = t, this.exportedIdentifiers = n, this.inModule = r, this.scope = i, this.prodParam = o, this.classScope = s, this.expressionScope = c;
|
|
4144
4144
|
};
|
|
4145
4145
|
}
|
|
@@ -4155,18 +4155,18 @@ var Ut = class extends jt {
|
|
|
4155
4155
|
let { privateKeyLoc: t } = e;
|
|
4156
4156
|
t !== null && this.expectPlugin("destructuringPrivate", t);
|
|
4157
4157
|
}
|
|
4158
|
-
},
|
|
4158
|
+
}, Gt = class {
|
|
4159
4159
|
shorthandAssignLoc = null;
|
|
4160
4160
|
doubleProtoLoc = null;
|
|
4161
4161
|
privateKeyLoc = null;
|
|
4162
4162
|
optionalParametersLoc = null;
|
|
4163
4163
|
voidPatternLoc = null;
|
|
4164
|
-
},
|
|
4164
|
+
}, V = class {
|
|
4165
4165
|
constructor(e, n, r, i) {
|
|
4166
4166
|
this.start = r, this.end = 0, i !== void 0 && (this.loc = new t(i)), e & 128 && (this.range = [r, 0]), i !== void 0 && n && (this.loc.filename = n);
|
|
4167
4167
|
}
|
|
4168
4168
|
type = "";
|
|
4169
|
-
},
|
|
4169
|
+
}, Kt = V.prototype, qt = class extends Wt {
|
|
4170
4170
|
createPosition(e) {
|
|
4171
4171
|
return e;
|
|
4172
4172
|
}
|
|
@@ -4176,11 +4176,11 @@ var Ut = class extends jt {
|
|
|
4176
4176
|
}
|
|
4177
4177
|
startNodeAt(e) {
|
|
4178
4178
|
let { optionFlags: t, filename: n } = this;
|
|
4179
|
-
return t & 256 ? new
|
|
4179
|
+
return t & 256 ? new V(t, n, e.index, this.createPosition(e)) : new V(t, n, e.index);
|
|
4180
4180
|
}
|
|
4181
4181
|
startNodeAtNode(e) {
|
|
4182
4182
|
let { optionFlags: t, filename: n } = this;
|
|
4183
|
-
return t & 256 ? new
|
|
4183
|
+
return t & 256 ? new V(t, n, e.start, e.loc.start) : new V(t, n, e.start);
|
|
4184
4184
|
}
|
|
4185
4185
|
finishNode(e, t) {
|
|
4186
4186
|
return this.finishNodeAt(e, t, this.state.lastTokEndLoc);
|
|
@@ -4219,17 +4219,17 @@ var Ut = class extends jt {
|
|
|
4219
4219
|
return e.type = t, e;
|
|
4220
4220
|
}
|
|
4221
4221
|
cloneIdentifier(e) {
|
|
4222
|
-
let { type: t, start: n, end: r, loc: i, range: a, name: o } = e, s = Object.create(
|
|
4222
|
+
let { type: t, start: n, end: r, loc: i, range: a, name: o } = e, s = Object.create(Kt);
|
|
4223
4223
|
return s.type = t, s.start = n, s.end = r, s.loc = i, s.range = a, s.name = o, e.extra && (s.extra = e.extra), s;
|
|
4224
4224
|
}
|
|
4225
4225
|
cloneStringLiteral(e) {
|
|
4226
|
-
let { type: t, start: n, end: r, loc: i, range: a, extra: o } = e, s = Object.create(
|
|
4226
|
+
let { type: t, start: n, end: r, loc: i, range: a, extra: o } = e, s = Object.create(Kt);
|
|
4227
4227
|
return s.type = t, s.start = n, s.end = r, s.loc = i, s.range = a, s.extra = o, s.value = e.value, s;
|
|
4228
4228
|
}
|
|
4229
|
-
},
|
|
4229
|
+
}, Jt = (e) => e.type === "ParenthesizedExpression" ? Jt(e.expression) : e, Yt = class extends qt {
|
|
4230
4230
|
toAssignable(e, t = !1) {
|
|
4231
4231
|
let n;
|
|
4232
|
-
switch ((e.type === "ParenthesizedExpression" || e.extra?.parenthesized) && (n =
|
|
4232
|
+
switch ((e.type === "ParenthesizedExpression" || e.extra?.parenthesized) && (n = Jt(e), t ? n.type === "Identifier" ? this.expressionScope.recordArrowParameterBindingError(g.InvalidParenthesizedAssignment, e) : n.type !== "CallExpression" && n.type !== "MemberExpression" && !this.isOptionalMemberExpression(n) && this.raise(g.InvalidParenthesizedAssignment, e) : this.raise(g.InvalidParenthesizedAssignment, e)), e.type) {
|
|
4233
4233
|
case "Identifier":
|
|
4234
4234
|
case "ObjectPattern":
|
|
4235
4235
|
case "ArrayPattern":
|
|
@@ -4396,7 +4396,7 @@ var Ut = class extends jt {
|
|
|
4396
4396
|
return;
|
|
4397
4397
|
}
|
|
4398
4398
|
s === "VoidPattern" && t.type === "CatchClause" && this.raise(g.VoidPatternCatchClauseParam, e);
|
|
4399
|
-
let l =
|
|
4399
|
+
let l = Jt(e);
|
|
4400
4400
|
o ||= l.type === "CallExpression" && (l.callee.type === "Import" || l.callee.type === "Super");
|
|
4401
4401
|
let u = this.isValidLVal(s, o, !(a || e.extra?.parenthesized) && t.type === "AssignmentExpression", n);
|
|
4402
4402
|
if (u === !0) return;
|
|
@@ -4412,7 +4412,7 @@ var Ut = class extends jt {
|
|
|
4412
4412
|
else m && this.checkLVal(m, p, n, r, i, f, o);
|
|
4413
4413
|
}
|
|
4414
4414
|
checkIdentifier(e, t, n = !1) {
|
|
4415
|
-
this.state.strict && (n ?
|
|
4415
|
+
this.state.strict && (n ? We(e.name, this.inModule) : Ue(e.name)) && (t === 64 ? this.raise(g.StrictEvalArguments, e, { referenceName: e.name }) : this.raise(g.StrictEvalArgumentsBinding, e, { bindingName: e.name })), t & 8192 && e.name === "let" && this.raise(g.LetInLexicalBinding, e), t & 64 || this.declareNameFromIdentifier(e, t);
|
|
4416
4416
|
}
|
|
4417
4417
|
declareNameFromIdentifier(e, t) {
|
|
4418
4418
|
this.scope.declareName(e.name, t, e.start);
|
|
@@ -4432,7 +4432,7 @@ var Ut = class extends jt {
|
|
|
4432
4432
|
checkCommaAfterRest(e) {
|
|
4433
4433
|
return this.match(8) ? (this.raise(this.lookaheadCharCode() === e ? g.RestTrailingComma : g.ElementAfterRest, this.state.startLoc), !0) : !1;
|
|
4434
4434
|
}
|
|
4435
|
-
},
|
|
4435
|
+
}, Xt = class extends Yt {
|
|
4436
4436
|
checkProto(e, t, n) {
|
|
4437
4437
|
if (e.type === "SpreadElement" || this.isObjectMethod(e) || e.computed || e.shorthand) return t;
|
|
4438
4438
|
let r = e.key;
|
|
@@ -4445,7 +4445,7 @@ var Ut = class extends jt {
|
|
|
4445
4445
|
if (this.enterInitialScopes(), this.nextToken(), this.match(135)) throw this.raise(g.ParseExpressionEmptyInput, this.state.startLoc);
|
|
4446
4446
|
let e = this.parseExpression();
|
|
4447
4447
|
if (!this.match(135)) throw this.raise(g.ParseExpressionExpectsEOF, this.state.startLoc, { unexpected: this.input.codePointAt(this.state.start) });
|
|
4448
|
-
return this.finalizeRemainingComments(), e.comments = this.comments, e.errors = this.state.errors, this.optionFlags & 512 && (e.tokens =
|
|
4448
|
+
return this.finalizeRemainingComments(), e.comments = this.comments, e.errors = this.state.errors, this.optionFlags & 512 && (e.tokens = tn(this.tokens)), e;
|
|
4449
4449
|
}
|
|
4450
4450
|
parseExpression(e, t) {
|
|
4451
4451
|
return e ? this.disallowInAnd(() => this.parseExpressionBase(t)) : this.allowInAnd(() => this.parseExpressionBase(t));
|
|
@@ -4476,9 +4476,9 @@ var Ut = class extends jt {
|
|
|
4476
4476
|
return t && (e = t.call(this, e, n)), e;
|
|
4477
4477
|
}
|
|
4478
4478
|
let i;
|
|
4479
|
-
e ? i = !1 : (e = new
|
|
4479
|
+
e ? i = !1 : (e = new Gt(), i = !0), this.state.canStartArrow = !0;
|
|
4480
4480
|
let a = this.parseMaybeConditional(e);
|
|
4481
|
-
if (t && (a = t.call(this, a, n)),
|
|
4481
|
+
if (t && (a = t.call(this, a, n)), ve(this.state.type)) {
|
|
4482
4482
|
let t = this.startNodeAt(n), r = this.state.value;
|
|
4483
4483
|
if (t.operator = r, this.match(25)) {
|
|
4484
4484
|
this.toAssignable(a, !0), t.left = a;
|
|
@@ -4489,7 +4489,7 @@ var Ut = class extends jt {
|
|
|
4489
4489
|
}
|
|
4490
4490
|
if (i && this.checkExpressionErrors(e, !0), r) {
|
|
4491
4491
|
let { type: e } = this.state;
|
|
4492
|
-
if ((this.hasPlugin("v8intrinsic") ?
|
|
4492
|
+
if ((this.hasPlugin("v8intrinsic") ? O(e) : O(e) && !this.match(50)) && !this.isAmbiguousPrefixOrIdentifier()) return this.raiseOverwrite(g.YieldNotInGeneratorFunction, n), this.parseYield(n);
|
|
4493
4493
|
}
|
|
4494
4494
|
return a;
|
|
4495
4495
|
}
|
|
@@ -4514,17 +4514,17 @@ var Ut = class extends jt {
|
|
|
4514
4514
|
parseExprOp(e, t, n) {
|
|
4515
4515
|
if (this.isPrivateName(e)) {
|
|
4516
4516
|
let r = this.getPrivateNameSV(e);
|
|
4517
|
-
(n >=
|
|
4517
|
+
(n >= De(54) || !this.prodParam.hasIn || !this.match(54)) && this.raise(g.PrivateInExpectedIn, t, { identifierName: r }), this.classScope.usePrivateName(r, t);
|
|
4518
4518
|
}
|
|
4519
4519
|
let r = this.state.type;
|
|
4520
|
-
if (
|
|
4521
|
-
let i =
|
|
4520
|
+
if (Se(r) && (this.prodParam.hasIn || !this.match(54))) {
|
|
4521
|
+
let i = De(r);
|
|
4522
4522
|
if (i > n) {
|
|
4523
4523
|
if (r === 35 && (this.expectPlugin("pipelineOperator"), this.prodParam.inFSharpPipelineDirectBody)) return e;
|
|
4524
4524
|
let a = this.startNodeAt(t);
|
|
4525
4525
|
a.left = e, a.operator = this.state.value;
|
|
4526
4526
|
let o = r === 37 || r === 38, s = r === 36;
|
|
4527
|
-
s && (i =
|
|
4527
|
+
s && (i = De(38)), this.next(), a.right = this.parseExprOpRightExpr(r, i);
|
|
4528
4528
|
let c = this.finishNode(a, o || s ? "LogicalExpression" : "BinaryExpression"), l = this.state.type;
|
|
4529
4529
|
if (s && (l === 37 || l === 38) || o && l === 36) throw this.raise(g.MixingCoalesceWithLogical, this.state.startLoc);
|
|
4530
4530
|
return this.parseExprOp(c, t, n);
|
|
@@ -4543,7 +4543,7 @@ var Ut = class extends jt {
|
|
|
4543
4543
|
}
|
|
4544
4544
|
parseExprOpBaseRightExpr(e, t) {
|
|
4545
4545
|
let n = this.state.startLoc;
|
|
4546
|
-
return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), n,
|
|
4546
|
+
return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), n, Oe(e) ? t - 1 : t);
|
|
4547
4547
|
}
|
|
4548
4548
|
parseHackPipeBody() {
|
|
4549
4549
|
let { startLoc: e } = this.state, t = this.parseMaybeAssign();
|
|
@@ -4560,7 +4560,7 @@ var Ut = class extends jt {
|
|
|
4560
4560
|
return t || this.checkExponentialAfterUnary(e), e;
|
|
4561
4561
|
}
|
|
4562
4562
|
let i = this.match(30), a = this.startNode();
|
|
4563
|
-
if (
|
|
4563
|
+
if (we(this.state.type)) {
|
|
4564
4564
|
a.operator = this.state.value, a.prefix = !0, this.state.canStartArrow = !1, this.match(68) && this.expectPlugin("throwExpressions");
|
|
4565
4565
|
let n = this.match(85);
|
|
4566
4566
|
if (this.next(), a.argument = this.parseMaybeUnary(null, !0), this.checkExpressionErrors(e, !0), this.state.strict && n) {
|
|
@@ -4572,7 +4572,7 @@ var Ut = class extends jt {
|
|
|
4572
4572
|
let o = this.parseUpdate(a, i, e);
|
|
4573
4573
|
if (r) {
|
|
4574
4574
|
let { type: e } = this.state;
|
|
4575
|
-
if ((this.hasPlugin("v8intrinsic") ?
|
|
4575
|
+
if ((this.hasPlugin("v8intrinsic") ? O(e) : O(e) && !this.match(50)) && !this.isAmbiguousPrefixOrIdentifier()) return this.raiseOverwrite(g.AwaitNotInAsyncContext, n), this.parseAwait(n);
|
|
4576
4576
|
}
|
|
4577
4577
|
return o;
|
|
4578
4578
|
}
|
|
@@ -4583,7 +4583,7 @@ var Ut = class extends jt {
|
|
|
4583
4583
|
}
|
|
4584
4584
|
let r = this.state.startLoc, i = this.parseExprSubscripts(n);
|
|
4585
4585
|
if (this.checkExpressionErrors(n, !1)) return i;
|
|
4586
|
-
for (;
|
|
4586
|
+
for (; Ce(this.state.type) && !this.canInsertSemicolon();) {
|
|
4587
4587
|
let e = this.startNodeAt(r);
|
|
4588
4588
|
e.operator = this.state.value, e.prefix = !1, e.argument = i, this.next(), this.checkLVal(i, i = this.finishNode(e, "UpdateExpression"));
|
|
4589
4589
|
}
|
|
@@ -4609,7 +4609,7 @@ var Ut = class extends jt {
|
|
|
4609
4609
|
parseSubscript(e, t, n, r) {
|
|
4610
4610
|
let { type: i } = this.state;
|
|
4611
4611
|
if (!n && i === 11) return this.parseBind(e, t, r);
|
|
4612
|
-
if (
|
|
4612
|
+
if (ke(i)) return this.parseTaggedTemplateExpression(e, t, r);
|
|
4613
4613
|
let a = !1;
|
|
4614
4614
|
if (i === 14) {
|
|
4615
4615
|
if (n && (this.raise(g.OptionalChainingNoNew, this.state.startLoc), this.lookaheadCharCode() === 40)) return this.stopParseSubscript(e, r);
|
|
@@ -4641,7 +4641,7 @@ var Ut = class extends jt {
|
|
|
4641
4641
|
let a = this.startNodeAt(t);
|
|
4642
4642
|
a.callee = e;
|
|
4643
4643
|
let { maybeAsyncArrow: o, optionalChainMember: s } = n;
|
|
4644
|
-
o && (this.expressionScope.enter(
|
|
4644
|
+
o && (this.expressionScope.enter(Bt()), i = new Gt()), s && (a.optional = r), a.arguments = r ? this.parseCallExpressionArguments() : this.parseCallExpressionArguments(e.type !== "Super", a, i);
|
|
4645
4645
|
let c = this.finishCallExpression(a, s);
|
|
4646
4646
|
return o && this.shouldParseAsyncArrow() && !r ? (n.stop = !0, this.checkDestructuringPrivate(i), this.expressionScope.validateAsPattern(), this.expressionScope.exit(), c = this.parseAsyncArrowFromCallExpression(this.startNodeAt(t), c)) : (o && (this.checkExpressionErrors(i, !0), this.expressionScope.exit()), this.toReferencedList(a.arguments)), c;
|
|
4647
4647
|
}
|
|
@@ -4675,7 +4675,7 @@ var Ut = class extends jt {
|
|
|
4675
4675
|
return this.match(15) && !this.canInsertSemicolon();
|
|
4676
4676
|
}
|
|
4677
4677
|
parseAsyncArrowFromCallExpression(e, t) {
|
|
4678
|
-
return this.resetPreviousNodeTrailingComments(t), this.expect(15), this.parseArrowExpression(e, t.arguments, !0, t.extra?.trailingCommaLoc), t.innerComments &&
|
|
4678
|
+
return this.resetPreviousNodeTrailingComments(t), this.expect(15), this.parseArrowExpression(e, t.arguments, !0, t.extra?.trailingCommaLoc), t.innerComments && R(e, t.innerComments), t.callee.trailingComments && R(e, t.callee.trailingComments), e;
|
|
4679
4679
|
}
|
|
4680
4680
|
parseNoCallExpr() {
|
|
4681
4681
|
let e = this.state.startLoc;
|
|
@@ -4725,20 +4725,20 @@ var Ut = class extends jt {
|
|
|
4725
4725
|
}
|
|
4726
4726
|
case 43: {
|
|
4727
4727
|
let e = this.input.codePointAt(this.nextTokenStart());
|
|
4728
|
-
throw
|
|
4728
|
+
throw j(e) || e === 62 ? this.expectOnePlugin([
|
|
4729
4729
|
"jsx",
|
|
4730
4730
|
"flow",
|
|
4731
4731
|
"typescript"
|
|
4732
4732
|
]) : this.unexpected();
|
|
4733
4733
|
}
|
|
4734
4734
|
default:
|
|
4735
|
-
if (
|
|
4735
|
+
if (E(r)) {
|
|
4736
4736
|
if (this.isContextual(123) && this.lookaheadInLineCharCode() === 123) return this.parseModuleExpression();
|
|
4737
4737
|
let { canStartArrow: e, containsEsc: t } = this.state, n = this.parseIdentifier();
|
|
4738
4738
|
if (!t && n.name === "async" && !this.canInsertSemicolon()) {
|
|
4739
4739
|
let { type: t } = this.state;
|
|
4740
4740
|
if (t === 64) return this.resetPreviousNodeTrailingComments(n), this.next(), this.parseAsyncFunctionExpression(this.startNodeAtNode(n));
|
|
4741
|
-
if (
|
|
4741
|
+
if (E(t)) return e && this.lookaheadCharCode() === 61 ? this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(n)) : n;
|
|
4742
4742
|
if (t === 86) return this.resetPreviousNodeTrailingComments(n), this.parseDo(this.startNodeAtNode(n), !0);
|
|
4743
4743
|
}
|
|
4744
4744
|
return e && this.match(15) && !this.canInsertSemicolon() ? (this.next(), this.parseArrowExpression(this.startNodeAtNode(n), [n], !1)) : n;
|
|
@@ -4757,16 +4757,16 @@ var Ut = class extends jt {
|
|
|
4757
4757
|
}
|
|
4758
4758
|
finishTopicReference(e, t, n, r) {
|
|
4759
4759
|
if (this.testTopicReferenceConfiguration(n, t, r)) return this.topicReferenceIsAllowedInCurrentContext() || this.raise(g.PipeTopicUnbound, t), this.registerTopicReference(), this.finishNode(e, "TopicReference");
|
|
4760
|
-
throw this.raise(g.PipeTopicUnconfiguredToken, t, { token:
|
|
4760
|
+
throw this.raise(g.PipeTopicUnconfiguredToken, t, { token: k(r) });
|
|
4761
4761
|
}
|
|
4762
4762
|
testTopicReferenceConfiguration(e, t, n) {
|
|
4763
4763
|
switch (e) {
|
|
4764
|
-
case "hack": return this.hasPlugin(["pipelineOperator", { topicToken:
|
|
4764
|
+
case "hack": return this.hasPlugin(["pipelineOperator", { topicToken: k(n) }]);
|
|
4765
4765
|
default: throw this.raise(g.PipeTopicRequiresHackPipes, t);
|
|
4766
4766
|
}
|
|
4767
4767
|
}
|
|
4768
4768
|
parseAsyncArrowUnaryFunction(e) {
|
|
4769
|
-
this.prodParam.enter(
|
|
4769
|
+
this.prodParam.enter(Ut(!0, this.prodParam.hasYield));
|
|
4770
4770
|
let t = [this.parseIdentifier()];
|
|
4771
4771
|
return this.prodParam.exit(), this.hasPrecedingLineBreak() && this.raise(g.LineTerminatorBeforeArrow, this.state.curPosition()), this.expect(15), this.parseArrowExpression(e, t, !0);
|
|
4772
4772
|
}
|
|
@@ -4845,8 +4845,8 @@ var Ut = class extends jt {
|
|
|
4845
4845
|
}
|
|
4846
4846
|
parseParenAndDistinguishExpression(e) {
|
|
4847
4847
|
let t = this.state.startLoc, n;
|
|
4848
|
-
this.next(), this.expressionScope.enter(
|
|
4849
|
-
let r = this.state.startLoc, i = [], a = new
|
|
4848
|
+
this.next(), this.expressionScope.enter(zt());
|
|
4849
|
+
let r = this.state.startLoc, i = [], a = new Gt(), o = !0, s, c;
|
|
4850
4850
|
for (; !this.match(7);) {
|
|
4851
4851
|
if (o) o = !1;
|
|
4852
4852
|
else if (this.expect(8, a.optionalParametersLoc === null ? null : a.optionalParametersLoc), this.match(7)) {
|
|
@@ -4992,7 +4992,7 @@ var Ut = class extends jt {
|
|
|
4992
4992
|
if (this.eat(0)) e.computed = !0, e.key = this.parseMaybeAssignAllowIn(), this.expect(1);
|
|
4993
4993
|
else {
|
|
4994
4994
|
let { type: n, value: r } = this.state, i;
|
|
4995
|
-
if (
|
|
4995
|
+
if (D(n)) i = this.parseIdentifier(!0);
|
|
4996
4996
|
else switch (n) {
|
|
4997
4997
|
case 131:
|
|
4998
4998
|
i = this.parseNumericLiteral(r);
|
|
@@ -5017,7 +5017,7 @@ var Ut = class extends jt {
|
|
|
5017
5017
|
e.id = null, e.generator = !1, e.async = t;
|
|
5018
5018
|
}
|
|
5019
5019
|
parseMethod(e, t, n, r, i, a, o = !1) {
|
|
5020
|
-
this.initFunction(e, n), e.generator = t, this.scope.enter(530 | (o ? 576 : 0) | (i ? 32 : 0)), this.prodParam.enter(
|
|
5020
|
+
this.initFunction(e, n), e.generator = t, this.scope.enter(530 | (o ? 576 : 0) | (i ? 32 : 0)), this.prodParam.enter(Ut(n, e.generator)), this.parseFunctionParams(e, r);
|
|
5021
5021
|
let s = this.parseFunctionBodyAndFinish(e, a, !0);
|
|
5022
5022
|
return this.prodParam.exit(), this.scope.exit(), s;
|
|
5023
5023
|
}
|
|
@@ -5027,7 +5027,7 @@ var Ut = class extends jt {
|
|
|
5027
5027
|
}
|
|
5028
5028
|
parseArrowExpression(e, t, n, r) {
|
|
5029
5029
|
this.scope.enter(518);
|
|
5030
|
-
let i =
|
|
5030
|
+
let i = Ut(n, !1);
|
|
5031
5031
|
return this.match(2) || (i |= this.prodParam.currentFlags() & 24), this.prodParam.enter(i), this.initFunction(e, n), t && this.setArrowFunctionParameters(e, t, r), this.parseFunctionBody(e, !0), this.prodParam.exit(), this.scope.exit(), this.finishNode(e, "ArrowFunctionExpression");
|
|
5032
5032
|
}
|
|
5033
5033
|
setArrowFunctionParameters(e, t, n) {
|
|
@@ -5038,7 +5038,7 @@ var Ut = class extends jt {
|
|
|
5038
5038
|
}
|
|
5039
5039
|
parseFunctionBody(e, t, n = !1) {
|
|
5040
5040
|
let r = t && !this.match(2);
|
|
5041
|
-
if (this.expressionScope.enter(
|
|
5041
|
+
if (this.expressionScope.enter(Vt()), r) e.body = this.parseMaybeAssign(), this.checkParams(e, !1, t, !1);
|
|
5042
5042
|
else {
|
|
5043
5043
|
let r = this.state.strict, i = this.state.labels;
|
|
5044
5044
|
this.state.labels = [], this.prodParam.enter(this.prodParam.currentFlags() | 4), e.body = this.parseBlock(!0, !1, (i) => {
|
|
@@ -5098,17 +5098,17 @@ var Ut = class extends jt {
|
|
|
5098
5098
|
}
|
|
5099
5099
|
parseIdentifierName(e) {
|
|
5100
5100
|
let t, { start: n, type: r } = this.state;
|
|
5101
|
-
|
|
5102
|
-
let i =
|
|
5101
|
+
D(r) ? t = this.state.value : this.unexpected();
|
|
5102
|
+
let i = he(r);
|
|
5103
5103
|
return e ? i && this.replaceToken(128) : this.checkReservedWord(t, this.sourceToOffsetPos(n), i, !1), this.next(), t;
|
|
5104
5104
|
}
|
|
5105
5105
|
checkReservedWord(e, t, n, r) {
|
|
5106
|
-
if (!(e.length > 10) &&
|
|
5107
|
-
if (n &&
|
|
5106
|
+
if (!(e.length > 10) && Je(e)) {
|
|
5107
|
+
if (n && Ge(e)) {
|
|
5108
5108
|
this.raise(g.UnexpectedKeyword, t, { keyword: e });
|
|
5109
5109
|
return;
|
|
5110
5110
|
}
|
|
5111
|
-
if ((this.state.strict ? r ?
|
|
5111
|
+
if ((this.state.strict ? r ? We : He : Ve)(e, this.inModule)) {
|
|
5112
5112
|
this.raise(g.UnexpectedReservedWord, t, { reservedWord: e });
|
|
5113
5113
|
return;
|
|
5114
5114
|
}
|
|
@@ -5146,7 +5146,7 @@ var Ut = class extends jt {
|
|
|
5146
5146
|
isAmbiguousPrefixOrIdentifier() {
|
|
5147
5147
|
if (this.hasPrecedingLineBreak()) return !0;
|
|
5148
5148
|
let { type: e } = this.state;
|
|
5149
|
-
return e === 49 || e === 6 || e === 0 ||
|
|
5149
|
+
return e === 49 || e === 6 || e === 0 || ke(e) || e === 98 && !this.state.containsEsc || e === 133 || e === 52 || this.hasPlugin("v8intrinsic") && e === 50;
|
|
5150
5150
|
}
|
|
5151
5151
|
parseYield(e) {
|
|
5152
5152
|
this.setLoc(e);
|
|
@@ -5224,7 +5224,7 @@ var Ut = class extends jt {
|
|
|
5224
5224
|
if (this.isContextual(92) && this.recordAwaitIfAllowed()) {
|
|
5225
5225
|
this.next(), n = this.parseAwait(t, !0);
|
|
5226
5226
|
let e = this.state.type;
|
|
5227
|
-
|
|
5227
|
+
Se(e) && e !== 35 && (this.prodParam.hasIn || e !== 54) && this.raise(g.PipelineUnparenthesized, t);
|
|
5228
5228
|
} else this.state.canStartArrow = !0, n = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), t, e);
|
|
5229
5229
|
return this.prodParam.exit(), n;
|
|
5230
5230
|
}
|
|
@@ -5256,17 +5256,17 @@ var Ut = class extends jt {
|
|
|
5256
5256
|
return this.parseMaybeAssignAllowIn(t, n);
|
|
5257
5257
|
}
|
|
5258
5258
|
parsePropertyNamePrefixOperator(e) {}
|
|
5259
|
-
},
|
|
5260
|
-
function
|
|
5259
|
+
}, Zt = { kind: 1 }, Qt = { kind: 2 }, $t = /[\uD800-\uDFFF]/u, en = /in(?:stanceof)?/y;
|
|
5260
|
+
function tn(e) {
|
|
5261
5261
|
for (let t = 0; t < e.length; t++) {
|
|
5262
5262
|
let n = e[t], { type: r } = n;
|
|
5263
|
-
typeof r == "number" && (n.type =
|
|
5263
|
+
typeof r == "number" && (n.type = Ae(r));
|
|
5264
5264
|
}
|
|
5265
5265
|
return e;
|
|
5266
5266
|
}
|
|
5267
|
-
var
|
|
5267
|
+
var nn = class extends Xt {
|
|
5268
5268
|
parseTopLevel(e, t) {
|
|
5269
|
-
return e.program = this.parseProgram(t, 135, this.options.sourceType === "module" ? "module" : "script"), e.comments = this.comments, this.optionFlags & 512 && (e.tokens =
|
|
5269
|
+
return e.program = this.parseProgram(t, 135, this.options.sourceType === "module" ? "module" : "script"), e.comments = this.comments, this.optionFlags & 512 && (e.tokens = tn(this.tokens)), this.finishNode(e, "File");
|
|
5270
5270
|
}
|
|
5271
5271
|
parseProgram(e, t, r) {
|
|
5272
5272
|
if (e.sourceType = r, e.interpreter = this.parseInterpreterDirective(), this.parseBlockBody(e, !0, !0, t), this.inModule) {
|
|
@@ -5315,10 +5315,10 @@ var tn = class extends Yt {
|
|
|
5315
5315
|
return !1;
|
|
5316
5316
|
}
|
|
5317
5317
|
chStartsBindingIdentifier(e, t) {
|
|
5318
|
-
if (
|
|
5319
|
-
if (
|
|
5320
|
-
let e = this.codePointAtPos(
|
|
5321
|
-
if (!
|
|
5318
|
+
if (j(e)) {
|
|
5319
|
+
if (en.lastIndex = t, en.test(this.input)) {
|
|
5320
|
+
let e = this.codePointAtPos(en.lastIndex);
|
|
5321
|
+
if (!M(e) && e !== 92) return !1;
|
|
5322
5322
|
}
|
|
5323
5323
|
return !0;
|
|
5324
5324
|
}
|
|
@@ -5404,7 +5404,7 @@ var tn = class extends Yt {
|
|
|
5404
5404
|
default: if (this.isAsyncFunction()) return i || this.raise(g.AsyncFunctionInSingleStatementContext, this.state.startLoc), this.next(), this.parseFunctionStatement(r, !0, !i && a);
|
|
5405
5405
|
}
|
|
5406
5406
|
let s = this.state.value, c = this.parseExpression();
|
|
5407
|
-
return
|
|
5407
|
+
return E(n) && c.type === "Identifier" && this.eat(10) ? this.parseLabeledStatement(r, s, c, e) : this.parseExpressionStatement(r, c, t);
|
|
5408
5408
|
}
|
|
5409
5409
|
assertModuleNodeAllowed(e) {
|
|
5410
5410
|
!(this.optionFlags & 8) && !this.inModule && this.raise(g.ImportOutsideModule, e);
|
|
@@ -5474,10 +5474,10 @@ var tn = class extends Yt {
|
|
|
5474
5474
|
return this.expect(7), e;
|
|
5475
5475
|
}
|
|
5476
5476
|
parseDoWhileStatement(e) {
|
|
5477
|
-
return this.next(), this.state.labels.push(
|
|
5477
|
+
return this.next(), this.state.labels.push(Zt), e.body = this.parseStatement(), this.state.labels.pop(), this.expect(88), e.test = this.parseHeaderExpression(), this.eat(9), this.finishNode(e, "DoWhileStatement");
|
|
5478
5478
|
}
|
|
5479
5479
|
parseForStatement(e) {
|
|
5480
|
-
this.next(), this.state.labels.push(
|
|
5480
|
+
this.next(), this.state.labels.push(Zt);
|
|
5481
5481
|
let t = null;
|
|
5482
5482
|
if (this.isContextual(92) && this.recordAwaitIfAllowed() && (t = this.state.startLoc, this.next()), this.scope.enter(0), this.expect(6), this.match(9)) return t !== null && this.unexpected(t), this.parseFor(e, null);
|
|
5483
5483
|
let n = this.isContextual(96);
|
|
@@ -5490,7 +5490,7 @@ var tn = class extends Yt {
|
|
|
5490
5490
|
return s && i && this.raise(g.ForInUsing, o), (s || this.isContextual(98)) && o.declarations.length === 1 ? this.parseForIn(e, o, t) : (t !== null && this.unexpected(t), this.parseFor(e, o));
|
|
5491
5491
|
}
|
|
5492
5492
|
}
|
|
5493
|
-
let r = this.isContextual(91), i = new
|
|
5493
|
+
let r = this.isContextual(91), i = new Gt(), a = this.parseExpression(!0, i), o = this.isContextual(98);
|
|
5494
5494
|
if (o && (n && this.raise(g.ForOfLet, a), t === null && r && a.type === "Identifier" && this.raise(g.ForOfAsync, a)), o || this.match(54)) {
|
|
5495
5495
|
this.checkDestructuringPrivate(i), this.toAssignable(a, !0);
|
|
5496
5496
|
let n = o ? "ForOfStatement" : "ForInStatement";
|
|
@@ -5510,7 +5510,7 @@ var tn = class extends Yt {
|
|
|
5510
5510
|
parseSwitchStatement(e) {
|
|
5511
5511
|
this.next(), e.discriminant = this.parseHeaderExpression();
|
|
5512
5512
|
let t = e.cases = [];
|
|
5513
|
-
this.expect(2), this.state.labels.push(
|
|
5513
|
+
this.expect(2), this.state.labels.push(Qt), this.scope.enter(256);
|
|
5514
5514
|
let n;
|
|
5515
5515
|
for (let e; !this.match(4);) if (this.match(57) || this.match(61)) {
|
|
5516
5516
|
let r = this.match(57);
|
|
@@ -5536,7 +5536,7 @@ var tn = class extends Yt {
|
|
|
5536
5536
|
return this.next(), this.parseVar(e, !1, t, n), this.semicolon(), this.finishNode(e, "VariableDeclaration");
|
|
5537
5537
|
}
|
|
5538
5538
|
parseWhileStatement(e) {
|
|
5539
|
-
return this.next(), e.test = this.parseHeaderExpression(), this.state.labels.push(
|
|
5539
|
+
return this.next(), e.test = this.parseHeaderExpression(), this.state.labels.push(Zt), e.body = this.parseStatement(), this.state.labels.pop(), this.finishNode(e, "WhileStatement");
|
|
5540
5540
|
}
|
|
5541
5541
|
parseWithStatement(e) {
|
|
5542
5542
|
return this.state.strict && this.raise(g.StrictWith, this.state.startLoc), this.next(), e.object = this.parseHeaderExpression(), e.body = this.parseStatement(), this.finishNode(e, "WithStatement");
|
|
@@ -5546,7 +5546,7 @@ var tn = class extends Yt {
|
|
|
5546
5546
|
}
|
|
5547
5547
|
parseLabeledStatement(e, t, n, r) {
|
|
5548
5548
|
for (let e of this.state.labels) e.name === t && this.raise(g.LabelRedeclaration, n, { labelName: t });
|
|
5549
|
-
let i =
|
|
5549
|
+
let i = be(this.state.type) ? 1 : this.match(67) ? 2 : null;
|
|
5550
5550
|
for (let t = this.state.labels.length - 1; t >= 0; t--) {
|
|
5551
5551
|
let n = this.state.labels[t];
|
|
5552
5552
|
if (n.statementStart === e.start) n.statementStart = this.sourceToOffsetPos(this.state.start), n.kind = i;
|
|
@@ -5612,13 +5612,13 @@ var tn = class extends Yt {
|
|
|
5612
5612
|
}
|
|
5613
5613
|
parseFunction(e, t = 0) {
|
|
5614
5614
|
let n = t & 2, r = !!(t & 1), i = r && !(t & 4), a = !!(t & 8);
|
|
5615
|
-
return this.initFunction(e, a), this.match(51) && (n && this.raise(g.GeneratorInSingleStatementContext, this.state.startLoc), this.next(), e.generator = !0), r && (e.id = this.parseFunctionId(i)), this.scope.enter(514), this.prodParam.enter(
|
|
5615
|
+
return this.initFunction(e, a), this.match(51) && (n && this.raise(g.GeneratorInSingleStatementContext, this.state.startLoc), this.next(), e.generator = !0), r && (e.id = this.parseFunctionId(i)), this.scope.enter(514), this.prodParam.enter(Ut(a, e.generator)), r || (e.id = this.parseFunctionId()), this.parseFunctionParams(e, !1), this.parseFunctionBodyAndFinish(e, r ? "FunctionDeclaration" : "FunctionExpression"), this.prodParam.exit(), this.scope.exit(), r && !n && this.registerFunctionStatementId(e), e;
|
|
5616
5616
|
}
|
|
5617
5617
|
parseFunctionId(e) {
|
|
5618
|
-
return e ||
|
|
5618
|
+
return e || E(this.state.type) ? this.parseIdentifier() : null;
|
|
5619
5619
|
}
|
|
5620
5620
|
parseFunctionParams(e, t) {
|
|
5621
|
-
this.expect(6), this.expressionScope.enter(
|
|
5621
|
+
this.expect(6), this.expressionScope.enter(Rt()), e.params = this.parseBindingList(7, 41, 2 | (t ? 4 : 0)), this.expressionScope.exit();
|
|
5622
5622
|
}
|
|
5623
5623
|
registerFunctionStatementId(e) {
|
|
5624
5624
|
e.id && this.scope.declareName(e.id.name, !this.options.annexB || this.state.strict || e.generator || e.async ? this.scope.treatFunctionsAsVar ? 5 : 8201 : 17, e.id.start);
|
|
@@ -5696,7 +5696,7 @@ var tn = class extends Yt {
|
|
|
5696
5696
|
this.isNonstaticConstructor(i) && this.raise(g.ConstructorIsGenerator, i.key), this.pushClassMethod(e, i, !0, !1, !1, !1);
|
|
5697
5697
|
return;
|
|
5698
5698
|
}
|
|
5699
|
-
let d = !this.state.containsEsc &&
|
|
5699
|
+
let d = !this.state.containsEsc && E(this.state.type), f = this.parseClassElementName(t), p = d ? f.name : null, m = this.isPrivateName(f), h = this.state.startLoc;
|
|
5700
5700
|
if (this.parsePostMemberNameModifiers(u), this.isClassMethod()) {
|
|
5701
5701
|
if (l.kind = "method", m) {
|
|
5702
5702
|
this.pushClassPrivateMethod(e, a, !1, !1);
|
|
@@ -5772,10 +5772,10 @@ var tn = class extends Yt {
|
|
|
5772
5772
|
return this.parseInitializer(e), this.semicolon(), this.finishNode(e, "ClassAccessorProperty");
|
|
5773
5773
|
}
|
|
5774
5774
|
parseInitializer(e) {
|
|
5775
|
-
this.scope.enter(592), this.expressionScope.enter(
|
|
5775
|
+
this.scope.enter(592), this.expressionScope.enter(Vt()), this.prodParam.enter(0), e.value = this.eat(25) ? this.parseMaybeAssignAllowIn() : null, this.expressionScope.exit(), this.prodParam.exit(), this.scope.exit();
|
|
5776
5776
|
}
|
|
5777
5777
|
parseClassId(e, t, n, r = 8331) {
|
|
5778
|
-
if (
|
|
5778
|
+
if (E(this.state.type)) e.id = this.parseIdentifier(), t && this.declareNameFromIdentifier(e.id, r);
|
|
5779
5779
|
else if (n || !t) e.id = null;
|
|
5780
5780
|
else throw this.raise(g.MissingClassName, this.state.startLoc);
|
|
5781
5781
|
}
|
|
@@ -5860,7 +5860,7 @@ var tn = class extends Yt {
|
|
|
5860
5860
|
}
|
|
5861
5861
|
isExportDefaultSpecifier() {
|
|
5862
5862
|
let { type: e } = this.state;
|
|
5863
|
-
if (
|
|
5863
|
+
if (E(e)) {
|
|
5864
5864
|
if (e === 91 && !this.state.containsEsc || e === 96) return !1;
|
|
5865
5865
|
if ((e === 126 || e === 125) && !this.state.containsEsc) {
|
|
5866
5866
|
let e = this.nextTokenStart(), t = this.input.charCodeAt(e);
|
|
@@ -5868,7 +5868,7 @@ var tn = class extends Yt {
|
|
|
5868
5868
|
}
|
|
5869
5869
|
} else if (!this.match(61)) return !1;
|
|
5870
5870
|
let t = this.nextTokenStart(), n = this.isUnparsedContextual(t, "from");
|
|
5871
|
-
if (this.input.charCodeAt(t) === 44 ||
|
|
5871
|
+
if (this.input.charCodeAt(t) === 44 || E(this.state.type) && n) return !0;
|
|
5872
5872
|
if (this.match(61) && n) {
|
|
5873
5873
|
let e = this.input.charCodeAt(this.nextTokenStartSince(t + 4));
|
|
5874
5874
|
return e === 34 || e === 39;
|
|
@@ -5933,7 +5933,7 @@ var tn = class extends Yt {
|
|
|
5933
5933
|
}
|
|
5934
5934
|
parseModuleExportName() {
|
|
5935
5935
|
if (this.match(130)) {
|
|
5936
|
-
let e = this.parseStringLiteral(this.state.value), t =
|
|
5936
|
+
let e = this.parseStringLiteral(this.state.value), t = $t.exec(e.value);
|
|
5937
5937
|
return t && this.raise(g.ModuleExportNameHasLoneSurrogate, e, { surrogateCharCode: t[0].charCodeAt(0) }), e;
|
|
5938
5938
|
}
|
|
5939
5939
|
return this.parseIdentifier(!0);
|
|
@@ -5951,11 +5951,11 @@ var tn = class extends Yt {
|
|
|
5951
5951
|
parseMaybeImportPhase(e, t) {
|
|
5952
5952
|
if (!this.isPotentialImportPhase(t)) return this.applyImportPhase(e, t, null), null;
|
|
5953
5953
|
let n = this.startNode(), r = this.parseIdentifierName(!0), { type: i } = this.state;
|
|
5954
|
-
return (
|
|
5954
|
+
return (D(i) ? i !== 94 || this.lookaheadCharCode() === 102 : i !== 8) ? (this.applyImportPhase(e, t, r, n.start), null) : (this.applyImportPhase(e, t, null), this.createIdentifier(n, r));
|
|
5955
5955
|
}
|
|
5956
5956
|
isPrecedingIdImportPhase(e) {
|
|
5957
5957
|
let { type: t } = this.state;
|
|
5958
|
-
return
|
|
5958
|
+
return E(t) ? t !== 94 || this.lookaheadCharCode() === 102 : t !== 8;
|
|
5959
5959
|
}
|
|
5960
5960
|
parseImport(e) {
|
|
5961
5961
|
return this.match(130) ? this.parseImportSourceAndAttributes(e) : this.parseImportSpecifiersAndAfter(e, this.parseMaybeImportPhase(e, !1));
|
|
@@ -6001,7 +6001,7 @@ var tn = class extends Yt {
|
|
|
6001
6001
|
let n = this.startNodeAtNode(t);
|
|
6002
6002
|
return n.local = t, e.specifiers.push(this.finishImportSpecifier(n, "ImportDefaultSpecifier")), !0;
|
|
6003
6003
|
}
|
|
6004
|
-
return
|
|
6004
|
+
return D(this.state.type) ? (this.parseImportSpecifierLocal(e, this.startNode(), "ImportDefaultSpecifier"), !0) : !1;
|
|
6005
6005
|
}
|
|
6006
6006
|
maybeParseStarImportSpecifier(e) {
|
|
6007
6007
|
if (this.match(51)) {
|
|
@@ -6036,15 +6036,15 @@ var tn = class extends Yt {
|
|
|
6036
6036
|
isThisParam(e) {
|
|
6037
6037
|
return e.type === "Identifier" && e.name === "this";
|
|
6038
6038
|
}
|
|
6039
|
-
},
|
|
6040
|
-
function
|
|
6039
|
+
}, rn = /in(?:stanceof)?|as|satisfies/y;
|
|
6040
|
+
function an(e) {
|
|
6041
6041
|
if (e == null) throw Error(`Unexpected ${e} value.`);
|
|
6042
6042
|
return e;
|
|
6043
6043
|
}
|
|
6044
|
-
function
|
|
6044
|
+
function on(e) {
|
|
6045
6045
|
if (!e) throw Error("Assert fail");
|
|
6046
6046
|
}
|
|
6047
|
-
var
|
|
6047
|
+
var H = h`typescript`({
|
|
6048
6048
|
AbstractMethodHasImplementation: ({ methodName: e }) => `Method '${e}' cannot have an implementation because it is marked abstract.`,
|
|
6049
6049
|
AbstractPropertyHasInitializer: ({ propertyName: e }) => `Property '${e}' cannot have an initializer because it is marked abstract.`,
|
|
6050
6050
|
AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.",
|
|
@@ -6122,7 +6122,7 @@ var U = h`typescript`({
|
|
|
6122
6122
|
UnsupportedSignatureParameterKind: ({ type: e }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,
|
|
6123
6123
|
UsingDeclarationInAmbientContext: (e) => `'${e}' declarations are not allowed in ambient contexts.`
|
|
6124
6124
|
});
|
|
6125
|
-
function
|
|
6125
|
+
function sn(e) {
|
|
6126
6126
|
switch (e) {
|
|
6127
6127
|
case "any": return "TSAnyKeyword";
|
|
6128
6128
|
case "boolean": return "TSBooleanKeyword";
|
|
@@ -6137,27 +6137,27 @@ function on(e) {
|
|
|
6137
6137
|
default: return;
|
|
6138
6138
|
}
|
|
6139
6139
|
}
|
|
6140
|
-
function
|
|
6140
|
+
function cn(e) {
|
|
6141
6141
|
return e === "private" || e === "public" || e === "protected";
|
|
6142
6142
|
}
|
|
6143
|
-
function
|
|
6143
|
+
function ln(e) {
|
|
6144
6144
|
return e === "in" || e === "out";
|
|
6145
6145
|
}
|
|
6146
|
-
function
|
|
6146
|
+
function un(e) {
|
|
6147
6147
|
if (e.extra?.parenthesized) return !1;
|
|
6148
6148
|
switch (e.type) {
|
|
6149
6149
|
case "Identifier": return !0;
|
|
6150
|
-
case "MemberExpression": return !e.computed &&
|
|
6151
|
-
case "TSInstantiationExpression": return
|
|
6150
|
+
case "MemberExpression": return !e.computed && un(e.object);
|
|
6151
|
+
case "TSInstantiationExpression": return un(e.expression);
|
|
6152
6152
|
default: return !1;
|
|
6153
6153
|
}
|
|
6154
6154
|
}
|
|
6155
|
-
var
|
|
6155
|
+
var dn = (e) => class extends e {
|
|
6156
6156
|
getScopeHandler() {
|
|
6157
|
-
return
|
|
6157
|
+
return mt;
|
|
6158
6158
|
}
|
|
6159
6159
|
tsIsIdentifier() {
|
|
6160
|
-
return
|
|
6160
|
+
return E(this.state.type);
|
|
6161
6161
|
}
|
|
6162
6162
|
tsTokenCanFollowModifier() {
|
|
6163
6163
|
return this.match(0) || this.match(2) || this.match(51) || this.match(17) || this.match(134) || this.isLiteralPropertyName();
|
|
@@ -6169,23 +6169,23 @@ var un = (e) => class extends e {
|
|
|
6169
6169
|
return this.match(102) ? (this.next(), this.tsTokenCanFollowModifier()) : this.tsNextTokenOnSameLineAndCanFollowModifier();
|
|
6170
6170
|
}
|
|
6171
6171
|
tsParseModifier(e, t, n) {
|
|
6172
|
-
if (!
|
|
6172
|
+
if (!E(this.state.type) && this.state.type !== 54 && this.state.type !== 71) return;
|
|
6173
6173
|
let r = this.state.value;
|
|
6174
6174
|
if (e.includes(r)) {
|
|
6175
6175
|
if (n && this.match(102) || t && this.tsIsStartOfStaticBlocks()) return;
|
|
6176
6176
|
if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) return r;
|
|
6177
6177
|
}
|
|
6178
6178
|
}
|
|
6179
|
-
tsParseModifiers({ allowedModifiers: e, disallowedModifiers: t, stopOnStartOfClassStaticBlock: n, errorTemplate: r =
|
|
6179
|
+
tsParseModifiers({ allowedModifiers: e, disallowedModifiers: t, stopOnStartOfClassStaticBlock: n, errorTemplate: r = H.InvalidModifierOnTypeMember }, i) {
|
|
6180
6180
|
let a = (e, t, n, r) => {
|
|
6181
|
-
t === n && i[r] && this.raise(
|
|
6181
|
+
t === n && i[r] && this.raise(H.InvalidModifiersOrder, e, { orderedModifiers: [n, r] });
|
|
6182
6182
|
}, o = (e, t, n, r) => {
|
|
6183
|
-
(i[n] && t === r || i[r] && t === n) && this.raise(
|
|
6183
|
+
(i[n] && t === r || i[r] && t === n) && this.raise(H.IncompatibleModifiers, e, { modifiers: [n, r] });
|
|
6184
6184
|
};
|
|
6185
6185
|
for (;;) {
|
|
6186
6186
|
let { startLoc: s } = this.state, c = this.tsParseModifier(e.concat(t ?? []), n, i.static);
|
|
6187
6187
|
if (!c) break;
|
|
6188
|
-
|
|
6188
|
+
cn(c) ? i.accessibility ? this.raise(H.DuplicateAccessibilityModifier, s, { modifier: c }) : (a(s, c, c, "override"), a(s, c, c, "static"), a(s, c, c, "readonly"), i.accessibility = c) : ln(c) ? (i[c] && this.raise(H.DuplicateModifier, s, { modifier: c }), i[c] = !0, a(s, c, "in", "out")) : (Object.hasOwn(i, c) ? this.raise(H.DuplicateModifier, s, { modifier: c }) : (a(s, c, "static", "readonly"), a(s, c, "static", "override"), a(s, c, "override", "readonly"), a(s, c, "abstract", "override"), o(s, c, "declare", "override"), o(s, c, "static", "abstract")), i[c] = !0), t?.includes(c) && this.raise(r, s, { modifier: c });
|
|
6189
6189
|
}
|
|
6190
6190
|
}
|
|
6191
6191
|
tsIsListTerminator(e) {
|
|
@@ -6203,7 +6203,7 @@ var un = (e) => class extends e {
|
|
|
6203
6203
|
return n;
|
|
6204
6204
|
}
|
|
6205
6205
|
tsParseDelimitedList(e, t, n) {
|
|
6206
|
-
return
|
|
6206
|
+
return an(this.tsParseDelimitedListWorker(e, t, !0, n));
|
|
6207
6207
|
}
|
|
6208
6208
|
tsParseDelimitedListWorker(e, t, n, r) {
|
|
6209
6209
|
let i = [], a = -1;
|
|
@@ -6228,7 +6228,7 @@ var un = (e) => class extends e {
|
|
|
6228
6228
|
}
|
|
6229
6229
|
tsParseImportType() {
|
|
6230
6230
|
let e = this.startNode();
|
|
6231
|
-
return this.expect(79), this.expect(6), this.match(130) ? e.source = this.parseStringLiteral(this.state.value) : (this.raise(
|
|
6231
|
+
return this.expect(79), this.expect(6), this.match(130) ? e.source = this.parseStringLiteral(this.state.value) : (this.raise(H.UnsupportedImportTypeArgument, this.state.startLoc), e.source = this.tsParseNonConditionalType()), e.options = this.eat(8) ? this.tsParseImportTypeOptions() : null, this.expect(7), this.eat(12) && (e.qualifier = this.tsParseEntityName(3)), this.match(43) && (e.typeArguments = this.tsParseTypeArguments()), this.finishNode(e, "TSImportType");
|
|
6232
6232
|
}
|
|
6233
6233
|
tsParseImportTypeOptions() {
|
|
6234
6234
|
let e = this.startNode();
|
|
@@ -6240,7 +6240,7 @@ var un = (e) => class extends e {
|
|
|
6240
6240
|
let e = this.startNode(), t = [];
|
|
6241
6241
|
for (this.expect(2); !this.match(4);) {
|
|
6242
6242
|
let e = this.state.type;
|
|
6243
|
-
|
|
6243
|
+
E(e) || e === 130 ? t.push(super.parsePropertyDefinition(null)) : this.unexpected(), this.eat(8);
|
|
6244
6244
|
}
|
|
6245
6245
|
return e.properties = t, this.next(), this.finishNode(e, "ObjectExpression");
|
|
6246
6246
|
}
|
|
@@ -6288,12 +6288,12 @@ var un = (e) => class extends e {
|
|
|
6288
6288
|
"abstract",
|
|
6289
6289
|
"override"
|
|
6290
6290
|
],
|
|
6291
|
-
errorTemplate:
|
|
6291
|
+
errorTemplate: H.InvalidModifierOnTypeParameter
|
|
6292
6292
|
});
|
|
6293
6293
|
tsParseConstModifier = this.tsParseModifiers.bind(this, {
|
|
6294
6294
|
allowedModifiers: ["const"],
|
|
6295
6295
|
disallowedModifiers: ["in", "out"],
|
|
6296
|
-
errorTemplate:
|
|
6296
|
+
errorTemplate: H.InvalidModifierOnTypeParameterPositions
|
|
6297
6297
|
});
|
|
6298
6298
|
tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, {
|
|
6299
6299
|
allowedModifiers: [
|
|
@@ -6310,7 +6310,7 @@ var un = (e) => class extends e {
|
|
|
6310
6310
|
"abstract",
|
|
6311
6311
|
"override"
|
|
6312
6312
|
],
|
|
6313
|
-
errorTemplate:
|
|
6313
|
+
errorTemplate: H.InvalidModifierOnTypeParameter
|
|
6314
6314
|
});
|
|
6315
6315
|
tsParseTypeParameter(e) {
|
|
6316
6316
|
let t = this.startNode();
|
|
@@ -6323,7 +6323,7 @@ var un = (e) => class extends e {
|
|
|
6323
6323
|
let t = this.startNode();
|
|
6324
6324
|
this.match(43) || this.match(138) ? this.next() : this.unexpected();
|
|
6325
6325
|
let n = { value: -1 };
|
|
6326
|
-
return t.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, e), !1, !0, n), t.params.length === 0 && this.raise(
|
|
6326
|
+
return t.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, e), !1, !0, n), t.params.length === 0 && this.raise(H.EmptyTypeParameters, t), n.value !== -1 && this.addExtra(t, "trailingComma", n.value), this.finishNode(t, "TSTypeParameterDeclaration");
|
|
6327
6327
|
}
|
|
6328
6328
|
tsFillSignature(e, t) {
|
|
6329
6329
|
let n = e === 15;
|
|
@@ -6333,7 +6333,7 @@ var un = (e) => class extends e {
|
|
|
6333
6333
|
let e = super.parseBindingList(7, 41, 2);
|
|
6334
6334
|
for (let t of e) {
|
|
6335
6335
|
let { type: e } = t;
|
|
6336
|
-
(e === "AssignmentPattern" || e === "TSParameterProperty") && this.raise(
|
|
6336
|
+
(e === "AssignmentPattern" || e === "TSParameterProperty") && this.raise(H.UnsupportedSignatureParameterKind, t, { type: e });
|
|
6337
6337
|
}
|
|
6338
6338
|
return e;
|
|
6339
6339
|
}
|
|
@@ -6344,7 +6344,7 @@ var un = (e) => class extends e {
|
|
|
6344
6344
|
return this.tsFillSignature(10, t), this.tsParseTypeMemberSemicolon(), this.finishNode(t, e);
|
|
6345
6345
|
}
|
|
6346
6346
|
tsIsUnambiguouslyIndexSignature() {
|
|
6347
|
-
return this.next(),
|
|
6347
|
+
return this.next(), E(this.state.type) ? (this.next(), this.match(10)) : !1;
|
|
6348
6348
|
}
|
|
6349
6349
|
tsTryParseIndexSignature(e) {
|
|
6350
6350
|
if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) return;
|
|
@@ -6356,16 +6356,16 @@ var un = (e) => class extends e {
|
|
|
6356
6356
|
}
|
|
6357
6357
|
tsParsePropertyOrMethodSignature(e, t) {
|
|
6358
6358
|
if (this.eat(13) && (e.optional = !0), this.match(6) || this.match(43)) {
|
|
6359
|
-
t && this.raise(
|
|
6359
|
+
t && this.raise(H.ReadonlyForMethodSignature, e);
|
|
6360
6360
|
let n = e;
|
|
6361
|
-
if (n.kind && this.match(43) && this.raise(
|
|
6361
|
+
if (n.kind && this.match(43) && this.raise(H.AccessorCannotHaveTypeParameters, this.state.curPosition()), this.tsFillSignature(10, n), this.tsParseTypeMemberSemicolon(), n.kind === "get") n.params.length > 0 && (this.raise(g.BadGetterArity, this.state.curPosition()), this.isThisParam(n.params[0]) && this.raise(H.AccessorCannotDeclareThisParameter, this.state.curPosition()));
|
|
6362
6362
|
else if (n.kind === "set") {
|
|
6363
6363
|
if (n.params.length !== 1) this.raise(g.BadSetterArity, this.state.curPosition());
|
|
6364
6364
|
else {
|
|
6365
6365
|
let e = n.params[0];
|
|
6366
|
-
this.isThisParam(e) && this.raise(
|
|
6366
|
+
this.isThisParam(e) && this.raise(H.AccessorCannotDeclareThisParameter, this.state.curPosition()), e.type === "Identifier" && e.optional && this.raise(H.SetAccessorCannotHaveOptionalParameter, this.state.curPosition()), e.type === "RestElement" && this.raise(H.SetAccessorCannotHaveRestParameter, this.state.curPosition());
|
|
6367
6367
|
}
|
|
6368
|
-
n.returnType && this.raise(
|
|
6368
|
+
n.returnType && this.raise(H.SetAccessorCannotHaveReturnType, n.returnType);
|
|
6369
6369
|
} else n.kind = "method";
|
|
6370
6370
|
return this.finishNode(n, "TSMethodSignature");
|
|
6371
6371
|
}
|
|
@@ -6418,11 +6418,11 @@ var un = (e) => class extends e {
|
|
|
6418
6418
|
let t = !1;
|
|
6419
6419
|
return e.elementTypes.forEach((e) => {
|
|
6420
6420
|
let { type: n } = e;
|
|
6421
|
-
t && n !== "TSRestType" && n !== "TSOptionalType" && !(n === "TSNamedTupleMember" && e.optional) && this.raise(
|
|
6421
|
+
t && n !== "TSRestType" && n !== "TSOptionalType" && !(n === "TSNamedTupleMember" && e.optional) && this.raise(H.OptionalTypeBeforeRequired, e), t ||= n === "TSNamedTupleMember" && e.optional || n === "TSOptionalType";
|
|
6422
6422
|
}), this.finishNode(e, "TSTupleType");
|
|
6423
6423
|
}
|
|
6424
6424
|
tsParseTupleElementType() {
|
|
6425
|
-
let e = this.state.startLoc, t = this.eat(17), { startLoc: n } = this.state, r, i, a, o, s =
|
|
6425
|
+
let e = this.state.startLoc, t = this.eat(17), { startLoc: n } = this.state, r, i, a, o, s = D(this.state.type) ? this.lookaheadCharCode() : null;
|
|
6426
6426
|
if (s === 58) r = !0, a = !1, i = this.parseIdentifier(!0), this.expect(10), o = this.tsParseType();
|
|
6427
6427
|
else if (s === 63) {
|
|
6428
6428
|
a = !0;
|
|
@@ -6431,7 +6431,7 @@ var un = (e) => class extends e {
|
|
|
6431
6431
|
} else o = this.tsParseType(), a = this.eat(13), r = this.eat(10);
|
|
6432
6432
|
if (r) {
|
|
6433
6433
|
let e;
|
|
6434
|
-
i ? (e = this.startNodeAt(n), e.optional = a, e.label = i, e.elementType = o, this.eat(13) && (e.optional = !0, this.raise(
|
|
6434
|
+
i ? (e = this.startNodeAt(n), e.optional = a, e.label = i, e.elementType = o, this.eat(13) && (e.optional = !0, this.raise(H.TupleOptionalAfterType, this.state.lastTokStartLoc))) : (e = this.startNodeAt(n), e.optional = a, this.raise(H.InvalidTupleMemberLabel, o), e.label = o, e.elementType = this.tsParseType()), o = this.finishNode(e, "TSNamedTupleMember");
|
|
6435
6435
|
} else if (a) {
|
|
6436
6436
|
let e = this.startNodeAt(n);
|
|
6437
6437
|
e.typeAnnotation = o, o = this.finishNode(e, "TSOptionalType");
|
|
@@ -6514,8 +6514,8 @@ var un = (e) => class extends e {
|
|
|
6514
6514
|
case 20: return this.tsParseTemplateLiteralType();
|
|
6515
6515
|
default: {
|
|
6516
6516
|
let { type: e } = this.state;
|
|
6517
|
-
if (
|
|
6518
|
-
let t = e === 84 ? "TSVoidKeyword" : e === 80 ? "TSNullKeyword" :
|
|
6517
|
+
if (E(e) || e === 84 || e === 80) {
|
|
6518
|
+
let t = e === 84 ? "TSVoidKeyword" : e === 80 ? "TSNullKeyword" : sn(this.state.value);
|
|
6519
6519
|
if (t !== void 0 && this.lookaheadCharCode() !== 46) {
|
|
6520
6520
|
let e = this.startNode();
|
|
6521
6521
|
return this.next(), this.finishNode(e, t);
|
|
@@ -6545,7 +6545,7 @@ var un = (e) => class extends e {
|
|
|
6545
6545
|
switch (e.typeAnnotation.type) {
|
|
6546
6546
|
case "TSTupleType":
|
|
6547
6547
|
case "TSArrayType": return;
|
|
6548
|
-
default: this.raise(
|
|
6548
|
+
default: this.raise(H.UnexpectedReadonly, e);
|
|
6549
6549
|
}
|
|
6550
6550
|
}
|
|
6551
6551
|
tsParseInferType() {
|
|
@@ -6561,7 +6561,7 @@ var un = (e) => class extends e {
|
|
|
6561
6561
|
}
|
|
6562
6562
|
}
|
|
6563
6563
|
tsParseTypeOperatorOrHigher() {
|
|
6564
|
-
return
|
|
6564
|
+
return Te(this.state.type) && !this.state.containsEsc ? this.tsParseTypeOperator() : this.isContextual(111) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher());
|
|
6565
6565
|
}
|
|
6566
6566
|
tsParseUnionOrIntersectionType(e, t, n) {
|
|
6567
6567
|
let r = this.startNode(), i = this.eat(n), a = [];
|
|
@@ -6580,7 +6580,7 @@ var un = (e) => class extends e {
|
|
|
6580
6580
|
return this.match(43) ? !0 : this.match(6) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));
|
|
6581
6581
|
}
|
|
6582
6582
|
tsSkipParameterStart() {
|
|
6583
|
-
if (
|
|
6583
|
+
if (E(this.state.type) || this.match(74)) return this.next(), !0;
|
|
6584
6584
|
if (this.match(2)) {
|
|
6585
6585
|
let { errors: e } = this.state, t = e.length;
|
|
6586
6586
|
try {
|
|
@@ -6634,7 +6634,7 @@ var un = (e) => class extends e {
|
|
|
6634
6634
|
tsParseTypePredicateAsserts() {
|
|
6635
6635
|
if (this.state.type !== 105) return !1;
|
|
6636
6636
|
let e = this.state.containsEsc;
|
|
6637
|
-
return this.next(), !
|
|
6637
|
+
return this.next(), !E(this.state.type) && !this.match(74) ? !1 : (e && this.raise(g.InvalidEscapedReservedWord, this.state.lastTokStartLoc, { reservedWord: "asserts" }), !0);
|
|
6638
6638
|
}
|
|
6639
6639
|
tsParseTypeAnnotation(e = !0, t = this.startNode()) {
|
|
6640
6640
|
return this.tsInType(() => {
|
|
@@ -6642,7 +6642,7 @@ var un = (e) => class extends e {
|
|
|
6642
6642
|
}), this.finishNode(t, "TSTypeAnnotation");
|
|
6643
6643
|
}
|
|
6644
6644
|
tsParseType() {
|
|
6645
|
-
|
|
6645
|
+
on(this.state.inType);
|
|
6646
6646
|
let e = this.tsParseNonConditionalType();
|
|
6647
6647
|
if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(77)) return e;
|
|
6648
6648
|
let t = this.startNodeAtNode(e);
|
|
@@ -6655,24 +6655,24 @@ var un = (e) => class extends e {
|
|
|
6655
6655
|
return this.tsIsStartOfFunctionType() ? this.tsParseFunctionOrConstructorType("TSFunctionType") : this.match(73) ? this.tsParseFunctionOrConstructorType("TSConstructorType") : this.isAbstractConstructorSignature() ? this.tsParseFunctionOrConstructorType("TSConstructorType", !0) : this.tsParseUnionTypeOrHigher();
|
|
6656
6656
|
}
|
|
6657
6657
|
tsParseTypeAssertion() {
|
|
6658
|
-
this.getPluginOption("typescript", "disallowAmbiguousJSXLike") && this.raise(
|
|
6658
|
+
this.getPluginOption("typescript", "disallowAmbiguousJSXLike") && this.raise(H.ReservedTypeAssertion, this.state.startLoc);
|
|
6659
6659
|
let e = this.startNode();
|
|
6660
6660
|
return e.typeAnnotation = this.tsInType(() => (this.next(), this.match(71) ? this.tsParseTypeReference() : this.tsParseType())), this.expect(44), e.expression = this.parseMaybeUnary(), this.finishNode(e, "TSTypeAssertion");
|
|
6661
6661
|
}
|
|
6662
6662
|
tsParseHeritageClause(e) {
|
|
6663
6663
|
let t = this.state.startLoc, n = this.tsParseDelimitedList("HeritageClauseElement", () => {
|
|
6664
6664
|
let t = (this.state.canStartArrow = !1, super.parseExprSubscripts());
|
|
6665
|
-
|
|
6665
|
+
un(t) || this.raise(H.InvalidHeritageClauseType, t.start, { token: e });
|
|
6666
6666
|
let n = e === "extends" ? "TSInterfaceHeritage" : "TSClassImplements";
|
|
6667
6667
|
if (t.type === "TSInstantiationExpression") return t.type = n, t;
|
|
6668
6668
|
let r = this.startNodeAtNode(t);
|
|
6669
6669
|
return r.expression = t, (this.match(43) || this.match(47)) && (r.typeArguments = this.tsParseTypeArgumentsInExpression()), this.finishNode(r, n);
|
|
6670
6670
|
});
|
|
6671
|
-
return n.length || this.raise(
|
|
6671
|
+
return n.length || this.raise(H.EmptyHeritageClauseType, t, { token: e }), n;
|
|
6672
6672
|
}
|
|
6673
6673
|
tsParseInterfaceDeclaration(e, t = {}) {
|
|
6674
6674
|
if (this.hasFollowingLineBreak()) return null;
|
|
6675
|
-
this.expectContextual(125), t.declare && (e.declare = !0),
|
|
6675
|
+
this.expectContextual(125), t.declare && (e.declare = !0), E(this.state.type) ? (e.id = this.parseIdentifier(), this.checkIdentifier(e.id, 130)) : (e.id = null, this.raise(H.MissingInterfaceName, this.state.startLoc)), e.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers), this.eat(77) && (e.extends = this.tsParseHeritageClause("extends"));
|
|
6676
6676
|
let n = this.startNode();
|
|
6677
6677
|
return n.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)), e.body = this.finishNode(n, "TSInterfaceBody"), this.finishNode(e, "TSInterfaceDeclaration");
|
|
6678
6678
|
}
|
|
@@ -6686,7 +6686,7 @@ var un = (e) => class extends e {
|
|
|
6686
6686
|
}), this.semicolon(), this.finishNode(e, "TSTypeAliasDeclaration");
|
|
6687
6687
|
}
|
|
6688
6688
|
tsInTopLevelContext(e) {
|
|
6689
|
-
if (this.curContext() !==
|
|
6689
|
+
if (this.curContext() !== A.brace) {
|
|
6690
6690
|
let t = this.state.context;
|
|
6691
6691
|
this.state.context = [t[0]];
|
|
6692
6692
|
try {
|
|
@@ -6756,14 +6756,14 @@ var un = (e) => class extends e {
|
|
|
6756
6756
|
else {
|
|
6757
6757
|
e.kind = "module";
|
|
6758
6758
|
let { type: t, value: n } = this.state;
|
|
6759
|
-
t === 130 ? e.id = super.parseStringLiteral(n) :
|
|
6759
|
+
t === 130 ? e.id = super.parseStringLiteral(n) : E(t) ? (this.raise(H.InlineModuleDeclarationMustUseString, this.state.startLoc), e.id = this.tsParseEntityName(0)) : t === 2 ? this.raise(H.EmptyNamespaceName, this.state.startLoc) : (this.raise(H.InvalidNamespaceName, this.state.startLoc, n), e.id = super.parseExprAtom());
|
|
6760
6760
|
}
|
|
6761
6761
|
return this.match(2) ? (t || this.scope.enter(1024), this.prodParam.enter(0), e.body = this.tsParseModuleBlock(t), this.prodParam.exit(), t || this.scope.exit()) : this.semicolon(), this.finishNode(e, "TSModuleDeclaration");
|
|
6762
6762
|
}
|
|
6763
6763
|
tsParseImportEqualsDeclaration(e, t) {
|
|
6764
6764
|
e.id = t || this.parseIdentifier(), this.checkIdentifier(e.id, 4096), this.expect(25);
|
|
6765
6765
|
let n = this.tsParseModuleReference();
|
|
6766
|
-
return e.importKind === "type" && n.type !== "TSExternalModuleReference" && this.raise(
|
|
6766
|
+
return e.importKind === "type" && n.type !== "TSExternalModuleReference" && this.raise(H.ImportAliasHasImportType, n), e.moduleReference = n, this.semicolon(), this.finishNode(e, "TSImportEqualsDeclaration");
|
|
6767
6767
|
}
|
|
6768
6768
|
tsIsExternalModuleReference() {
|
|
6769
6769
|
return this.isContextual(115) && this.lookaheadCharCode() === 40;
|
|
@@ -6804,16 +6804,16 @@ var un = (e) => class extends e {
|
|
|
6804
6804
|
declare: !0
|
|
6805
6805
|
}));
|
|
6806
6806
|
case 103:
|
|
6807
|
-
if (this.isUsing()) return this.raise(
|
|
6807
|
+
if (this.isUsing()) return this.raise(H.InvalidModifierOnUsingDeclaration, this.state.startLoc, "declare"), e.declare = !0, this.parseVarStatement(e, "using", !0);
|
|
6808
6808
|
break;
|
|
6809
6809
|
case 92:
|
|
6810
|
-
if (this.isAwaitUsing()) return this.raise(
|
|
6810
|
+
if (this.isAwaitUsing()) return this.raise(H.InvalidModifierOnAwaitUsingDeclaration, this.state.startLoc, "declare"), e.declare = !0, this.next(), this.parseVarStatement(e, "await using", !0);
|
|
6811
6811
|
break;
|
|
6812
6812
|
case 125: {
|
|
6813
6813
|
let t = this.tsParseInterfaceDeclaration(e, { declare: !0 });
|
|
6814
6814
|
if (t) return t;
|
|
6815
6815
|
}
|
|
6816
|
-
default: if (
|
|
6816
|
+
default: if (E(t)) return this.tsParseDeclaration(e, this.state.type, !0, null);
|
|
6817
6817
|
}
|
|
6818
6818
|
});
|
|
6819
6819
|
}
|
|
@@ -6823,15 +6823,15 @@ var un = (e) => class extends e {
|
|
|
6823
6823
|
tsParseDeclaration(e, t, n, r) {
|
|
6824
6824
|
switch (t) {
|
|
6825
6825
|
case 120:
|
|
6826
|
-
if (this.tsCheckLineTerminator(n) && (this.match(76) ||
|
|
6826
|
+
if (this.tsCheckLineTerminator(n) && (this.match(76) || E(this.state.type))) return this.tsParseAbstractDeclaration(e, r);
|
|
6827
6827
|
break;
|
|
6828
6828
|
case 123:
|
|
6829
6829
|
if (this.tsCheckLineTerminator(n)) return this.tsParseAmbientExternalModuleDeclaration(e);
|
|
6830
6830
|
break;
|
|
6831
6831
|
case 124:
|
|
6832
|
-
if (this.tsCheckLineTerminator(n) &&
|
|
6832
|
+
if (this.tsCheckLineTerminator(n) && E(this.state.type)) return e.kind = "namespace", this.tsParseNamespaceDeclaration(e);
|
|
6833
6833
|
break;
|
|
6834
|
-
case 126: if (this.tsCheckLineTerminator(n) &&
|
|
6834
|
+
case 126: if (this.tsCheckLineTerminator(n) && E(this.state.type)) return this.tsParseTypeAliasDeclaration(e);
|
|
6835
6835
|
}
|
|
6836
6836
|
}
|
|
6837
6837
|
tsCheckLineTerminator(e) {
|
|
@@ -6850,10 +6850,10 @@ var un = (e) => class extends e {
|
|
|
6850
6850
|
}
|
|
6851
6851
|
tsParseTypeArguments() {
|
|
6852
6852
|
let e = this.startNode();
|
|
6853
|
-
return e.params = this.tsInType(() => this.tsInTopLevelContext(() => (this.expect(43), this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this))))), e.params.length === 0 ? this.raise(
|
|
6853
|
+
return e.params = this.tsInType(() => this.tsInTopLevelContext(() => (this.expect(43), this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this))))), e.params.length === 0 ? this.raise(H.EmptyTypeArguments, e) : !this.state.inType && this.curContext() === A.brace && this.reScan_lt_gt(), this.expect(44), this.finishNode(e, "TSTypeParameterInstantiation");
|
|
6854
6854
|
}
|
|
6855
6855
|
tsIsDeclarationStart() {
|
|
6856
|
-
return
|
|
6856
|
+
return Ee(this.state.type);
|
|
6857
6857
|
}
|
|
6858
6858
|
isExportDefaultSpecifier() {
|
|
6859
6859
|
return !this.tsIsDeclarationStart() && super.isExportDefaultSpecifier();
|
|
@@ -6868,13 +6868,13 @@ var un = (e) => class extends e {
|
|
|
6868
6868
|
"readonly"
|
|
6869
6869
|
] }, r);
|
|
6870
6870
|
let i = r.accessibility, a = r.override, o = r.readonly;
|
|
6871
|
-
!(e & 4) && (i || o || a) && this.raise(
|
|
6871
|
+
!(e & 4) && (i || o || a) && this.raise(H.UnexpectedParameterModifier, n || t[0]);
|
|
6872
6872
|
let s = this.state.startLoc, c = this.parseMaybeDefault(s);
|
|
6873
6873
|
e & 2 && this.parseFunctionParamType(c);
|
|
6874
6874
|
let l = this.parseMaybeDefault(s, c);
|
|
6875
6875
|
if (i || o || a) {
|
|
6876
6876
|
let e = n ? this.startNodeAt(n) : this.startNodeAtNode(t[0]);
|
|
6877
|
-
return t.length ? e.decorators = t : this.setLoc(n), i && (e.accessibility = i), o && (e.readonly = o), a && (e.override = a), l.type !== "Identifier" && l.type !== "AssignmentPattern" && this.raise(
|
|
6877
|
+
return t.length ? e.decorators = t : this.setLoc(n), i && (e.accessibility = i), o && (e.readonly = o), a && (e.override = a), l.type !== "Identifier" && l.type !== "AssignmentPattern" && this.raise(H.UnsupportedParameterPropertyKind, n || t[0]), e.parameter = l, this.finishNode(e, "TSParameterProperty");
|
|
6878
6878
|
}
|
|
6879
6879
|
return t.length && (c.decorators = t), l;
|
|
6880
6880
|
}
|
|
@@ -6882,7 +6882,7 @@ var un = (e) => class extends e {
|
|
|
6882
6882
|
return e.type === "TSParameterProperty" && super.isSimpleParameter(e.parameter) || super.isSimpleParameter(e);
|
|
6883
6883
|
}
|
|
6884
6884
|
tsDisallowOptionalPattern(e) {
|
|
6885
|
-
for (let t of e.params) t.type !== "Identifier" && t.optional && !this.state.isAmbientContext && this.raise(
|
|
6885
|
+
for (let t of e.params) t.type !== "Identifier" && t.optional && !this.state.isAmbientContext && this.raise(H.PatternIsOptional, t);
|
|
6886
6886
|
}
|
|
6887
6887
|
setArrowFunctionParameters(e, t, n) {
|
|
6888
6888
|
super.setArrowFunctionParameters(e, t, n), this.tsDisallowOptionalPattern(e);
|
|
@@ -6891,18 +6891,18 @@ var un = (e) => class extends e {
|
|
|
6891
6891
|
this.match(10) && (e.returnType = this.tsParseTypeOrTypePredicateAnnotation(10));
|
|
6892
6892
|
let r = t === "FunctionDeclaration" ? "TSDeclareFunction" : t === "ClassMethod" || t === "ClassPrivateMethod" ? "TSDeclareMethod" : void 0;
|
|
6893
6893
|
if (r && !this.match(2) && this.isLineTerminator()) {
|
|
6894
|
-
if (r === "TSDeclareMethod" && e.kind === "constructor") for (let t of e.params) t.type === "TSParameterProperty" ? this.raise(
|
|
6895
|
-
else for (let t of e.params) t.type === "AssignmentPattern" && this.raise(
|
|
6894
|
+
if (r === "TSDeclareMethod" && e.kind === "constructor") for (let t of e.params) t.type === "TSParameterProperty" ? this.raise(H.UnexpectedParameterModifier, t) : t.type === "AssignmentPattern" && this.raise(H.UnexpectedParameterInitializer, t);
|
|
6895
|
+
else for (let t of e.params) t.type === "AssignmentPattern" && this.raise(H.UnexpectedParameterInitializer, t);
|
|
6896
6896
|
return this.finishNode(e, r);
|
|
6897
6897
|
}
|
|
6898
|
-
return r && this.state.isAmbientContext && (this.raise(
|
|
6898
|
+
return r && this.state.isAmbientContext && (this.raise(H.DeclareFunctionHasImplementation, this.state.startLoc), r === "TSDeclareFunction" && e.declare) ? super.parseFunctionBodyAndFinish(e, r, n) : (this.tsDisallowOptionalPattern(e), super.parseFunctionBodyAndFinish(e, t, n));
|
|
6899
6899
|
}
|
|
6900
6900
|
registerFunctionStatementId(e) {
|
|
6901
6901
|
!e.body && e.id ? this.checkIdentifier(e.id, 1024) : super.registerFunctionStatementId(e);
|
|
6902
6902
|
}
|
|
6903
6903
|
tsCheckForInvalidTypeCasts(e) {
|
|
6904
6904
|
e.forEach((e) => {
|
|
6905
|
-
e?.type === "TSTypeCastExpression" && this.raise(
|
|
6905
|
+
e?.type === "TSTypeCastExpression" && this.raise(H.UnexpectedTypeAnnotation, e.typeAnnotation);
|
|
6906
6906
|
});
|
|
6907
6907
|
}
|
|
6908
6908
|
toReferencedList(e, t) {
|
|
@@ -6935,7 +6935,7 @@ var un = (e) => class extends e {
|
|
|
6935
6935
|
a = this.state.curPosition();
|
|
6936
6936
|
return;
|
|
6937
6937
|
}
|
|
6938
|
-
if (
|
|
6938
|
+
if (ke(this.state.type)) {
|
|
6939
6939
|
let n = super.parseTaggedTemplateExpression(e, t, r);
|
|
6940
6940
|
return n.typeArguments = o, n;
|
|
6941
6941
|
}
|
|
@@ -6944,11 +6944,11 @@ var un = (e) => class extends e {
|
|
|
6944
6944
|
return n.callee = e, n.arguments = this.parseCallExpressionArguments(), this.tsCheckForInvalidTypeCasts(n.arguments), n.typeArguments = o, r.optionalChainMember && (n.optional = i), this.finishCallExpression(n, r.optionalChainMember);
|
|
6945
6945
|
}
|
|
6946
6946
|
let s = this.state.type;
|
|
6947
|
-
if (s === 44 || s === 48 || s !== 6 && s !== 89 && s !== 116 &&
|
|
6947
|
+
if (s === 44 || s === 48 || s !== 6 && s !== 89 && s !== 116 && O(s) && !this.hasPrecedingLineBreak()) return;
|
|
6948
6948
|
let c = this.startNodeAt(t);
|
|
6949
6949
|
return c.expression = e, c.typeArguments = o, this.finishNode(c, "TSInstantiationExpression");
|
|
6950
6950
|
});
|
|
6951
|
-
if (a && this.unexpected(a, 6), o) return o.type === "TSInstantiationExpression" && ((this.match(12) || this.match(14) && this.lookaheadCharCode() !== 40) && this.raise(
|
|
6951
|
+
if (a && this.unexpected(a, 6), o) return o.type === "TSInstantiationExpression" && ((this.match(12) || this.match(14) && this.lookaheadCharCode() !== 40) && this.raise(H.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc), !this.match(12) && !this.match(14) && (o.expression = super.stopParseSubscript(e, r))), o;
|
|
6952
6952
|
}
|
|
6953
6953
|
return super.parseSubscript(e, t, n, r);
|
|
6954
6954
|
}
|
|
@@ -6959,7 +6959,7 @@ var un = (e) => class extends e {
|
|
|
6959
6959
|
}
|
|
6960
6960
|
parseExprOp(e, t, n) {
|
|
6961
6961
|
let r;
|
|
6962
|
-
if (
|
|
6962
|
+
if (De(54) > n && !this.hasPrecedingLineBreak() && (this.isContextual(89) || (r = this.isContextual(116)))) {
|
|
6963
6963
|
let i = this.startNodeAt(t);
|
|
6964
6964
|
i.expression = e, i.typeAnnotation = this.tsInType(() => (this.next(), this.match(71) ? (r && this.raise(g.UnexpectedKeyword, this.state.startLoc, { keyword: "const" }), this.tsParseTypeReference()) : this.tsParseType()));
|
|
6965
6965
|
let a = this.finishNode(i, r ? "TSSatisfiesExpression" : "TSAsExpression");
|
|
@@ -6983,19 +6983,19 @@ var un = (e) => class extends e {
|
|
|
6983
6983
|
super.applyImportPhase(e, t, n, r), t ? e.exportKind = n === "type" ? "type" : "value" : e.importKind = n === "type" || n === "typeof" ? n : "value";
|
|
6984
6984
|
}
|
|
6985
6985
|
parseImport(e) {
|
|
6986
|
-
if (this.match(130)) return e.importKind = "value", this.scope.inTSNamespace && this.raise(
|
|
6986
|
+
if (this.match(130)) return e.importKind = "value", this.scope.inTSNamespace && this.raise(H.ImportInTSNamespace, e), super.parseImport(e);
|
|
6987
6987
|
let t;
|
|
6988
|
-
if (
|
|
6988
|
+
if (E(this.state.type) && this.lookaheadCharCode() === 61) {
|
|
6989
6989
|
e.importKind = "value";
|
|
6990
6990
|
let t = this.tsParseImportEqualsDeclaration(e);
|
|
6991
|
-
return this.scope.inTSNamespace && t.moduleReference.type === "TSExternalModuleReference" && this.raise(
|
|
6991
|
+
return this.scope.inTSNamespace && t.moduleReference.type === "TSExternalModuleReference" && this.raise(H.ImportInTSNamespace, e), t;
|
|
6992
6992
|
}
|
|
6993
6993
|
if (this.isContextual(126)) {
|
|
6994
6994
|
let n = this.parseMaybeImportPhase(e, !1);
|
|
6995
|
-
if (this.lookaheadCharCode() === 61) return this.scope.inTSNamespace && this.raise(
|
|
6995
|
+
if (this.lookaheadCharCode() === 61) return this.scope.inTSNamespace && this.raise(H.ImportInTSNamespace, e), this.tsParseImportEqualsDeclaration(e, n);
|
|
6996
6996
|
t = super.parseImportSpecifiersAndAfter(e, n);
|
|
6997
6997
|
} else t = super.parseImport(e);
|
|
6998
|
-
return t.importKind === "type" && t.specifiers.length > 1 && t.specifiers[0].type === "ImportDefaultSpecifier" ? this.raise(
|
|
6998
|
+
return t.importKind === "type" && t.specifiers.length > 1 && t.specifiers[0].type === "ImportDefaultSpecifier" ? this.raise(H.TypeImportCannotSpecifyDefaultAndNamed, t) : this.scope.inTSNamespace && this.raise(H.ImportInTSNamespace, t), t;
|
|
6999
6999
|
}
|
|
7000
7000
|
parseExport(e, t) {
|
|
7001
7001
|
if (this.match(79)) {
|
|
@@ -7008,15 +7008,15 @@ var un = (e) => class extends e {
|
|
|
7008
7008
|
}
|
|
7009
7009
|
if (this.eat(25)) {
|
|
7010
7010
|
let t = e;
|
|
7011
|
-
return t.expression = super.parseExpression(), this.semicolon(), this.sawUnambiguousESM = !0, this.scope.inTSNamespace && this.raise(
|
|
7011
|
+
return t.expression = super.parseExpression(), this.semicolon(), this.sawUnambiguousESM = !0, this.scope.inTSNamespace && this.raise(H.ExportAssignmentInTSNamespace, t), this.finishNode(t, "TSExportAssignment");
|
|
7012
7012
|
}
|
|
7013
7013
|
if (this.eatContextual(89)) {
|
|
7014
7014
|
let t = e;
|
|
7015
|
-
return this.expectContextual(124), t.id = this.parseIdentifier(), this.checkIdentifier(t.id, 8201), this.semicolon(), this.scope.inTSNamespace && this.raise(
|
|
7015
|
+
return this.expectContextual(124), t.id = this.parseIdentifier(), this.checkIdentifier(t.id, 8201), this.semicolon(), this.scope.inTSNamespace && this.raise(H.NamespaceExportInTSNamespace, t), this.finishNode(t, "TSNamespaceExportDeclaration");
|
|
7016
7016
|
}
|
|
7017
7017
|
{
|
|
7018
7018
|
let n = super.parseExport(e, t);
|
|
7019
|
-
return this.scope.inTSNamespace && (n.type !== "ExportNamedDeclaration" || n.source || !n.declaration && !this.state.isAmbientContext) && this.raise(
|
|
7019
|
+
return this.scope.inTSNamespace && (n.type !== "ExportNamedDeclaration" || n.source || !n.declaration && !this.state.isAmbientContext) && this.raise(H.ExportInTSNamespace, n), n;
|
|
7020
7020
|
}
|
|
7021
7021
|
}
|
|
7022
7022
|
isAbstractClass() {
|
|
@@ -7035,10 +7035,10 @@ var un = (e) => class extends e {
|
|
|
7035
7035
|
}
|
|
7036
7036
|
parseVarStatement(e, t, n = !1) {
|
|
7037
7037
|
let { isAmbientContext: r } = this.state, i = super.parseVarStatement(e, t, n || r);
|
|
7038
|
-
if (r && !e.declare && (t === "using" || t === "await using")) return this.raiseOverwrite(
|
|
7038
|
+
if (r && !e.declare && (t === "using" || t === "await using")) return this.raiseOverwrite(H.UsingDeclarationInAmbientContext, e, t), i;
|
|
7039
7039
|
for (let e of i.declarations) {
|
|
7040
7040
|
let { id: n, init: i, definite: a } = e;
|
|
7041
|
-
a && (i ? this.raise(
|
|
7041
|
+
a && (i ? this.raise(H.DeclaratorDefiniteAssertionWithInitializer, n) : n.typeAnnotation || this.raise(H.DeclaratorDefiniteAssertionRequiresTypeAnnotation, n)), r && i && (t === "var" || t === "let" || n.typeAnnotation ? this.raise(H.InitializerNotAllowedInAmbientContext, i) : pn(i, this.hasPlugin("estree")) || this.raise(H.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference, i));
|
|
7042
7042
|
}
|
|
7043
7043
|
return i;
|
|
7044
7044
|
}
|
|
@@ -7069,7 +7069,7 @@ var un = (e) => class extends e {
|
|
|
7069
7069
|
break;
|
|
7070
7070
|
case 125: {
|
|
7071
7071
|
let e = this.tsParseInterfaceDeclaration(this.startNode());
|
|
7072
|
-
if (e) return n || this.raise(
|
|
7072
|
+
if (e) return n || this.raise(H.UnexpectedTypeDeclaration, e, "interface"), e;
|
|
7073
7073
|
break;
|
|
7074
7074
|
}
|
|
7075
7075
|
case 123:
|
|
@@ -7078,7 +7078,7 @@ var un = (e) => class extends e {
|
|
|
7078
7078
|
return this.next(), this.tsParseDeclaration(e, 123, !1, t);
|
|
7079
7079
|
}
|
|
7080
7080
|
if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
7081
|
-
this.raise(
|
|
7081
|
+
this.raise(H.InlineModuleDeclarationMustUseString, this.state.startLoc);
|
|
7082
7082
|
let e = this.startNode();
|
|
7083
7083
|
return this.next(), this.tsParseDeclaration(e, 124, !1, t);
|
|
7084
7084
|
}
|
|
@@ -7091,7 +7091,7 @@ var un = (e) => class extends e {
|
|
|
7091
7091
|
break;
|
|
7092
7092
|
case 126: if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
7093
7093
|
let e = this.startNode();
|
|
7094
|
-
return n || this.raise(
|
|
7094
|
+
return n || this.raise(H.UnexpectedTypeDeclaration, e, "type"), this.next(), this.tsParseTypeAliasDeclaration(e);
|
|
7095
7095
|
}
|
|
7096
7096
|
}
|
|
7097
7097
|
return super.parseStatementContent(e, t);
|
|
@@ -7104,7 +7104,7 @@ var un = (e) => class extends e {
|
|
|
7104
7104
|
]);
|
|
7105
7105
|
}
|
|
7106
7106
|
tsHasSomeModifiers(e, t) {
|
|
7107
|
-
return t.some((t) =>
|
|
7107
|
+
return t.some((t) => cn(t) ? e.accessibility === t : !!e[t]);
|
|
7108
7108
|
}
|
|
7109
7109
|
tsIsStartOfStaticBlocks() {
|
|
7110
7110
|
return this.isContextual(102) && this.lookaheadCharCode() === 123;
|
|
@@ -7124,23 +7124,23 @@ var un = (e) => class extends e {
|
|
|
7124
7124
|
allowedModifiers: r,
|
|
7125
7125
|
disallowedModifiers: ["in", "out"],
|
|
7126
7126
|
stopOnStartOfClassStaticBlock: !0,
|
|
7127
|
-
errorTemplate:
|
|
7127
|
+
errorTemplate: H.InvalidModifierOnTypeParameterPositions
|
|
7128
7128
|
}, t);
|
|
7129
7129
|
let i = () => {
|
|
7130
|
-
this.tsIsStartOfStaticBlocks() ? (this.next(), this.next(), this.tsHasSomeModifiers(t, r) && this.raise(
|
|
7130
|
+
this.tsIsStartOfStaticBlocks() ? (this.next(), this.next(), this.tsHasSomeModifiers(t, r) && this.raise(H.StaticBlockCannotHaveModifier, this.state.curPosition()), super.parseClassStaticBlock(e, t)) : this.parseClassMemberWithIsStatic(e, t, n, !!t.static);
|
|
7131
7131
|
};
|
|
7132
|
-
t.declare ? this.tsInAmbientContext(i) : i(), t.decorators && t.decorators.length > 0 && !this.hasPlugin("decorators-legacy") && (t.type === "TSAbstractMethodDefinition" || t.type === "TSDeclareMethod" ? this.raise(
|
|
7132
|
+
t.declare ? this.tsInAmbientContext(i) : i(), t.decorators && t.decorators.length > 0 && !this.hasPlugin("decorators-legacy") && (t.type === "TSAbstractMethodDefinition" || t.type === "TSDeclareMethod" ? this.raise(H.DecoratorAbstractMethod, t, { kind: "abstract method" }) : (t.type === "ClassProperty" && t.abstract || t.type === "ClassProperty" && t.declare || t.type === "TSAbstractPropertyDefinition" || t.type === "PropertyDefinition" && t.declare) && this.raise(H.DecoratorAbstractMethod, t, { kind: t.declare ? "declare field" : "abstract field" }));
|
|
7133
7133
|
}
|
|
7134
7134
|
parseClassMemberWithIsStatic(e, t, n, r) {
|
|
7135
7135
|
let i = this.tsTryParseIndexSignature(t);
|
|
7136
7136
|
if (i) {
|
|
7137
|
-
e.body.push(i), t.abstract && this.raise(
|
|
7137
|
+
e.body.push(i), t.abstract && this.raise(H.IndexSignatureHasAbstract, t), t.accessibility && this.raise(H.IndexSignatureHasAccessibility, t, { modifier: t.accessibility }), t.declare && this.raise(H.IndexSignatureHasDeclare, t), t.override && this.raise(H.IndexSignatureHasOverride, t);
|
|
7138
7138
|
return;
|
|
7139
7139
|
}
|
|
7140
|
-
!this.state.inAbstractClass && t.abstract && this.raise(
|
|
7140
|
+
!this.state.inAbstractClass && t.abstract && this.raise(H.NonAbstractClassHasAbstractMethod, t), t.override && (n.hadSuperClass || this.raise(H.OverrideNotInSubClass, t)), super.parseClassMemberWithIsStatic(e, t, n, r);
|
|
7141
7141
|
}
|
|
7142
7142
|
parsePostMemberNameModifiers(e) {
|
|
7143
|
-
this.eat(13) && (e.optional = !0), e.readonly && this.match(6) && this.raise(
|
|
7143
|
+
this.eat(13) && (e.optional = !0), e.readonly && this.match(6) && this.raise(H.ClassMethodHasReadonly, e), e.declare && this.match(6) && this.raise(H.ClassMethodHasDeclare, e);
|
|
7144
7144
|
}
|
|
7145
7145
|
shouldParseExportDeclaration() {
|
|
7146
7146
|
return this.tsIsDeclarationStart() ? !0 : super.shouldParseExportDeclaration();
|
|
@@ -7168,8 +7168,8 @@ var un = (e) => class extends e {
|
|
|
7168
7168
|
parseExportDeclaration(e) {
|
|
7169
7169
|
if (!this.state.isAmbientContext && this.isContextual(121)) return this.tsInAmbientContext(() => this.parseExportDeclaration(e));
|
|
7170
7170
|
let t = this.state.startLoc, n = this.eatContextual(121);
|
|
7171
|
-
if (n && (this.isContextual(121) || !this.shouldParseExportDeclaration())) throw this.raise(
|
|
7172
|
-
let r =
|
|
7171
|
+
if (n && (this.isContextual(121) || !this.shouldParseExportDeclaration())) throw this.raise(H.ExpectedAmbientAfterExportDeclare, this.state.startLoc);
|
|
7172
|
+
let r = E(this.state.type) && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(e);
|
|
7173
7173
|
return r ? ((r.type === "TSInterfaceDeclaration" || r.type === "TSTypeAliasDeclaration" || n) && (e.exportKind = "type"), n && r.type !== "TSImportEqualsDeclaration" && (this.resetStartLocation(r, t), r.declare = !0), r) : null;
|
|
7174
7174
|
}
|
|
7175
7175
|
parseClassId(e, t, n, r) {
|
|
@@ -7184,26 +7184,26 @@ var un = (e) => class extends e {
|
|
|
7184
7184
|
parseClassPropertyAnnotation(e) {
|
|
7185
7185
|
e.optional || (this.eat(31) ? e.definite = !0 : this.eat(13) && (e.optional = !0));
|
|
7186
7186
|
let t = this.tsTryParseTypeAnnotation();
|
|
7187
|
-
t && (e.typeAnnotation = t), e.definite && (this.match(25) ? this.raise(
|
|
7187
|
+
t && (e.typeAnnotation = t), e.definite && (this.match(25) ? this.raise(H.DeclaratorDefiniteAssertionWithInitializer, e) : t || this.raise(H.DeclaratorDefiniteAssertionRequiresTypeAnnotation, e));
|
|
7188
7188
|
}
|
|
7189
7189
|
parseClassProperty(e) {
|
|
7190
|
-
if (this.parseClassPropertyAnnotation(e), this.state.isAmbientContext && !(e.readonly && !e.typeAnnotation) && this.match(25) && this.raise(
|
|
7190
|
+
if (this.parseClassPropertyAnnotation(e), this.state.isAmbientContext && !(e.readonly && !e.typeAnnotation) && this.match(25) && this.raise(H.DeclareClassFieldHasInitializer, this.state.startLoc), e.abstract && this.match(25)) {
|
|
7191
7191
|
let { key: t } = e;
|
|
7192
|
-
this.raise(
|
|
7192
|
+
this.raise(H.AbstractPropertyHasInitializer, this.state.startLoc, { propertyName: t.type === "Identifier" && !e.computed ? t.name : `[${this.input.slice(this.offsetToSourcePos(t.start), this.offsetToSourcePos(t.end))}]` });
|
|
7193
7193
|
}
|
|
7194
7194
|
return super.parseClassProperty(e);
|
|
7195
7195
|
}
|
|
7196
7196
|
parseClassPrivateProperty(e) {
|
|
7197
|
-
return e.abstract && this.raise(
|
|
7197
|
+
return e.abstract && this.raise(H.PrivateElementHasAbstract, e), e.accessibility && this.raise(H.PrivateElementHasAccessibility, e, { modifier: e.accessibility }), this.parseClassPropertyAnnotation(e), super.parseClassPrivateProperty(e);
|
|
7198
7198
|
}
|
|
7199
7199
|
parseClassAccessorProperty(e) {
|
|
7200
|
-
return this.parseClassPropertyAnnotation(e), e.optional && this.raise(
|
|
7200
|
+
return this.parseClassPropertyAnnotation(e), e.optional && this.raise(H.AccessorCannotBeOptional, e), super.parseClassAccessorProperty(e);
|
|
7201
7201
|
}
|
|
7202
7202
|
pushClassMethod(e, t, n, r, i, a) {
|
|
7203
7203
|
let o = this.tsTryParseTypeParameters(this.tsParseConstModifier);
|
|
7204
|
-
o && i && this.raise(
|
|
7204
|
+
o && i && this.raise(H.ConstructorHasTypeParameters, o);
|
|
7205
7205
|
let { declare: s = !1, kind: c } = t;
|
|
7206
|
-
s && (c === "get" || c === "set") && this.raise(
|
|
7206
|
+
s && (c === "get" || c === "set") && this.raise(H.DeclareAccessor, t, { kind: c }), o && (t.typeParameters = o), super.pushClassMethod(e, t, n, r, i, a);
|
|
7207
7207
|
}
|
|
7208
7208
|
pushClassPrivateMethod(e, t, n, r) {
|
|
7209
7209
|
let i = this.tsTryParseTypeParameters(this.tsParseConstModifier);
|
|
@@ -7244,7 +7244,7 @@ var un = (e) => class extends e {
|
|
|
7244
7244
|
if (this.hasPlugin("jsx") && (this.match(138) || this.match(43))) {
|
|
7245
7245
|
if (r = this.state.clone(), i = this.tryParse(() => super.parseMaybeAssign(e, t), r), !i.error) return i.node;
|
|
7246
7246
|
let { context: n } = this.state, a = n[n.length - 1];
|
|
7247
|
-
(a ===
|
|
7247
|
+
(a === A.j_oTag || a === A.j_expr) && n.pop();
|
|
7248
7248
|
}
|
|
7249
7249
|
if (!i?.error && !this.match(43)) return super.parseMaybeAssign(e, t);
|
|
7250
7250
|
(!r || r === this.state) && (r = this.state.clone());
|
|
@@ -7253,19 +7253,19 @@ var un = (e) => class extends e {
|
|
|
7253
7253
|
let i = super.parseMaybeAssign(e, t);
|
|
7254
7254
|
if ((i.type !== "ArrowFunctionExpression" || i.extra?.parenthesized) && r(), o?.params.length !== 0 && this.resetStartLocationFromNode(i, o), i.typeParameters = o, this.hasPlugin("jsx") && i.typeParameters.params.length === 1 && !i.typeParameters.extra?.trailingComma) {
|
|
7255
7255
|
let e = i.typeParameters.params[0];
|
|
7256
|
-
e.constraint || this.raise(
|
|
7256
|
+
e.constraint || this.raise(H.SingleTypeParameterWithoutTrailingComma, this.optionFlags & 256 ? n(e.loc.end, 1) : e, { typeParameterName: e.name.name });
|
|
7257
7257
|
}
|
|
7258
7258
|
return i;
|
|
7259
7259
|
}, r);
|
|
7260
7260
|
if (!s.error && !s.aborted) return o && this.reportReservedArrowTypeParam(o), s.node;
|
|
7261
|
-
if (!i && (
|
|
7261
|
+
if (!i && (on(!this.hasPlugin("jsx")), a = this.tryParse(() => super.parseMaybeAssign(e, t), r), !a.error)) return a.node;
|
|
7262
7262
|
if (i?.node) return this.state = i.failState, i.node;
|
|
7263
7263
|
if (s.node) return this.state = s.failState, o && this.reportReservedArrowTypeParam(o), s.node;
|
|
7264
7264
|
if (a?.node) return this.state = a.failState, a.node;
|
|
7265
7265
|
throw i?.error || s.error || a?.error;
|
|
7266
7266
|
}
|
|
7267
7267
|
reportReservedArrowTypeParam(e) {
|
|
7268
|
-
e.params.length === 1 && !e.params[0].constraint && !e.extra?.trailingComma && this.getPluginOption("typescript", "disallowAmbiguousJSXLike") && this.raise(
|
|
7268
|
+
e.params.length === 1 && !e.params[0].constraint && !e.extra?.trailingComma && this.getPluginOption("typescript", "disallowAmbiguousJSXLike") && this.raise(H.ReservedArrowTypeParam, e);
|
|
7269
7269
|
}
|
|
7270
7270
|
parseMaybeUnary(e, t) {
|
|
7271
7271
|
return !this.hasPlugin("jsx") && this.match(43) ? this.tsParseTypeAssertion() : super.parseMaybeUnary(e, t);
|
|
@@ -7302,7 +7302,7 @@ var un = (e) => class extends e {
|
|
|
7302
7302
|
case "TSSatisfiesExpression":
|
|
7303
7303
|
case "TSNonNullExpression":
|
|
7304
7304
|
case "TSTypeAssertion":
|
|
7305
|
-
t ? this.expressionScope.recordArrowParameterBindingError(
|
|
7305
|
+
t ? this.expressionScope.recordArrowParameterBindingError(H.UnexpectedTypeCastInParameter, e) : this.raise(H.UnexpectedTypeCastInParameter, e), this.toAssignable(e.expression, t);
|
|
7306
7306
|
break;
|
|
7307
7307
|
case "AssignmentExpression": !t && e.left.type === "TSTypeCastExpression" && (e.left = this.typeCastToParameter(e.left));
|
|
7308
7308
|
default: super.toAssignable(e, t);
|
|
@@ -7367,7 +7367,7 @@ var un = (e) => class extends e {
|
|
|
7367
7367
|
}
|
|
7368
7368
|
parseMaybeDefault(e, t) {
|
|
7369
7369
|
let n = super.parseMaybeDefault(e, t);
|
|
7370
|
-
return n.type === "AssignmentPattern" && n.typeAnnotation && n.right.start < n.typeAnnotation.start && this.raise(
|
|
7370
|
+
return n.type === "AssignmentPattern" && n.typeAnnotation && n.right.start < n.typeAnnotation.start && this.raise(H.TypeAnnotationAfterAssign, n.typeAnnotation), n;
|
|
7371
7371
|
}
|
|
7372
7372
|
getTokenFromCode(e) {
|
|
7373
7373
|
if (this.state.inType) {
|
|
@@ -7447,14 +7447,14 @@ var un = (e) => class extends e {
|
|
|
7447
7447
|
}
|
|
7448
7448
|
tsParseAbstractDeclaration(e, t) {
|
|
7449
7449
|
if (this.match(76)) return e.abstract = !0, this.maybeTakeDecorators(t, this.parseClass(e, !0, !1));
|
|
7450
|
-
if (this.isContextual(125)) return this.hasFollowingLineBreak() ? null : (e.abstract = !0, this.raise(
|
|
7450
|
+
if (this.isContextual(125)) return this.hasFollowingLineBreak() ? null : (e.abstract = !0, this.raise(H.NonClassMethodPropertyHasAbstractModifier, e), this.tsParseInterfaceDeclaration(e));
|
|
7451
7451
|
throw this.unexpected(null, 76);
|
|
7452
7452
|
}
|
|
7453
7453
|
parseMethod(e, t, n, r, i, a, o) {
|
|
7454
7454
|
let s = super.parseMethod(e, t, n, r, i, a, o);
|
|
7455
7455
|
if ((s.abstract || s.type === "TSAbstractMethodDefinition") && (this.hasPlugin("estree") ? s.value : s).body) {
|
|
7456
7456
|
let { key: e } = s;
|
|
7457
|
-
this.raise(
|
|
7457
|
+
this.raise(H.AbstractMethodHasImplementation, s, { methodName: e.type === "Identifier" && !s.computed ? e.name : `[${this.input.slice(this.offsetToSourcePos(e.start), this.offsetToSourcePos(e.end))}]` });
|
|
7458
7458
|
}
|
|
7459
7459
|
return s;
|
|
7460
7460
|
}
|
|
@@ -7482,10 +7482,10 @@ var un = (e) => class extends e {
|
|
|
7482
7482
|
let e = this.parseIdentifier();
|
|
7483
7483
|
if (this.isContextual(89)) {
|
|
7484
7484
|
let n = this.parseIdentifier();
|
|
7485
|
-
|
|
7486
|
-
} else
|
|
7487
|
-
} else
|
|
7488
|
-
s && n && this.raise(t ?
|
|
7485
|
+
D(this.state.type) ? (s = !0, a = e, o = t ? this.parseIdentifier() : this.parseModuleExportName(), c = !1) : (o = n, c = !1);
|
|
7486
|
+
} else D(this.state.type) ? (c = !1, o = t ? this.parseIdentifier() : this.parseModuleExportName()) : (s = !0, a = e);
|
|
7487
|
+
} else D(this.state.type) && (s = !0, t ? (a = this.parseIdentifier(!0), this.isContextual(89) || this.checkReservedWord(a.name, a.start, !0, !0)) : a = this.parseModuleExportName());
|
|
7488
|
+
s && n && this.raise(t ? H.TypeModifierIsUsedInTypeImports : H.TypeModifierIsUsedInTypeExports, l), e[r] = a, e[i] = o;
|
|
7489
7489
|
let u = t ? "importKind" : "exportKind";
|
|
7490
7490
|
e[u] = s ? "type" : "value", c && this.eatContextual(89) && (e[i] = t ? this.parseIdentifier() : this.parseModuleExportName()), e[i] || (e[i] = this.cloneIdentifier(e[r])), t && this.checkIdentifier(e[i], s ? 4098 : 4096);
|
|
7491
7491
|
}
|
|
@@ -7563,10 +7563,10 @@ var un = (e) => class extends e {
|
|
|
7563
7563
|
}
|
|
7564
7564
|
}
|
|
7565
7565
|
chStartsBindingIdentifierAndNotRelationalOperator(e, t) {
|
|
7566
|
-
if (
|
|
7567
|
-
if (
|
|
7568
|
-
let e = this.codePointAtPos(
|
|
7569
|
-
if (!
|
|
7566
|
+
if (j(e)) {
|
|
7567
|
+
if (rn.lastIndex = t, rn.test(this.input)) {
|
|
7568
|
+
let e = this.codePointAtPos(rn.lastIndex);
|
|
7569
|
+
if (!M(e) && e !== 92) return !1;
|
|
7570
7570
|
}
|
|
7571
7571
|
return !0;
|
|
7572
7572
|
}
|
|
@@ -7581,12 +7581,12 @@ var un = (e) => class extends e {
|
|
|
7581
7581
|
return t === 34 || t === 39;
|
|
7582
7582
|
}
|
|
7583
7583
|
};
|
|
7584
|
-
function
|
|
7584
|
+
function fn(e) {
|
|
7585
7585
|
if (e.type !== "MemberExpression") return !1;
|
|
7586
7586
|
let { computed: t, property: n } = e;
|
|
7587
|
-
return t && n.type !== "StringLiteral" && (n.type !== "TemplateLiteral" || n.expressions.length > 0) ? !1 :
|
|
7587
|
+
return t && n.type !== "StringLiteral" && (n.type !== "TemplateLiteral" || n.expressions.length > 0) ? !1 : gn(e.object);
|
|
7588
7588
|
}
|
|
7589
|
-
function
|
|
7589
|
+
function pn(e, t) {
|
|
7590
7590
|
let { type: n } = e;
|
|
7591
7591
|
if (e.extra?.parenthesized) return !1;
|
|
7592
7592
|
if (t) {
|
|
@@ -7595,25 +7595,25 @@ function fn(e, t) {
|
|
|
7595
7595
|
if (typeof t == "string" || typeof t == "boolean") return !0;
|
|
7596
7596
|
}
|
|
7597
7597
|
} else if (n === "StringLiteral" || n === "BooleanLiteral") return !0;
|
|
7598
|
-
return !!(
|
|
7598
|
+
return !!(mn(e, t) || hn(e, t) || n === "TemplateLiteral" && e.expressions.length === 0 || fn(e));
|
|
7599
7599
|
}
|
|
7600
|
-
function
|
|
7600
|
+
function mn(e, t) {
|
|
7601
7601
|
return t ? e.type === "Literal" && (typeof e.value == "number" || "bigint" in e) : e.type === "NumericLiteral" || e.type === "BigIntLiteral";
|
|
7602
7602
|
}
|
|
7603
|
-
function
|
|
7603
|
+
function hn(e, t) {
|
|
7604
7604
|
if (e.type === "UnaryExpression") {
|
|
7605
7605
|
let { operator: n, argument: r } = e;
|
|
7606
|
-
if (n === "-" &&
|
|
7606
|
+
if (n === "-" && mn(r, t)) return !0;
|
|
7607
7607
|
}
|
|
7608
7608
|
return !1;
|
|
7609
7609
|
}
|
|
7610
|
-
function
|
|
7611
|
-
return e.type === "Identifier" ? !0 : e.type !== "MemberExpression" || e.computed ? !1 :
|
|
7610
|
+
function gn(e) {
|
|
7611
|
+
return e.type === "Identifier" ? !0 : e.type !== "MemberExpression" || e.computed ? !1 : gn(e.object);
|
|
7612
7612
|
}
|
|
7613
|
-
var
|
|
7613
|
+
var _n = h`placeholders`({
|
|
7614
7614
|
ClassNameIsRequired: "A class name is required.",
|
|
7615
7615
|
UnexpectedSpace: "Unexpected space in placeholder."
|
|
7616
|
-
}),
|
|
7616
|
+
}), vn = (e) => class extends e {
|
|
7617
7617
|
parsePlaceholder(e) {
|
|
7618
7618
|
if (this.match(129)) {
|
|
7619
7619
|
let t = this.startNode();
|
|
@@ -7683,7 +7683,7 @@ var gn = h`placeholders`({
|
|
|
7683
7683
|
if (a) {
|
|
7684
7684
|
if (this.match(77) || this.match(129) || this.match(2)) e.id = a;
|
|
7685
7685
|
else if (n || !t) return e.id = null, e.body = this.finishPlaceholder(a, "ClassBody"), this.finishNode(e, r);
|
|
7686
|
-
else throw this.raise(
|
|
7686
|
+
else throw this.raise(_n.ClassNameIsRequired, this.state.startLoc);
|
|
7687
7687
|
} else this.parseClassId(e, t, n);
|
|
7688
7688
|
return super.parseClassSuper(e), e.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!e.superClass, i), this.finishNode(e, r);
|
|
7689
7689
|
}
|
|
@@ -7699,7 +7699,7 @@ var gn = h`placeholders`({
|
|
|
7699
7699
|
isExportDefaultSpecifier() {
|
|
7700
7700
|
if (this.match(61)) {
|
|
7701
7701
|
let e = this.nextTokenStart();
|
|
7702
|
-
if (this.isUnparsedContextual(e, "from") && this.input.startsWith(
|
|
7702
|
+
if (this.isUnparsedContextual(e, "from") && this.input.startsWith(k(129), this.nextTokenStartSince(e + 4))) return !0;
|
|
7703
7703
|
}
|
|
7704
7704
|
return super.isExportDefaultSpecifier();
|
|
7705
7705
|
}
|
|
@@ -7721,13 +7721,13 @@ var gn = h`placeholders`({
|
|
|
7721
7721
|
return this.parsePlaceholder("StringLiteral") || super.parseImportSource();
|
|
7722
7722
|
}
|
|
7723
7723
|
assertNoSpace() {
|
|
7724
|
-
this.state.start > this.offsetToSourcePos(this.state.lastTokEndLoc.index) && this.raise(
|
|
7724
|
+
this.state.start > this.offsetToSourcePos(this.state.lastTokEndLoc.index) && this.raise(_n.UnexpectedSpace, this.state.lastTokEndLoc);
|
|
7725
7725
|
}
|
|
7726
|
-
},
|
|
7726
|
+
}, yn = (e) => class extends e {
|
|
7727
7727
|
parseV8Intrinsic() {
|
|
7728
7728
|
if (this.match(50)) {
|
|
7729
7729
|
let e = this.state.startLoc, t = this.startNode();
|
|
7730
|
-
if (this.next(),
|
|
7730
|
+
if (this.next(), E(this.state.type)) {
|
|
7731
7731
|
let e = this.parseIdentifierName(), n = this.createIdentifier(t, e);
|
|
7732
7732
|
if (this.castNodeTo(n, "V8IntrinsicIdentifier"), this.match(6)) return n;
|
|
7733
7733
|
}
|
|
@@ -7737,29 +7737,29 @@ var gn = h`placeholders`({
|
|
|
7737
7737
|
parseExprAtom(e) {
|
|
7738
7738
|
return this.parseV8Intrinsic() || super.parseExprAtom(e);
|
|
7739
7739
|
}
|
|
7740
|
-
},
|
|
7740
|
+
}, bn = ["fsharp", "hack"], xn = [
|
|
7741
7741
|
"^^",
|
|
7742
7742
|
"@@",
|
|
7743
7743
|
"^",
|
|
7744
7744
|
"%",
|
|
7745
7745
|
"#"
|
|
7746
7746
|
];
|
|
7747
|
-
function
|
|
7747
|
+
function Sn(e) {
|
|
7748
7748
|
if (e.has("decorators") && e.has("decorators-legacy")) throw Error("Cannot use the decorators and decorators-legacy plugin together");
|
|
7749
7749
|
if (e.has("flow") && e.has("typescript")) throw Error("Cannot combine flow and typescript plugins.");
|
|
7750
7750
|
if (e.has("placeholders") && e.has("v8intrinsic")) throw Error("Cannot combine placeholders and v8intrinsic plugins.");
|
|
7751
7751
|
if (e.has("pipelineOperator")) {
|
|
7752
7752
|
let t = e.get("pipelineOperator").proposal;
|
|
7753
|
-
if (!
|
|
7754
|
-
let e =
|
|
7753
|
+
if (!bn.includes(t)) {
|
|
7754
|
+
let e = bn.map((e) => `"${e}"`).join(", ");
|
|
7755
7755
|
throw Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${e}.`);
|
|
7756
7756
|
}
|
|
7757
7757
|
if (t === "hack") {
|
|
7758
7758
|
if (e.has("placeholders")) throw Error("Cannot combine placeholders plugin and Hack-style pipes.");
|
|
7759
7759
|
if (e.has("v8intrinsic")) throw Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");
|
|
7760
7760
|
let t = e.get("pipelineOperator").topicToken;
|
|
7761
|
-
if (!
|
|
7762
|
-
let e =
|
|
7761
|
+
if (!xn.includes(t)) {
|
|
7762
|
+
let e = xn.map((e) => `"${e}"`).join(", ");
|
|
7763
7763
|
throw Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${e}.`);
|
|
7764
7764
|
}
|
|
7765
7765
|
}
|
|
@@ -7776,14 +7776,14 @@ function xn(e) {
|
|
|
7776
7776
|
if (e.has("decimal")) throw Error("The 'decimal' plugin has been removed in Babel 8. Please remove it from your configuration.");
|
|
7777
7777
|
if (e.has("importReflection")) throw Error("The 'importReflection' plugin has been removed in Babel 8. Use 'sourcePhaseImports' instead, and replace 'import module' with 'import source' in your code.");
|
|
7778
7778
|
}
|
|
7779
|
-
var
|
|
7779
|
+
var Cn = {
|
|
7780
7780
|
estree: ne,
|
|
7781
|
-
jsx:
|
|
7782
|
-
flow:
|
|
7783
|
-
typescript:
|
|
7784
|
-
v8intrinsic:
|
|
7785
|
-
placeholders:
|
|
7786
|
-
},
|
|
7781
|
+
jsx: ft,
|
|
7782
|
+
flow: at,
|
|
7783
|
+
typescript: dn,
|
|
7784
|
+
v8intrinsic: yn,
|
|
7785
|
+
placeholders: vn
|
|
7786
|
+
}, wn = Object.keys(Cn), Tn = class extends nn {
|
|
7787
7787
|
constructor(e, t, n) {
|
|
7788
7788
|
let r = te(e);
|
|
7789
7789
|
super(r, t), this.options = r, this.initializeScopes(), this.plugins = n, this.filename = r.sourceFilename, this.startIndex = r.startIndex;
|
|
@@ -7791,7 +7791,7 @@ var Sn = {
|
|
|
7791
7791
|
r.allowAwaitOutsideFunction && (i |= 1), r.allowReturnOutsideFunction && (i |= 2), r.allowImportExportEverywhere && (i |= 8), r.allowSuperOutsideMethod && (i |= 16), r.allowUndeclaredExports && (i |= 64), r.allowNewTargetOutsideFunction && (i |= 4), r.allowYieldOutsideFunction && (i |= 32), r.ranges && (i |= 128), r.locations === !0 && (i |= 256), r.tokens && (i |= 512), r.createImportExpressions && (i |= 1024), r.createParenthesizedExpressions && (i |= 2048), r.errorRecovery && (i |= 4096), r.attachComment && (i |= 8192), r.annexB && (i |= 16384), this.optionFlags = i;
|
|
7792
7792
|
}
|
|
7793
7793
|
getScopeHandler() {
|
|
7794
|
-
return
|
|
7794
|
+
return Xe;
|
|
7795
7795
|
}
|
|
7796
7796
|
parse() {
|
|
7797
7797
|
this.enterInitialScopes();
|
|
@@ -7801,103 +7801,109 @@ var Sn = {
|
|
|
7801
7801
|
return n.errors = this.state.errors, n.comments.length = this.state.commentsLen, n;
|
|
7802
7802
|
}
|
|
7803
7803
|
};
|
|
7804
|
-
function
|
|
7804
|
+
function En(e, t) {
|
|
7805
7805
|
if (t?.sourceType === "unambiguous") {
|
|
7806
7806
|
t = { ...t };
|
|
7807
7807
|
try {
|
|
7808
7808
|
t.sourceType = "module";
|
|
7809
|
-
let n =
|
|
7809
|
+
let n = On(t, e), r = n.parse();
|
|
7810
7810
|
if (n.sawUnambiguousESM) return r;
|
|
7811
7811
|
if (n.ambiguousScriptDifferentAst) try {
|
|
7812
|
-
return t.sourceType = "script",
|
|
7812
|
+
return t.sourceType = "script", On(t, e).parse();
|
|
7813
7813
|
} catch {}
|
|
7814
7814
|
else r.program.sourceType = "script";
|
|
7815
7815
|
return r;
|
|
7816
7816
|
} catch (n) {
|
|
7817
7817
|
try {
|
|
7818
|
-
return t.sourceType = "script",
|
|
7818
|
+
return t.sourceType = "script", On(t, e).parse();
|
|
7819
7819
|
} catch {}
|
|
7820
7820
|
throw n;
|
|
7821
7821
|
}
|
|
7822
7822
|
}
|
|
7823
|
-
return
|
|
7823
|
+
return On(t, e).parse();
|
|
7824
7824
|
}
|
|
7825
|
-
function
|
|
7825
|
+
function Dn(e) {
|
|
7826
7826
|
let t = {};
|
|
7827
|
-
for (let n of Object.keys(e)) t[n] =
|
|
7827
|
+
for (let n of Object.keys(e)) t[n] = Ae(e[n]);
|
|
7828
7828
|
return t;
|
|
7829
7829
|
}
|
|
7830
|
-
|
|
7831
|
-
function
|
|
7832
|
-
let n =
|
|
7830
|
+
Dn(me);
|
|
7831
|
+
function On(e, t) {
|
|
7832
|
+
let n = Tn, r = /* @__PURE__ */ new Map();
|
|
7833
7833
|
if (e?.plugins) {
|
|
7834
7834
|
for (let t of e.plugins) {
|
|
7835
7835
|
let e, n;
|
|
7836
7836
|
typeof t == "string" ? e = t : [e, n] = t, r.has(e) || r.set(e, n || {});
|
|
7837
7837
|
}
|
|
7838
|
-
|
|
7838
|
+
Sn(r), n = An(r);
|
|
7839
7839
|
}
|
|
7840
7840
|
return new n(e, t, r);
|
|
7841
7841
|
}
|
|
7842
|
-
var
|
|
7843
|
-
function
|
|
7842
|
+
var kn = /* @__PURE__ */ new Map();
|
|
7843
|
+
function An(e) {
|
|
7844
7844
|
let t = [];
|
|
7845
|
-
for (let n of
|
|
7846
|
-
let n = t.join("|"), r =
|
|
7845
|
+
for (let n of wn) e.has(n) && t.push(n);
|
|
7846
|
+
let n = t.join("|"), r = kn.get(n);
|
|
7847
7847
|
if (!r) {
|
|
7848
|
-
r =
|
|
7849
|
-
for (let e of t) r =
|
|
7850
|
-
|
|
7848
|
+
r = Tn;
|
|
7849
|
+
for (let e of t) r = Cn[e](r);
|
|
7850
|
+
kn.set(n, r);
|
|
7851
7851
|
}
|
|
7852
7852
|
return r;
|
|
7853
7853
|
}
|
|
7854
|
-
var
|
|
7854
|
+
var jn = {
|
|
7855
7855
|
platformExports: /* @__PURE__ */ new Set(["engineContract", "identity"]),
|
|
7856
7856
|
platformModule: "open-flow:platform",
|
|
7857
7857
|
platformSource: `export const engineContract = ${JSON.stringify("open-flow-engine/v1")}
|
|
7858
7858
|
export function identity(value) { return value }
|
|
7859
7859
|
`
|
|
7860
7860
|
};
|
|
7861
|
-
function
|
|
7862
|
-
return e == "open-flow-engine/v1" ?
|
|
7861
|
+
function Mn(e) {
|
|
7862
|
+
return e == "open-flow-engine/v1" ? jn : void 0;
|
|
7863
7863
|
}
|
|
7864
7864
|
//#endregion
|
|
7865
7865
|
//#region src/flow/common/change.ts
|
|
7866
|
-
function
|
|
7867
|
-
return
|
|
7866
|
+
function Nn(e) {
|
|
7867
|
+
return e.length <= 256 && /^[A-Za-z_][A-Za-z0-9_]*$/.test(e) && e.slice(0, 3).toUpperCase() != "OO_";
|
|
7868
|
+
}
|
|
7869
|
+
function U(e) {
|
|
7870
|
+
return Object.fromEntries(e.flatMap((e) => "handle" in e ? [[e.handle, e]] : []));
|
|
7868
7871
|
}
|
|
7869
7872
|
//#endregion
|
|
7870
7873
|
//#region src/flow/common/encoding.ts
|
|
7871
|
-
var
|
|
7872
|
-
function
|
|
7874
|
+
var Pn = new TextEncoder();
|
|
7875
|
+
function Fn(e) {
|
|
7873
7876
|
if (e == null || typeof e == "boolean" || typeof e == "string" || typeof e == "number") return JSON.stringify(e);
|
|
7874
|
-
if (Array.isArray(e)) return `[${e.map(
|
|
7877
|
+
if (Array.isArray(e)) return `[${e.map(Fn).join(",")}]`;
|
|
7875
7878
|
let t = e;
|
|
7876
|
-
return `{${Object.keys(t).toSorted().map((e) => `${JSON.stringify(e)}:${
|
|
7879
|
+
return `{${Object.keys(t).toSorted().map((e) => `${JSON.stringify(e)}:${Fn(t[e])}`).join(",")}}`;
|
|
7877
7880
|
}
|
|
7878
|
-
function
|
|
7879
|
-
return
|
|
7881
|
+
function In(e) {
|
|
7882
|
+
return Pn.encode(Fn(e));
|
|
7880
7883
|
}
|
|
7881
|
-
async function
|
|
7884
|
+
async function Ln(e) {
|
|
7882
7885
|
let t = new Uint8Array(e.byteLength);
|
|
7883
7886
|
return t.set(e), `sha256:${[...new Uint8Array(await crypto.subtle.digest("SHA-256", t))].map((e) => e.toString(16).padStart(2, "0")).join("")}`;
|
|
7884
7887
|
}
|
|
7885
|
-
function
|
|
7888
|
+
function Rn(e) {
|
|
7886
7889
|
return Object.keys(e).toSorted().map((t) => [t, e[t]]);
|
|
7887
7890
|
}
|
|
7888
|
-
function
|
|
7889
|
-
return {
|
|
7891
|
+
function zn(e) {
|
|
7892
|
+
return "handle" in e ? {
|
|
7890
7893
|
...e.description == null ? {} : { description: e.description },
|
|
7891
7894
|
handle: e.handle,
|
|
7892
7895
|
jsonSchema: e.jsonSchema,
|
|
7893
7896
|
nullable: e.nullable,
|
|
7894
7897
|
...Object.hasOwn(e, "value") ? { value: e.value } : {}
|
|
7898
|
+
} : e.collapsed == null ? { group: e.group } : {
|
|
7899
|
+
collapsed: e.collapsed,
|
|
7900
|
+
group: e.group
|
|
7895
7901
|
};
|
|
7896
7902
|
}
|
|
7897
|
-
function
|
|
7898
|
-
return e.map(
|
|
7903
|
+
function W(e) {
|
|
7904
|
+
return e.map(zn);
|
|
7899
7905
|
}
|
|
7900
|
-
function
|
|
7906
|
+
function Bn(e) {
|
|
7901
7907
|
switch (e.kind) {
|
|
7902
7908
|
case "sources": return {
|
|
7903
7909
|
kind: e.kind,
|
|
@@ -7909,10 +7915,10 @@ function Rn(e) {
|
|
|
7909
7915
|
};
|
|
7910
7916
|
}
|
|
7911
7917
|
}
|
|
7912
|
-
function
|
|
7913
|
-
return Object.fromEntries(
|
|
7918
|
+
function Vn(e) {
|
|
7919
|
+
return Object.fromEntries(Rn(e).map(([e, t]) => [e, Bn(t)]));
|
|
7914
7920
|
}
|
|
7915
|
-
function
|
|
7921
|
+
function Hn(e) {
|
|
7916
7922
|
return e.map((e) => ({
|
|
7917
7923
|
...e.description == null ? {} : { description: e.description },
|
|
7918
7924
|
handle: e.handle,
|
|
@@ -7921,13 +7927,13 @@ function Bn(e) {
|
|
|
7921
7927
|
sources: e.sources.map((e) => ({ ...e }))
|
|
7922
7928
|
}));
|
|
7923
7929
|
}
|
|
7924
|
-
function
|
|
7925
|
-
if (!("inputs" in e)) return
|
|
7930
|
+
function Un(e) {
|
|
7931
|
+
if (!("inputs" in e)) return Xn(e);
|
|
7926
7932
|
let t = {
|
|
7927
7933
|
concurrency: e.concurrency,
|
|
7928
7934
|
...e.description == null ? {} : { description: e.description },
|
|
7929
7935
|
...e.icon == null ? {} : { icon: e.icon },
|
|
7930
|
-
inputs:
|
|
7936
|
+
inputs: Vn(e.inputs),
|
|
7931
7937
|
...e.name == null ? {} : { name: e.name },
|
|
7932
7938
|
...e.timeoutMs == null ? {} : { timeoutMs: e.timeoutMs }
|
|
7933
7939
|
};
|
|
@@ -7946,7 +7952,7 @@ function Vn(e) {
|
|
|
7946
7952
|
...e.defaultOutput == null ? {} : { defaultOutput: e.defaultOutput },
|
|
7947
7953
|
input: {
|
|
7948
7954
|
handle: e.input.handle,
|
|
7949
|
-
...
|
|
7955
|
+
...zn(e.input)
|
|
7950
7956
|
},
|
|
7951
7957
|
kind: e.kind
|
|
7952
7958
|
};
|
|
@@ -7962,40 +7968,40 @@ function Vn(e) {
|
|
|
7962
7968
|
} : {
|
|
7963
7969
|
...t,
|
|
7964
7970
|
kind: e.kind,
|
|
7965
|
-
task:
|
|
7971
|
+
task: Kn(e.task)
|
|
7966
7972
|
};
|
|
7967
7973
|
case "value": return {
|
|
7968
7974
|
...t,
|
|
7969
7975
|
kind: e.kind,
|
|
7970
|
-
values:
|
|
7976
|
+
values: W(e.values)
|
|
7971
7977
|
};
|
|
7972
7978
|
}
|
|
7973
7979
|
}
|
|
7974
|
-
function
|
|
7975
|
-
return { nodes: Object.fromEntries(
|
|
7980
|
+
function Wn(e) {
|
|
7981
|
+
return { nodes: Object.fromEntries(Rn(e.nodes).map(([e, t]) => [e, Un(t)])) };
|
|
7976
7982
|
}
|
|
7977
|
-
function
|
|
7983
|
+
function Gn(e) {
|
|
7978
7984
|
return {
|
|
7979
7985
|
executor: e.executor,
|
|
7980
|
-
inputs:
|
|
7986
|
+
inputs: W(e.inputs),
|
|
7981
7987
|
name: e.name,
|
|
7982
|
-
outputs:
|
|
7988
|
+
outputs: W(e.outputs)
|
|
7983
7989
|
};
|
|
7984
7990
|
}
|
|
7985
|
-
function
|
|
7991
|
+
function Kn(e) {
|
|
7986
7992
|
return {
|
|
7987
7993
|
...e.capabilities == null ? {} : { capabilities: e.capabilities.map(({ action: e, connectionId: t, kind: n }) => ({
|
|
7988
7994
|
action: e,
|
|
7989
7995
|
connectionId: t,
|
|
7990
7996
|
kind: n
|
|
7991
7997
|
})) },
|
|
7992
|
-
inputs:
|
|
7998
|
+
inputs: W(e.inputs),
|
|
7993
7999
|
moduleId: e.moduleId,
|
|
7994
8000
|
name: e.name,
|
|
7995
|
-
outputs:
|
|
8001
|
+
outputs: W(e.outputs)
|
|
7996
8002
|
};
|
|
7997
8003
|
}
|
|
7998
|
-
function
|
|
8004
|
+
function qn(e) {
|
|
7999
8005
|
return {
|
|
8000
8006
|
configSchema: e.configSchema,
|
|
8001
8007
|
definitionVersion: e.definitionVersion,
|
|
@@ -8017,7 +8023,7 @@ function Gn(e) {
|
|
|
8017
8023
|
type: e.type
|
|
8018
8024
|
};
|
|
8019
8025
|
}
|
|
8020
|
-
function
|
|
8026
|
+
function Jn(e) {
|
|
8021
8027
|
return {
|
|
8022
8028
|
...e.allowedMethods == null ? {} : { allowedMethods: e.allowedMethods },
|
|
8023
8029
|
...e.allowedOrigins == null ? {} : { allowedOrigins: e.allowedOrigins },
|
|
@@ -8027,7 +8033,7 @@ function Kn(e) {
|
|
|
8027
8033
|
...e.responseStatusCode == null ? {} : { responseStatusCode: e.responseStatusCode }
|
|
8028
8034
|
};
|
|
8029
8035
|
}
|
|
8030
|
-
function
|
|
8036
|
+
function Yn(e) {
|
|
8031
8037
|
switch (e.type) {
|
|
8032
8038
|
case "cron": return {
|
|
8033
8039
|
expression: e.expression,
|
|
@@ -8041,7 +8047,7 @@ function qn(e) {
|
|
|
8041
8047
|
};
|
|
8042
8048
|
}
|
|
8043
8049
|
}
|
|
8044
|
-
function
|
|
8050
|
+
function Xn(e) {
|
|
8045
8051
|
let t = (t) => ({
|
|
8046
8052
|
...e.description == null ? {} : { description: e.description },
|
|
8047
8053
|
...e.icon == null ? {} : { icon: e.icon },
|
|
@@ -8053,30 +8059,30 @@ function Jn(e) {
|
|
|
8053
8059
|
...t(e.kind),
|
|
8054
8060
|
inputsDef: e.inputsDef.map((e) => ({
|
|
8055
8061
|
handle: e.handle,
|
|
8056
|
-
...
|
|
8062
|
+
...zn(e)
|
|
8057
8063
|
})),
|
|
8058
|
-
...e.options == null ? {} : { options:
|
|
8064
|
+
...e.options == null ? {} : { options: Jn(e.options) }
|
|
8059
8065
|
};
|
|
8060
8066
|
case "cron": return {
|
|
8061
8067
|
...t(e.kind),
|
|
8062
|
-
cronTimes: e.cronTimes.map(
|
|
8068
|
+
cronTimes: e.cronTimes.map(Yn)
|
|
8063
8069
|
};
|
|
8064
8070
|
case "poll": return {
|
|
8065
8071
|
...t(e.kind),
|
|
8066
8072
|
bindingId: e.bindingId,
|
|
8067
8073
|
config: e.config,
|
|
8068
|
-
definition:
|
|
8069
|
-
pollTimes: e.pollTimes.map(
|
|
8074
|
+
definition: qn(e.definition),
|
|
8075
|
+
pollTimes: e.pollTimes.map(Yn)
|
|
8070
8076
|
};
|
|
8071
8077
|
case "integration": return {
|
|
8072
8078
|
...t(e.kind),
|
|
8073
8079
|
bindingId: e.bindingId,
|
|
8074
8080
|
config: e.config,
|
|
8075
|
-
definition:
|
|
8081
|
+
definition: qn(e.definition)
|
|
8076
8082
|
};
|
|
8077
8083
|
}
|
|
8078
8084
|
}
|
|
8079
|
-
function
|
|
8085
|
+
function Zn(e) {
|
|
8080
8086
|
return {
|
|
8081
8087
|
imports: e.imports.toSorted(),
|
|
8082
8088
|
name: e.name,
|
|
@@ -8085,10 +8091,10 @@ function Yn(e) {
|
|
|
8085
8091
|
}
|
|
8086
8092
|
//#endregion
|
|
8087
8093
|
//#region src/flow/common/semantics.ts
|
|
8088
|
-
function
|
|
8094
|
+
function Qn(e) {
|
|
8089
8095
|
return Object.keys(e).toSorted().map((t) => [t, e[t]]);
|
|
8090
8096
|
}
|
|
8091
|
-
async function
|
|
8097
|
+
async function $n(e) {
|
|
8092
8098
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
8093
8099
|
function o(e) {
|
|
8094
8100
|
t.add(e);
|
|
@@ -8103,7 +8109,7 @@ async function Zn(e) {
|
|
|
8103
8109
|
for (let t of Object.values(e)) if (t.kind == "sources") for (let e of t.sources) e.kind == "binding" && (n.add(e.bindingId), o(e.bindingId));
|
|
8104
8110
|
}
|
|
8105
8111
|
function l(e) {
|
|
8106
|
-
for (let [, t] of
|
|
8112
|
+
for (let [, t] of Qn(e.nodes)) switch ("inputs" in t && c(t.inputs), t.kind) {
|
|
8107
8113
|
case "condition": break;
|
|
8108
8114
|
case "subflow":
|
|
8109
8115
|
u(t.subflowId);
|
|
@@ -8123,20 +8129,20 @@ async function Zn(e) {
|
|
|
8123
8129
|
n != null && l(n.graph);
|
|
8124
8130
|
}
|
|
8125
8131
|
l(e.document.graph);
|
|
8126
|
-
let d =
|
|
8132
|
+
let d = In({
|
|
8127
8133
|
bindings: Object.fromEntries([...t].toSorted().map((t) => [t, e.document.bindings[t] ?? null])),
|
|
8128
|
-
graph:
|
|
8134
|
+
graph: Wn(e.document.graph),
|
|
8129
8135
|
kind: "open-flow-semantic-closure",
|
|
8130
8136
|
modelVersion: e.modelVersion,
|
|
8131
|
-
modules: Object.fromEntries([...r].toSorted().map((t) => [t, e.modules[t] == null ? null :
|
|
8132
|
-
tasks: Object.fromEntries([...a].toSorted().map((t) => [t, e.document.tasks[t] == null ? null :
|
|
8137
|
+
modules: Object.fromEntries([...r].toSorted().map((t) => [t, e.modules[t] == null ? null : Zn(e.modules[t])])),
|
|
8138
|
+
tasks: Object.fromEntries([...a].toSorted().map((t) => [t, e.document.tasks[t] == null ? null : Gn(e.document.tasks[t])])),
|
|
8133
8139
|
subflows: Object.fromEntries([...i].toSorted().map((t) => {
|
|
8134
8140
|
let n = e.document.subflows[t];
|
|
8135
8141
|
return n == null ? [t, null] : [t, {
|
|
8136
|
-
graph:
|
|
8137
|
-
inputs:
|
|
8142
|
+
graph: Wn(n.graph),
|
|
8143
|
+
inputs: W(n.inputs),
|
|
8138
8144
|
name: n.name,
|
|
8139
|
-
outputs:
|
|
8145
|
+
outputs: Hn(n.outputs)
|
|
8140
8146
|
}];
|
|
8141
8147
|
})),
|
|
8142
8148
|
version: 1
|
|
@@ -8149,10 +8155,16 @@ async function Zn(e) {
|
|
|
8149
8155
|
subflows: i,
|
|
8150
8156
|
tasks: a
|
|
8151
8157
|
},
|
|
8152
|
-
digest: await
|
|
8158
|
+
digest: await Ln(d)
|
|
8153
8159
|
};
|
|
8154
8160
|
}
|
|
8155
|
-
function
|
|
8161
|
+
function er(e, t) {
|
|
8162
|
+
return Object.fromEntries([...t].flatMap((t) => {
|
|
8163
|
+
let n = e.document.bindings[t];
|
|
8164
|
+
return n?.kind == "variable" ? [[t, n.target]] : [];
|
|
8165
|
+
}));
|
|
8166
|
+
}
|
|
8167
|
+
function tr(e) {
|
|
8156
8168
|
return e.kind == "poll" || e.kind == "integration" ? e.definition.payloadSchema : e.kind == "cron" ? {
|
|
8157
8169
|
additionalProperties: !1,
|
|
8158
8170
|
type: "object"
|
|
@@ -8163,39 +8175,39 @@ function Qn(e) {
|
|
|
8163
8175
|
type: "object"
|
|
8164
8176
|
};
|
|
8165
8177
|
}
|
|
8166
|
-
function
|
|
8178
|
+
function G(e) {
|
|
8167
8179
|
return {
|
|
8168
8180
|
column: e.loc?.start.column ?? 0,
|
|
8169
8181
|
line: e.loc?.start.line ?? 1
|
|
8170
8182
|
};
|
|
8171
8183
|
}
|
|
8172
|
-
function
|
|
8184
|
+
function K(e) {
|
|
8173
8185
|
return `/modules/${e}/source`;
|
|
8174
8186
|
}
|
|
8175
|
-
function
|
|
8187
|
+
function q(e, t) {
|
|
8176
8188
|
if (typeof e != "object" || !e) return;
|
|
8177
8189
|
let n = e;
|
|
8178
8190
|
if (n.type == "Identifier" && typeof n.name == "string") t.add(n.name);
|
|
8179
|
-
else if (n.type == "RestElement")
|
|
8180
|
-
else if (n.type == "AssignmentPattern")
|
|
8181
|
-
else if (n.type == "ArrayPattern") for (let e of n.elements ?? [])
|
|
8191
|
+
else if (n.type == "RestElement") q(n.argument, t);
|
|
8192
|
+
else if (n.type == "AssignmentPattern") q(n.left, t);
|
|
8193
|
+
else if (n.type == "ArrayPattern") for (let e of n.elements ?? []) q(e, t);
|
|
8182
8194
|
else if (n.type == "ObjectPattern") for (let e of n.properties ?? []) {
|
|
8183
8195
|
let n = e;
|
|
8184
|
-
|
|
8196
|
+
q(n.type == "RestElement" ? n.argument : n.value, t);
|
|
8185
8197
|
}
|
|
8186
8198
|
}
|
|
8187
|
-
function
|
|
8199
|
+
function nr(e) {
|
|
8188
8200
|
if (typeof e != "object" || !e) return;
|
|
8189
8201
|
let t = e;
|
|
8190
8202
|
if (t.type == "Identifier" && typeof t.name == "string") return t.name;
|
|
8191
8203
|
if (t.type == "StringLiteral" && typeof t.value == "string") return t.value;
|
|
8192
8204
|
}
|
|
8193
|
-
function
|
|
8205
|
+
function rr(e, t, n) {
|
|
8194
8206
|
let r;
|
|
8195
8207
|
try {
|
|
8196
|
-
r =
|
|
8208
|
+
r = En(t, {
|
|
8197
8209
|
createImportExpressions: !0,
|
|
8198
|
-
sourceFilename:
|
|
8210
|
+
sourceFilename: K(e),
|
|
8199
8211
|
sourceType: "module"
|
|
8200
8212
|
}).program;
|
|
8201
8213
|
} catch (t) {
|
|
@@ -8205,7 +8217,8 @@ function er(e, t, n) {
|
|
|
8205
8217
|
column: typeof r == "object" && r && typeof Reflect.get(r, "column") == "number" ? Reflect.get(r, "column") : 0,
|
|
8206
8218
|
line: typeof r == "object" && r && typeof Reflect.get(r, "line") == "number" ? Reflect.get(r, "line") : 1,
|
|
8207
8219
|
message: `CodeModule "${e}" contains invalid JavaScript syntax.`,
|
|
8208
|
-
path:
|
|
8220
|
+
path: K(e),
|
|
8221
|
+
values: { moduleId: e }
|
|
8209
8222
|
});
|
|
8210
8223
|
return;
|
|
8211
8224
|
}
|
|
@@ -8215,11 +8228,11 @@ function er(e, t, n) {
|
|
|
8215
8228
|
let e = t.specifiers.flatMap((e) => {
|
|
8216
8229
|
if (e.type == "ImportNamespaceSpecifier") return [];
|
|
8217
8230
|
if (e.type == "ImportDefaultSpecifier") return ["default"];
|
|
8218
|
-
let t =
|
|
8231
|
+
let t = nr(e.imported);
|
|
8219
8232
|
return t == null ? [] : [t];
|
|
8220
8233
|
});
|
|
8221
8234
|
a.push({
|
|
8222
|
-
...
|
|
8235
|
+
...G(t.source),
|
|
8223
8236
|
imported: e,
|
|
8224
8237
|
specifier: t.source.value
|
|
8225
8238
|
});
|
|
@@ -8233,16 +8246,20 @@ function er(e, t, n) {
|
|
|
8233
8246
|
if (t.source != null) {
|
|
8234
8247
|
n.push({
|
|
8235
8248
|
code: "module.unsupported-import",
|
|
8236
|
-
...
|
|
8249
|
+
...G(t.source),
|
|
8237
8250
|
message: `CodeModule "${e}" must import before re-exporting values.`,
|
|
8238
|
-
path:
|
|
8251
|
+
path: K(e),
|
|
8252
|
+
values: {
|
|
8253
|
+
moduleId: e,
|
|
8254
|
+
variant: "reexport"
|
|
8255
|
+
}
|
|
8239
8256
|
});
|
|
8240
8257
|
continue;
|
|
8241
8258
|
}
|
|
8242
|
-
if (t.declaration?.type == "VariableDeclaration") for (let e of t.declaration.declarations)
|
|
8259
|
+
if (t.declaration?.type == "VariableDeclaration") for (let e of t.declaration.declarations) q(e.id, i);
|
|
8243
8260
|
else (t.declaration?.type == "FunctionDeclaration" || t.declaration?.type == "ClassDeclaration") && t.declaration.id != null && i.add(t.declaration.id.name);
|
|
8244
8261
|
for (let e of t.specifiers) {
|
|
8245
|
-
let t =
|
|
8262
|
+
let t = nr(e.exported);
|
|
8246
8263
|
t != null && i.add(t);
|
|
8247
8264
|
}
|
|
8248
8265
|
}
|
|
@@ -8256,19 +8273,22 @@ function er(e, t, n) {
|
|
|
8256
8273
|
let r = t, i = r.callee;
|
|
8257
8274
|
r.type == "ImportExpression" || r.type == "CallExpression" && i?.type == "Import" ? n.push({
|
|
8258
8275
|
code: "module.dynamic-import",
|
|
8259
|
-
...
|
|
8276
|
+
...G(r),
|
|
8260
8277
|
message: `CodeModule "${e}" cannot use dynamic import.`,
|
|
8261
|
-
path:
|
|
8278
|
+
path: K(e),
|
|
8279
|
+
values: { moduleId: e }
|
|
8262
8280
|
}) : r.type == "CallExpression" && i?.type == "Identifier" && i.name == "require" ? n.push({
|
|
8263
8281
|
code: "module.commonjs",
|
|
8264
|
-
...
|
|
8282
|
+
...G(r),
|
|
8265
8283
|
message: `CodeModule "${e}" cannot use CommonJS require.`,
|
|
8266
|
-
path:
|
|
8284
|
+
path: K(e),
|
|
8285
|
+
values: { moduleId: e }
|
|
8267
8286
|
}) : (r.type == "CallExpression" && i?.type == "Identifier" && (i.name == "eval" || i.name == "Function") || r.type == "NewExpression" && i?.type == "Identifier" && i.name == "Function") && n.push({
|
|
8268
8287
|
code: "module.dynamic-code",
|
|
8269
|
-
...
|
|
8288
|
+
...G(r),
|
|
8270
8289
|
message: `CodeModule "${e}" cannot evaluate dynamic code.`,
|
|
8271
|
-
path:
|
|
8290
|
+
path: K(e),
|
|
8291
|
+
values: { moduleId: e }
|
|
8272
8292
|
});
|
|
8273
8293
|
for (let [e, t] of Object.entries(r)) e != "loc" && e != "tokens" && e != "comments" && o(t);
|
|
8274
8294
|
};
|
|
@@ -8277,39 +8297,40 @@ function er(e, t, n) {
|
|
|
8277
8297
|
imports: a
|
|
8278
8298
|
};
|
|
8279
8299
|
}
|
|
8280
|
-
function
|
|
8300
|
+
function ir(e) {
|
|
8281
8301
|
return /^\.\/(.+)\.mjs$/.exec(e)?.[1];
|
|
8282
8302
|
}
|
|
8283
|
-
function
|
|
8303
|
+
function ar(e, t) {
|
|
8284
8304
|
return e < t ? -1 : +(e > t);
|
|
8285
8305
|
}
|
|
8286
|
-
function
|
|
8287
|
-
return
|
|
8306
|
+
function or(e, t) {
|
|
8307
|
+
return ar(e.path, t.path) || e.line - t.line || e.column - t.column || ar(e.code, t.code) || ar(e.message, t.message);
|
|
8288
8308
|
}
|
|
8289
|
-
function
|
|
8309
|
+
function J(e, t, n, r) {
|
|
8290
8310
|
return {
|
|
8291
8311
|
code: e,
|
|
8292
8312
|
column: 0,
|
|
8293
8313
|
line: 1,
|
|
8294
8314
|
message: t,
|
|
8295
|
-
path: n
|
|
8315
|
+
path: n,
|
|
8316
|
+
...r == null ? {} : { values: r }
|
|
8296
8317
|
};
|
|
8297
8318
|
}
|
|
8298
|
-
function
|
|
8319
|
+
function Y(e, t) {
|
|
8299
8320
|
if (e === t) return !0;
|
|
8300
8321
|
if (e == null || t == null || typeof e != "object" || typeof t != "object") return !1;
|
|
8301
|
-
if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length == t.length && e.every((e, n) =>
|
|
8322
|
+
if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length == t.length && e.every((e, n) => Y(e, t[n]));
|
|
8302
8323
|
let n = Object.entries(e), r = t;
|
|
8303
|
-
return n.length == Object.keys(r).length && n.every(([e, t]) => Object.hasOwn(r, e) &&
|
|
8324
|
+
return n.length == Object.keys(r).length && n.every(([e, t]) => Object.hasOwn(r, e) && Y(t, r[e]));
|
|
8304
8325
|
}
|
|
8305
|
-
function
|
|
8326
|
+
function X(e) {
|
|
8306
8327
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
8307
8328
|
}
|
|
8308
|
-
function
|
|
8329
|
+
function Z(e) {
|
|
8309
8330
|
return Array.isArray(e) ? e : void 0;
|
|
8310
8331
|
}
|
|
8311
|
-
function
|
|
8312
|
-
if (Array.isArray(e)) return e.some((e) =>
|
|
8332
|
+
function sr(e, t) {
|
|
8333
|
+
if (Array.isArray(e)) return e.some((e) => sr(e, t));
|
|
8313
8334
|
switch (e) {
|
|
8314
8335
|
case void 0: return !0;
|
|
8315
8336
|
case "null": return t == null;
|
|
@@ -8322,18 +8343,18 @@ function ir(e, t) {
|
|
|
8322
8343
|
default: return !1;
|
|
8323
8344
|
}
|
|
8324
8345
|
}
|
|
8325
|
-
function
|
|
8346
|
+
function Q(e, t) {
|
|
8326
8347
|
if (typeof t == "boolean") return t;
|
|
8327
|
-
let n =
|
|
8348
|
+
let n = X(t);
|
|
8328
8349
|
if (n == null) return !1;
|
|
8329
|
-
let r =
|
|
8330
|
-
if (r != null && !r.every((t) =>
|
|
8331
|
-
let i =
|
|
8332
|
-
if (i != null && !i.some((t) =>
|
|
8333
|
-
let a =
|
|
8334
|
-
if (a != null && a.filter((t) =>
|
|
8335
|
-
let o =
|
|
8336
|
-
if (o != null && !o.some((t) =>
|
|
8350
|
+
let r = Z(n.allOf);
|
|
8351
|
+
if (r != null && !r.every((t) => Q(e, t))) return !1;
|
|
8352
|
+
let i = Z(n.anyOf);
|
|
8353
|
+
if (i != null && !i.some((t) => Q(e, t))) return !1;
|
|
8354
|
+
let a = Z(n.oneOf);
|
|
8355
|
+
if (a != null && a.filter((t) => Q(e, t)).length != 1 || n.not != null && Q(e, n.not) || n.const != null && !Y(e, n.const)) return !1;
|
|
8356
|
+
let o = Z(n.enum);
|
|
8357
|
+
if (o != null && !o.some((t) => Y(e, t)) || !sr(n.type, e)) return !1;
|
|
8337
8358
|
if (typeof e == "string") {
|
|
8338
8359
|
if (typeof n.minLength == "number" && e.length < n.minLength || typeof n.maxLength == "number" && e.length > n.maxLength) return !1;
|
|
8339
8360
|
if (typeof n.pattern == "string") try {
|
|
@@ -8342,148 +8363,190 @@ function $(e, t) {
|
|
|
8342
8363
|
return !1;
|
|
8343
8364
|
}
|
|
8344
8365
|
}
|
|
8345
|
-
if (typeof e == "number" && (typeof n.minimum == "number" && e < n.minimum || typeof n.maximum == "number" && e > n.maximum || typeof n.exclusiveMinimum == "number" && e <= n.exclusiveMinimum || typeof n.exclusiveMaximum == "number" && e >= n.exclusiveMaximum) || Array.isArray(e) && (typeof n.minItems == "number" && e.length < n.minItems || typeof n.maxItems == "number" && e.length > n.maxItems || n.items != null && !e.every((e) =>
|
|
8366
|
+
if (typeof e == "number" && (typeof n.minimum == "number" && e < n.minimum || typeof n.maximum == "number" && e > n.maximum || typeof n.exclusiveMinimum == "number" && e <= n.exclusiveMinimum || typeof n.exclusiveMaximum == "number" && e >= n.exclusiveMaximum) || Array.isArray(e) && (typeof n.minItems == "number" && e.length < n.minItems || typeof n.maxItems == "number" && e.length > n.maxItems || n.items != null && !e.every((e) => Q(e, n.items)))) return !1;
|
|
8346
8367
|
if (typeof e == "object" && e && !Array.isArray(e)) {
|
|
8347
|
-
let t = e, r =
|
|
8368
|
+
let t = e, r = Z(n.required);
|
|
8348
8369
|
if (r != null && r.some((e) => typeof e != "string" || !Object.hasOwn(t, e))) return !1;
|
|
8349
|
-
let i =
|
|
8370
|
+
let i = X(n.properties ?? {});
|
|
8350
8371
|
if (i == null) return !1;
|
|
8351
8372
|
for (let [e, r] of Object.entries(t)) {
|
|
8352
8373
|
let t = i[e];
|
|
8353
8374
|
if (t != null) {
|
|
8354
|
-
if (
|
|
8375
|
+
if (!Q(r, t)) return !1;
|
|
8355
8376
|
} else if (n.additionalProperties === !1) return !1;
|
|
8356
|
-
else if (n.additionalProperties != null && n.additionalProperties !== !0 &&
|
|
8377
|
+
else if (n.additionalProperties != null && n.additionalProperties !== !0 && !Q(r, n.additionalProperties)) return !1;
|
|
8357
8378
|
}
|
|
8358
8379
|
}
|
|
8359
8380
|
return !0;
|
|
8360
8381
|
}
|
|
8361
|
-
function
|
|
8362
|
-
if (e === !0 || t === !0 ||
|
|
8382
|
+
function $(e, t) {
|
|
8383
|
+
if (e === !0 || t === !0 || Y(e, {}) || Y(t, {})) return !0;
|
|
8363
8384
|
if (e === !1 || t === !1) return !1;
|
|
8364
|
-
if (
|
|
8365
|
-
let n =
|
|
8366
|
-
if (n == null || r == null || !
|
|
8367
|
-
let i =
|
|
8385
|
+
if (Y(e, t)) return !0;
|
|
8386
|
+
let n = X(e), r = X(t);
|
|
8387
|
+
if (n == null || r == null || !Y(n.type ?? null, r.type ?? null) || n.type != "object") return !1;
|
|
8388
|
+
let i = X(n.properties ?? {}), a = X(r.properties ?? {}), o = new Set((Z(n.required) ?? []).filter((e) => typeof e == "string")), s = (Z(r.required) ?? []).filter((e) => typeof e == "string");
|
|
8368
8389
|
if (i == null || a == null || s.some((e) => !o.has(e))) return !1;
|
|
8369
8390
|
for (let [e, t] of Object.entries(i)) {
|
|
8370
8391
|
let n = a[e];
|
|
8371
8392
|
if (n != null) {
|
|
8372
|
-
if (
|
|
8393
|
+
if (!$(t, n)) return !1;
|
|
8373
8394
|
} else if (r.additionalProperties === !1) return !1;
|
|
8374
|
-
else if (r.additionalProperties != null && r.additionalProperties !== !0 &&
|
|
8395
|
+
else if (r.additionalProperties != null && r.additionalProperties !== !0 && !$(t, r.additionalProperties)) return !1;
|
|
8375
8396
|
}
|
|
8376
8397
|
return n.additionalProperties === !1 || r.additionalProperties !== !1;
|
|
8377
8398
|
}
|
|
8378
|
-
function
|
|
8399
|
+
function cr(e) {
|
|
8400
|
+
let t = X(e), n = Z(t?.type);
|
|
8401
|
+
return t != null && n?.includes("string") ? $({ type: "string" }, {
|
|
8402
|
+
...t,
|
|
8403
|
+
type: "string"
|
|
8404
|
+
}) : $({ type: "string" }, e);
|
|
8405
|
+
}
|
|
8406
|
+
function lr(e) {
|
|
8407
|
+
if (typeof e != "object" || !e) return !1;
|
|
8408
|
+
let t = e;
|
|
8409
|
+
return t.contentMediaType == "oomol/ref" || Object.values(t).some(lr);
|
|
8410
|
+
}
|
|
8411
|
+
function ur(e, t, n, r, i) {
|
|
8379
8412
|
if (t.kind == "webhook") {
|
|
8380
8413
|
let e = /* @__PURE__ */ new Set();
|
|
8381
|
-
for (let [n, a] of t.inputsDef.entries()) e.has(a.handle) && i.push(
|
|
8414
|
+
for (let [n, a] of t.inputsDef.entries()) e.has(a.handle) && i.push(J("trigger.input-duplicate", `Webhook Trigger input "${a.handle}" is declared more than once.`, `${r}/inputsDef/${n}/handle`, { input: a.handle })), e.add(a.handle);
|
|
8382
8415
|
return;
|
|
8383
8416
|
}
|
|
8384
8417
|
if (t.kind == "cron") return;
|
|
8385
8418
|
let a = n.bindings[t.bindingId];
|
|
8386
|
-
a == null ? i.push(
|
|
8387
|
-
let o =
|
|
8388
|
-
o.length > 0 ? i.push(
|
|
8419
|
+
a == null ? i.push(J("trigger.connection-missing", `Trigger Connection binding "${t.bindingId}" does not exist.`, `${r}/bindingId`, { bindingId: t.bindingId })) : a.kind != "connection" && i.push(J("trigger.connection-invalid", `Trigger binding "${t.bindingId}" must be a Connection.`, `${r}/bindingId`, { bindingId: t.bindingId }));
|
|
8420
|
+
let o = Z(X(t.definition.configSchema)?.required)?.filter((e) => typeof e == "string" && !Object.hasOwn(t.config, e)) ?? [];
|
|
8421
|
+
o.length > 0 ? i.push(J("trigger.config-incomplete", `Complete the required Trigger config fields: ${o.join(", ")}.`, `${r}/config`, { fields: o.join(", ") })) : Q(t.config, t.definition.configSchema) || i.push(J("trigger.config-invalid", `Trigger "${e}" config does not match its fixed definition.`, `${r}/config`, { triggerId: e }));
|
|
8389
8422
|
}
|
|
8390
|
-
function
|
|
8423
|
+
function dr(e, t) {
|
|
8391
8424
|
switch (t.kind) {
|
|
8392
8425
|
case "condition": return { [t.input.handle]: t.input };
|
|
8393
8426
|
case "value": return {};
|
|
8394
|
-
case "subflow": return
|
|
8395
|
-
case "task": return
|
|
8427
|
+
case "subflow": return U(e.subflows[t.subflowId]?.inputs ?? []);
|
|
8428
|
+
case "task": return U(t.task == null ? e.tasks[t.taskId]?.inputs ?? [] : t.task.inputs);
|
|
8396
8429
|
case "cron":
|
|
8397
8430
|
case "integration":
|
|
8398
8431
|
case "poll":
|
|
8399
8432
|
case "webhook": return {};
|
|
8400
8433
|
}
|
|
8401
8434
|
}
|
|
8402
|
-
function
|
|
8435
|
+
function fr(e, t) {
|
|
8403
8436
|
switch (t.kind) {
|
|
8404
8437
|
case "condition": {
|
|
8405
8438
|
let e = [...t.cases.map((e) => e.output), ...t.defaultOutput == null ? [] : [t.defaultOutput]];
|
|
8406
8439
|
return Object.fromEntries(e.map((e) => [e, t.input]));
|
|
8407
8440
|
}
|
|
8408
|
-
case "value": return
|
|
8409
|
-
case "subflow": return
|
|
8410
|
-
case "task": return
|
|
8441
|
+
case "value": return U(t.values);
|
|
8442
|
+
case "subflow": return U(e.subflows[t.subflowId]?.outputs ?? []);
|
|
8443
|
+
case "task": return U(t.task == null ? e.tasks[t.taskId]?.outputs ?? [] : t.task.outputs);
|
|
8411
8444
|
case "cron":
|
|
8412
8445
|
case "integration":
|
|
8413
8446
|
case "poll":
|
|
8414
8447
|
case "webhook": return { payload: {
|
|
8415
|
-
jsonSchema:
|
|
8448
|
+
jsonSchema: tr(t),
|
|
8416
8449
|
nullable: !1
|
|
8417
8450
|
} };
|
|
8418
8451
|
}
|
|
8419
8452
|
}
|
|
8420
|
-
function
|
|
8453
|
+
function pr(e, t, n, r, i, a, o) {
|
|
8421
8454
|
switch (e.kind) {
|
|
8422
8455
|
case "binding":
|
|
8423
|
-
n.bindings[e.bindingId]
|
|
8456
|
+
n.bindings[e.bindingId] == null ? o.push(J("graph.binding-missing", `Binding "${e.bindingId}" does not exist.`, a, { bindingId: e.bindingId })) : n.bindings[e.bindingId].kind == "variable" ? i != null && !cr(i.jsonSchema) && o.push(J("graph.variable-incompatible", `Variable binding "${e.bindingId}" is not compatible with this input.`, a, { bindingId: e.bindingId })) : o.push(J("graph.binding-invalid", `Binding "${e.bindingId}" must be a Variable.`, a, { bindingId: e.bindingId }));
|
|
8424
8457
|
return;
|
|
8425
8458
|
case "flow":
|
|
8426
|
-
r?.has(e.input) != 1 && o.push(
|
|
8459
|
+
r?.has(e.input) != 1 && o.push(J("graph.source-missing", `Flow input "${e.input}" does not exist in this graph.`, a, {
|
|
8460
|
+
input: e.input,
|
|
8461
|
+
variant: "flow-input"
|
|
8462
|
+
}));
|
|
8427
8463
|
return;
|
|
8428
8464
|
case "node": {
|
|
8429
8465
|
let r = t.nodes[e.nodeId];
|
|
8430
8466
|
if (r == null) {
|
|
8431
|
-
o.push(
|
|
8467
|
+
o.push(J("graph.source-missing", `Upstream node "${e.nodeId}" does not exist.`, a, {
|
|
8468
|
+
nodeId: e.nodeId,
|
|
8469
|
+
variant: "node"
|
|
8470
|
+
}));
|
|
8432
8471
|
return;
|
|
8433
8472
|
}
|
|
8434
|
-
let s =
|
|
8435
|
-
s == null ? o.push(
|
|
8473
|
+
let s = fr(n, r)[e.output];
|
|
8474
|
+
s == null ? o.push(J("graph.source-missing", `Upstream node "${e.nodeId}" does not expose output "${e.output}".`, a, {
|
|
8475
|
+
nodeId: e.nodeId,
|
|
8476
|
+
output: e.output,
|
|
8477
|
+
variant: "output"
|
|
8478
|
+
})) : i != null && (!Y(s.jsonSchema, {}) && s.jsonSchema !== !0 && s.nullable && !i.nullable || !$(s.jsonSchema, i.jsonSchema)) && o.push(J("graph.node-output-incompatible", `Upstream node "${e.nodeId}" output "${e.output}" is not compatible with this input.`, a, {
|
|
8479
|
+
nodeId: e.nodeId,
|
|
8480
|
+
output: e.output
|
|
8481
|
+
}));
|
|
8436
8482
|
}
|
|
8437
8483
|
}
|
|
8438
8484
|
}
|
|
8439
|
-
function
|
|
8485
|
+
function mr(e, t) {
|
|
8440
8486
|
let n = /* @__PURE__ */ new Set();
|
|
8441
8487
|
if (!("inputs" in t)) return n;
|
|
8442
8488
|
for (let r of Object.values(t.inputs)) if (r.kind == "sources") for (let t of r.sources) t.kind == "node" && e.nodes[t.nodeId] != null && n.add(t.nodeId);
|
|
8443
8489
|
return n;
|
|
8444
8490
|
}
|
|
8445
|
-
function
|
|
8446
|
-
let r = new Map(Object.entries(e.nodes).map(([t, n]) => [t,
|
|
8491
|
+
function hr(e, t, n) {
|
|
8492
|
+
let r = new Map(Object.entries(e.nodes).map(([t, n]) => [t, mr(e, n)]));
|
|
8447
8493
|
for (; r.size > 0;) {
|
|
8448
8494
|
let e = [...r].filter(([, e]) => e.size == 0).map(([e]) => e);
|
|
8449
8495
|
if (e.length == 0) {
|
|
8450
|
-
|
|
8496
|
+
let e = [...r.keys()].toSorted().join(", ");
|
|
8497
|
+
n.push(J("graph.cycle", `Graph contains a dependency cycle among nodes: ${e}.`, t, { nodes: e }));
|
|
8451
8498
|
return;
|
|
8452
8499
|
}
|
|
8453
8500
|
for (let t of e) r.delete(t);
|
|
8454
8501
|
for (let t of r.values()) for (let n of e) t.delete(n);
|
|
8455
8502
|
}
|
|
8456
8503
|
}
|
|
8457
|
-
function
|
|
8504
|
+
function gr(e, t, n, r, i, a) {
|
|
8458
8505
|
for (let [o, s] of Object.entries(e.nodes)) {
|
|
8459
8506
|
let c = `${i}/nodes/${o}`;
|
|
8460
8507
|
if (!("inputs" in s)) {
|
|
8461
|
-
r ?
|
|
8508
|
+
lr(tr(s)) && a.push(J("graph.schema-unsupported", "Runtime Ref schemas are not supported.", c)), r ? ur(o, s, t, c, a) : a.push(J("graph.trigger-not-allowed", "Trigger nodes are only allowed in Flows.", c));
|
|
8462
8509
|
continue;
|
|
8463
8510
|
}
|
|
8464
|
-
s.kind == "task" && s.task == null && t.tasks[s.taskId] == null ? a.push(
|
|
8465
|
-
|
|
8511
|
+
s.kind == "task" && s.task == null && t.tasks[s.taskId] == null ? a.push(J("graph.target-missing", `Task "${s.taskId}" does not exist.`, `${c}/taskId`, {
|
|
8512
|
+
taskId: s.taskId,
|
|
8513
|
+
variant: "task"
|
|
8514
|
+
})) : s.kind == "subflow" && t.subflows[s.subflowId] == null && a.push(J("graph.target-missing", `Subflow "${s.subflowId}" does not exist.`, `${c}/subflowId`, {
|
|
8515
|
+
subflowId: s.subflowId,
|
|
8516
|
+
variant: "subflow"
|
|
8517
|
+
}));
|
|
8518
|
+
let l = dr(t, s);
|
|
8519
|
+
[...Object.values(l), ...Object.values(fr(t, s))].some((e) => lr(e.jsonSchema)) && a.push(J("graph.schema-unsupported", "Runtime Ref schemas are not supported.", c));
|
|
8520
|
+
let u = new Set(Object.keys(l));
|
|
8466
8521
|
for (let [r, i] of Object.entries(s.inputs)) {
|
|
8467
8522
|
let s = `${c}/inputs/${r}`;
|
|
8468
|
-
if (u.has(r) || a.push(
|
|
8523
|
+
if (u.has(r) || a.push(J("graph.input-missing", `Node "${o}" does not expose input "${r}".`, s, {
|
|
8524
|
+
handle: r,
|
|
8525
|
+
nodeId: o
|
|
8526
|
+
})), i.kind == "sources") {
|
|
8527
|
+
let o = i.sources.filter((e) => e.kind == "binding" && t.bindings[e.bindingId]?.kind == "variable");
|
|
8528
|
+
o.length > 0 && (o.length != 1 || i.sources.length != 1) && a.push(J("graph.variable-source-mixed", "A Variable must be the only source for an input.", s));
|
|
8529
|
+
for (let o of i.sources) pr(o, e, t, n, l[r], s, a);
|
|
8530
|
+
}
|
|
8469
8531
|
}
|
|
8470
8532
|
if (s.kind != "condition") continue;
|
|
8471
8533
|
let d = /* @__PURE__ */ new Set();
|
|
8472
8534
|
for (let [e, t] of s.cases.entries()) {
|
|
8473
|
-
d.has(t.output) && a.push(
|
|
8474
|
-
for (let [n, r] of t.expressions.entries()) r.input != s.input.handle && a.push(
|
|
8535
|
+
d.has(t.output) && a.push(J("condition.output-duplicate", `Condition output "${t.output}" is declared more than once.`, `${c}/cases/${e}/output`, { output: t.output })), d.add(t.output);
|
|
8536
|
+
for (let [n, r] of t.expressions.entries()) r.input != s.input.handle && a.push(J("condition.input-missing", `Condition expression references unknown input "${r.input}".`, `${c}/cases/${e}/expressions/${n}/input`, { input: r.input }));
|
|
8475
8537
|
}
|
|
8476
8538
|
}
|
|
8477
|
-
|
|
8539
|
+
hr(e, i, a);
|
|
8478
8540
|
}
|
|
8479
|
-
function
|
|
8541
|
+
function _r(e, t) {
|
|
8480
8542
|
let n = /* @__PURE__ */ new Set(), r = [];
|
|
8481
8543
|
function i(a, o) {
|
|
8482
8544
|
for (let [s, c] of Object.entries(a.nodes)) {
|
|
8483
8545
|
if (c.kind != "subflow" || e.subflows[c.subflowId] == null) continue;
|
|
8484
8546
|
let a = r.indexOf(c.subflowId);
|
|
8485
8547
|
if (a >= 0) {
|
|
8486
|
-
|
|
8548
|
+
let e = [...r.slice(a), c.subflowId].join(" -> ");
|
|
8549
|
+
t.push(J("subflow.cycle", `Subflow cycle is not executable: ${e}.`, `${o}/nodes/${s}/subflowId`, { subflows: e }));
|
|
8487
8550
|
continue;
|
|
8488
8551
|
}
|
|
8489
8552
|
n.has(c.subflowId) || (n.add(c.subflowId), r.push(c.subflowId), i(e.subflows[c.subflowId].graph, `/document/subflows/${c.subflowId}/graph`), r.pop());
|
|
@@ -8491,38 +8554,39 @@ function pr(e, t) {
|
|
|
8491
8554
|
}
|
|
8492
8555
|
i(e.graph, "/document/graph");
|
|
8493
8556
|
}
|
|
8494
|
-
function
|
|
8557
|
+
function vr(e, t) {
|
|
8495
8558
|
let n = [];
|
|
8496
|
-
|
|
8559
|
+
for (let [t, r] of Object.entries(e.document.bindings)) r.kind == "variable" && !Nn(r.target) && n.push(J("binding.variable-invalid", `Variable binding "${t}" has an invalid target.`, `/document/bindings/${t}/target`, { bindingId: t }));
|
|
8560
|
+
gr(e.document.graph, e.document, void 0, !0, "/document/graph", n);
|
|
8497
8561
|
for (let r of [...t.dependencies.subflows].toSorted()) {
|
|
8498
8562
|
let t = e.document.subflows[r];
|
|
8499
8563
|
if (t == null) continue;
|
|
8500
8564
|
let i = `/document/subflows/${r}`, a = new Set(t.inputs.map((e) => e.handle));
|
|
8501
|
-
|
|
8502
|
-
for (let r of t.outputs) for (let o of r.sources)
|
|
8565
|
+
gr(t.graph, e.document, a, !1, `${i}/graph`, n);
|
|
8566
|
+
for (let r of t.outputs) for (let o of r.sources) pr(o, t.graph, e.document, a, void 0, `${i}/outputs/${r.handle}/sources`, n);
|
|
8503
8567
|
}
|
|
8504
|
-
return
|
|
8568
|
+
return _r(e.document, n), n;
|
|
8505
8569
|
}
|
|
8506
|
-
function
|
|
8570
|
+
function yr(e, t) {
|
|
8507
8571
|
if (typeof t != "object" || !t || Array.isArray(t)) return "invalid";
|
|
8508
8572
|
let n = e.document.graph;
|
|
8509
8573
|
for (let [r, i] of Object.entries(t)) {
|
|
8510
8574
|
let t = n.nodes[r];
|
|
8511
8575
|
if (t == null || !("inputs" in t) || typeof i != "object" || !i || Array.isArray(i)) return "invalid";
|
|
8512
|
-
let a =
|
|
8576
|
+
let a = dr(e.document, t);
|
|
8513
8577
|
for (let e of Object.keys(i)) {
|
|
8514
8578
|
let n = a[e];
|
|
8515
|
-
if (n == null || t.inputs[e] != null || Object.hasOwn(n, "value")) return "invalid";
|
|
8579
|
+
if (n == null || lr(n.jsonSchema) || t.inputs[e] != null || Object.hasOwn(n, "value")) return "invalid";
|
|
8516
8580
|
}
|
|
8517
8581
|
}
|
|
8518
8582
|
return "valid";
|
|
8519
8583
|
}
|
|
8520
|
-
function
|
|
8584
|
+
function br(e, t, n) {
|
|
8521
8585
|
let r = [], i = /* @__PURE__ */ new Map();
|
|
8522
8586
|
for (let n of t.toSorted()) {
|
|
8523
8587
|
let t = e.modules[n];
|
|
8524
8588
|
if (t == null) continue;
|
|
8525
|
-
let a =
|
|
8589
|
+
let a = rr(n, t.source, r);
|
|
8526
8590
|
a != null && i.set(n, a);
|
|
8527
8591
|
}
|
|
8528
8592
|
for (let a of t.toSorted()) {
|
|
@@ -8538,18 +8602,27 @@ function gr(e, t, n) {
|
|
|
8538
8602
|
column: c.column,
|
|
8539
8603
|
line: c.line,
|
|
8540
8604
|
message: `Platform Library does not export "${e}".`,
|
|
8541
|
-
path:
|
|
8605
|
+
path: K(a),
|
|
8606
|
+
values: {
|
|
8607
|
+
name: e,
|
|
8608
|
+
variant: "platform"
|
|
8609
|
+
}
|
|
8542
8610
|
});
|
|
8543
8611
|
continue;
|
|
8544
8612
|
}
|
|
8545
|
-
let o =
|
|
8613
|
+
let o = ir(c.specifier);
|
|
8546
8614
|
if (o == null) {
|
|
8547
8615
|
r.push({
|
|
8548
8616
|
code: "module.unsupported-import",
|
|
8549
8617
|
column: c.column,
|
|
8550
8618
|
line: c.line,
|
|
8551
8619
|
message: `CodeModule "${a}" cannot import "${c.specifier}".`,
|
|
8552
|
-
path:
|
|
8620
|
+
path: K(a),
|
|
8621
|
+
values: {
|
|
8622
|
+
moduleId: a,
|
|
8623
|
+
specifier: c.specifier,
|
|
8624
|
+
variant: "import"
|
|
8625
|
+
}
|
|
8553
8626
|
});
|
|
8554
8627
|
continue;
|
|
8555
8628
|
}
|
|
@@ -8559,7 +8632,8 @@ function gr(e, t, n) {
|
|
|
8559
8632
|
column: c.column,
|
|
8560
8633
|
line: c.line,
|
|
8561
8634
|
message: `CodeModule "${o}" does not exist.`,
|
|
8562
|
-
path:
|
|
8635
|
+
path: K(a),
|
|
8636
|
+
values: { moduleId: o }
|
|
8563
8637
|
});
|
|
8564
8638
|
continue;
|
|
8565
8639
|
}
|
|
@@ -8569,7 +8643,11 @@ function gr(e, t, n) {
|
|
|
8569
8643
|
column: c.column,
|
|
8570
8644
|
line: c.line,
|
|
8571
8645
|
message: `CodeModule "${a}" does not declare its import of "${o}".`,
|
|
8572
|
-
path:
|
|
8646
|
+
path: K(a),
|
|
8647
|
+
values: {
|
|
8648
|
+
importedModuleId: o,
|
|
8649
|
+
moduleId: a
|
|
8650
|
+
}
|
|
8573
8651
|
});
|
|
8574
8652
|
continue;
|
|
8575
8653
|
}
|
|
@@ -8579,7 +8657,12 @@ function gr(e, t, n) {
|
|
|
8579
8657
|
column: c.column,
|
|
8580
8658
|
line: c.line,
|
|
8581
8659
|
message: `CodeModule "${o}" does not export "${e}".`,
|
|
8582
|
-
path:
|
|
8660
|
+
path: K(a),
|
|
8661
|
+
values: {
|
|
8662
|
+
moduleId: o,
|
|
8663
|
+
name: e,
|
|
8664
|
+
variant: "module"
|
|
8665
|
+
}
|
|
8583
8666
|
});
|
|
8584
8667
|
}
|
|
8585
8668
|
for (let e of t.imports) s.has(e) || r.push({
|
|
@@ -8587,7 +8670,11 @@ function gr(e, t, n) {
|
|
|
8587
8670
|
column: 0,
|
|
8588
8671
|
line: 1,
|
|
8589
8672
|
message: `CodeModule "${a}" declares "${e}" without a matching static import.`,
|
|
8590
|
-
path:
|
|
8673
|
+
path: K(a),
|
|
8674
|
+
values: {
|
|
8675
|
+
importedModuleId: e,
|
|
8676
|
+
moduleId: a
|
|
8677
|
+
}
|
|
8591
8678
|
});
|
|
8592
8679
|
}
|
|
8593
8680
|
return {
|
|
@@ -8595,12 +8682,12 @@ function gr(e, t, n) {
|
|
|
8595
8682
|
diagnostics: r
|
|
8596
8683
|
};
|
|
8597
8684
|
}
|
|
8598
|
-
function
|
|
8599
|
-
return
|
|
8685
|
+
function xr(e, t, n) {
|
|
8686
|
+
return br(e, t, n).diagnostics.toSorted(or);
|
|
8600
8687
|
}
|
|
8601
|
-
async function
|
|
8602
|
-
let n = await
|
|
8603
|
-
r.diagnostics.push(...
|
|
8688
|
+
async function Sr(e, t) {
|
|
8689
|
+
let n = await $n(e), r = br(e, [...n.dependencies.modules], t);
|
|
8690
|
+
r.diagnostics.push(...vr(e, n));
|
|
8604
8691
|
let i = [["/document/graph", e.document.graph], ...[...n.dependencies.subflows].toSorted().flatMap((t) => {
|
|
8605
8692
|
let n = e.document.subflows[t];
|
|
8606
8693
|
return n == null ? [] : [[`/document/subflows/${t}/graph`, n.graph]];
|
|
@@ -8611,49 +8698,50 @@ async function vr(e, t) {
|
|
|
8611
8698
|
column: 0,
|
|
8612
8699
|
line: 1,
|
|
8613
8700
|
message: `Inline Task "${i}" references missing CodeModule "${o.task.moduleId}".`,
|
|
8614
|
-
path: `${t}/nodes/${i}/task/moduleId
|
|
8701
|
+
path: `${t}/nodes/${i}/task/moduleId`,
|
|
8702
|
+
values: {
|
|
8703
|
+
moduleId: o.task.moduleId,
|
|
8704
|
+
nodeId: i
|
|
8705
|
+
}
|
|
8615
8706
|
}) : !r.analysis.get(o.task.moduleId)?.exports.has("default") && !a.has(o.task.moduleId) && (a.add(o.task.moduleId), r.diagnostics.push({
|
|
8616
8707
|
code: "task.missing-entry",
|
|
8617
8708
|
column: 0,
|
|
8618
8709
|
line: 1,
|
|
8619
8710
|
message: `CodeModule "${o.task.moduleId}" used by an Inline Task must export a default function.`,
|
|
8620
|
-
path: `/modules/${o.task.moduleId}/source
|
|
8711
|
+
path: `/modules/${o.task.moduleId}/source`,
|
|
8712
|
+
values: { moduleId: o.task.moduleId }
|
|
8621
8713
|
}));
|
|
8622
8714
|
for (let [e, n] of (o.task.capabilities ?? []).entries()) n.action.length > 0 && n.connectionId.length > 0 || r.diagnostics.push({
|
|
8623
8715
|
code: "task.capability-incomplete",
|
|
8624
8716
|
column: 0,
|
|
8625
8717
|
line: 1,
|
|
8626
8718
|
message: `Inline Task "${i}" has an incomplete Connector Capability.`,
|
|
8627
|
-
path: `${t}/nodes/${i}/task/capabilities/${e}
|
|
8719
|
+
path: `${t}/nodes/${i}/task/capabilities/${e}`,
|
|
8720
|
+
values: { nodeId: i }
|
|
8628
8721
|
});
|
|
8629
8722
|
}
|
|
8630
8723
|
for (let t of [...n.dependencies.tasks].toSorted()) {
|
|
8631
8724
|
let n = e.document.tasks[t];
|
|
8632
|
-
n != null &&
|
|
8725
|
+
n != null && n.executor.kind == "connector" && n.executor.action.length == 0 && r.diagnostics.push({
|
|
8633
8726
|
code: "task.connector-incomplete",
|
|
8634
8727
|
column: 0,
|
|
8635
8728
|
line: 1,
|
|
8636
8729
|
message: `Connector Task "${t}" requires an action.`,
|
|
8637
|
-
path: `/document/tasks/${t}/executor
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
column: 0,
|
|
8641
|
-
line: 1,
|
|
8642
|
-
message: `Connector Task "${t}" requires a Connection.`,
|
|
8643
|
-
path: `/document/tasks/${t}/executor/connectionId`
|
|
8644
|
-
}));
|
|
8730
|
+
path: `/document/tasks/${t}/executor`,
|
|
8731
|
+
values: { taskId: t }
|
|
8732
|
+
});
|
|
8645
8733
|
}
|
|
8646
|
-
let o = r.diagnostics.toSorted(
|
|
8734
|
+
let o = r.diagnostics.toSorted(or);
|
|
8647
8735
|
return {
|
|
8648
8736
|
closure: n,
|
|
8649
8737
|
diagnostics: o,
|
|
8650
8738
|
valid: o.length == 0
|
|
8651
8739
|
};
|
|
8652
8740
|
}
|
|
8653
|
-
async function
|
|
8654
|
-
let n =
|
|
8741
|
+
async function Cr(e, t) {
|
|
8742
|
+
let n = Mn(t);
|
|
8655
8743
|
if (n == null) return { kind: "engine-unsupported" };
|
|
8656
|
-
let r = await
|
|
8744
|
+
let r = await Sr(e, n);
|
|
8657
8745
|
if (!r.valid) return {
|
|
8658
8746
|
kind: "flow-invalid",
|
|
8659
8747
|
validation: r
|
|
@@ -8672,7 +8760,7 @@ async function yr(e, t) {
|
|
|
8672
8760
|
validation: r
|
|
8673
8761
|
};
|
|
8674
8762
|
}
|
|
8675
|
-
function
|
|
8763
|
+
function wr(e, t, n) {
|
|
8676
8764
|
if (Object.hasOwn(e.modules, t)) return {
|
|
8677
8765
|
engineContract: e.engineContract,
|
|
8678
8766
|
engineDigest: n,
|
|
@@ -8681,4 +8769,4 @@ function br(e, t, n) {
|
|
|
8681
8769
|
};
|
|
8682
8770
|
}
|
|
8683
8771
|
//#endregion
|
|
8684
|
-
export {
|
|
8772
|
+
export { wr as createRuntimeProgram, $n as flowClosure, Q as matchesSchema, Cr as prepareFlow, tr as triggerPayloadSchema, Sr as validateFlow, yr as validateFlowInputs, xr as validateModules, er as variableBindings, cr as variableInputCompatible };
|