@oomol-lab/open-flow 0.1.0-alpha.1 → 0.1.0-alpha.12
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/addNodeOptions-BYQXyUmQ.js +9571 -0
- package/dist/browser/carbon-DMCVsjHo.js +53 -0
- package/dist/browser/{project-change.js → change-7rp2OZLm.js} +16 -46
- package/dist/browser/createResourceDialog-CWD62rU0.js +467 -0
- package/dist/browser/{dist-o4dBuwiG.js → dist-3Mj8q8Pr.js} +28 -28
- package/dist/browser/{dist-CIq6ue3I.js → dist-BKuSVKCC.js} +1115 -1103
- package/dist/browser/{dist-DL0SDskM.js → dist-BMqL-qR5.js} +473 -906
- package/dist/browser/{dist-CLZJNoWB.js → dist-BN4ZCyOB.js} +10 -10
- package/dist/browser/{dist-zyY--HOV.js → dist-BpopSHwP.js} +3 -3
- package/dist/browser/dist-C46JByB-.js +252 -0
- package/dist/browser/{dist-BbyiRq3c.js → dist-CJpzJrLM.js} +294 -284
- package/dist/browser/{dist-Djd02JSy.js → dist-CPuF50D9.js} +198 -198
- package/dist/browser/{dist-CvcmLAMW.js → dist-CUSrALSX.js} +115 -115
- package/dist/browser/dist-CeSZ2xSM.js +444 -0
- package/dist/browser/{dist-7oZK9QXZ.js → dist-DMi8_lU3.js} +5 -5
- package/dist/browser/{dist-B9OV3YTx.js → dist-DUzA0Ukh.js} +22 -22
- package/dist/browser/{dist-aWSZx4q1.js → dist-DWADUsVB.js} +75 -75
- package/dist/browser/{dist-BLk5M0uK.js → dist-Mecbzdl2.js} +3 -3
- package/dist/browser/{esm-DXw7EADW.js → esm-DmVDlOEJ.js} +14 -24
- package/dist/browser/flow-authoring-edge.d.ts +3 -0
- package/dist/browser/flow-authoring-module.d.ts +4 -0
- package/dist/browser/flow-authoring-node.d.ts +86 -0
- package/dist/browser/flow-authoring.d.ts +4 -0
- package/dist/browser/flow-authoring.js +783 -0
- package/dist/browser/{project-change.d.ts → flow-change.d.ts} +29 -37
- package/dist/browser/flow-change.js +234 -0
- package/dist/browser/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
- package/dist/browser/flowRunInputEditorStore-BYxwvHZl.js +8952 -0
- package/dist/browser/flowWorkspace-Bwqmoq-c.js +47439 -0
- package/dist/browser/languages-DgJehE1g.js +62 -0
- package/dist/browser/lib-C5Ipyfps.js +7856 -0
- package/dist/browser/{lib-S4ccuMeT.js → lib-GrGxYjsJ.js} +3 -5
- package/dist/browser/licenses.md +620 -12
- package/dist/browser/main-DmjVyuWr.js +76 -0
- package/dist/browser/{markdownContent-ZZFfSRqO.js → markdownContent-0teWaxq8.js} +5188 -5144
- package/dist/browser/theme.css +63 -0
- package/dist/browser/theme.css.d.ts +1 -0
- package/dist/browser/typeScriptSession-D5neIpug.js +2560 -0
- package/dist/browser/{composite-7VwgfnXx.js → useOpenInteractionType-CRgOHg5M.js} +2209 -2750
- package/dist/browser/workbench-contract.d.ts +6 -6
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +18 -2
- package/dist/browser/workbench.js +4200 -2233
- package/dist/common/connector-action.d.ts +6 -0
- package/dist/common/connector-action.js +38 -30
- package/dist/common/control-api-conformance.js +262 -359
- package/dist/common/control-api-errors.d.ts +32 -24
- package/dist/common/control-api.d.ts +57 -73
- package/dist/common/control-api.js +199 -205
- package/dist/common/cron-trigger.d.ts +1 -1
- package/dist/common/cron-trigger.js +1 -1
- package/dist/common/flow-encoding.d.ts +11 -0
- package/dist/common/{project-encoding.js → flow-encoding.js} +14 -13
- package/dist/common/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
- package/dist/common/{project-semantics.d.ts → flow-semantics.d.ts} +11 -12
- package/dist/common/{project-semantics.js → flow-semantics.js} +959 -934
- package/dist/common/integration-trigger.d.ts +2 -1
- package/dist/common/integration-trigger.js +1 -1
- 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/poll-trigger.d.ts +1 -1
- package/dist/common/provider-triggers.js +1057 -948
- package/dist/common/run-lifecycle.js +1 -1
- package/dist/common/runtime-contract.d.ts +1 -1
- package/dist/common/runtime-contract.js +1 -1
- package/dist/common/scheduler.d.ts +8 -7
- package/dist/common/scheduler.js +251 -232
- package/dist/common/webhook-trigger.d.ts +1 -1
- package/dist/common/webhook-trigger.js +35 -1
- package/package.json +23 -10
- package/dist/browser/addNodeOptions-DqoIueCR.js +0 -33746
- package/dist/browser/carbon-nMY84Amv.js +0 -53
- package/dist/browser/createResourceDialog-ByuJWdSL.js +0 -439
- package/dist/browser/dist-n-z5HtaO.js +0 -4
- package/dist/browser/flowWorkspace-DwVMpcar.js +0 -22092
- package/dist/common/project-encoding.d.ts +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/@babel/parser/lib/index.js
|
|
1
|
+
//#region ../../node_modules/.bun/@babel+parser@8.0.4/node_modules/@babel/parser/lib/index.js
|
|
2
2
|
var e = class {
|
|
3
3
|
constructor(e, t, n) {
|
|
4
4
|
this.line = void 0, this.column = void 0, n !== void 0 && (this.index = void 0), this.line = e, this.column = t, n !== void 0 && (this.index = n);
|
|
@@ -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 j = 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 j = 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 Pe(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 Fe = {
|
|
|
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 Be(e, t) {
|
|
938
|
-
return ze(e, t) || Le.has(e);
|
|
939
|
-
}
|
|
940
|
-
function Ve(e) {
|
|
941
|
-
return Re.has(e);
|
|
942
|
-
}
|
|
943
937
|
function He(e, t) {
|
|
944
|
-
return
|
|
938
|
+
return Ve(e, t) || ze.has(e);
|
|
945
939
|
}
|
|
946
940
|
function Ue(e) {
|
|
947
|
-
return
|
|
941
|
+
return Be.has(e);
|
|
942
|
+
}
|
|
943
|
+
function We(e, t) {
|
|
944
|
+
return He(e, t) || Ue(e);
|
|
948
945
|
}
|
|
949
|
-
function
|
|
950
|
-
return e
|
|
946
|
+
function Ge(e) {
|
|
947
|
+
return Re.has(e);
|
|
948
|
+
}
|
|
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 qe = 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 qe = class {
|
|
|
1058
1058
|
if (t & 3779 && !(t & 4)) return t;
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
|
-
},
|
|
1061
|
+
}, Ze = class extends Ye {
|
|
1062
1062
|
declareFunctions = /* @__PURE__ */ new Set();
|
|
1063
|
-
},
|
|
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 qe = 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 qe = 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 qe = 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 nt = /\*?\s*@((?:no)?flow)\b/, rt = (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 nt = /\*?\s*@((?:no)?flow)\b/, rt = (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 nt = /\*?\s*@((?:no)?flow)\b/, rt = (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 nt = /\*?\s*@((?:no)?flow)\b/, rt = (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 nt = /\*?\s*@((?:no)?flow)\b/, rt = (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 nt = /\*?\s*@((?:no)?flow)\b/, rt = (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 nt = /\*?\s*@((?:no)?flow)\b/, rt = (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 {
|
|
@@ -1348,8 +1348,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1348
1348
|
} finally {
|
|
1349
1349
|
this.state.context = t;
|
|
1350
1350
|
}
|
|
1351
|
-
}
|
|
1352
|
-
return e();
|
|
1351
|
+
} else return e();
|
|
1353
1352
|
}
|
|
1354
1353
|
flowParseTypeParameterInstantiationInExpression() {
|
|
1355
1354
|
if (this.reScan_lt() === 43) return this.flowParseTypeParameterInstantiation();
|
|
@@ -1361,7 +1360,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1361
1360
|
let t = this.state.noAnonFunctionType;
|
|
1362
1361
|
for (this.state.noAnonFunctionType = !1; !this.match(44);) e.params.push(this.flowParseType()), this.match(44) || this.expect(8);
|
|
1363
1362
|
this.state.noAnonFunctionType = t;
|
|
1364
|
-
}), 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");
|
|
1365
1364
|
}
|
|
1366
1365
|
flowParseTypeParameterInstantiationCallOrNew() {
|
|
1367
1366
|
if (this.reScan_lt() !== 43) return null;
|
|
@@ -1420,27 +1419,27 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1420
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));
|
|
1421
1420
|
else {
|
|
1422
1421
|
let e = "init";
|
|
1423
|
-
(this.isContextual(95) || this.isContextual(100)) &&
|
|
1422
|
+
(this.isContextual(95) || this.isContextual(100)) && ge(this.lookahead().type) && (e = this.state.value, this.next());
|
|
1424
1423
|
let r = this.flowParseObjectTypeProperty(u, t, a, d, e, n, i ?? !c);
|
|
1425
1424
|
r === null ? (l = !0, s = this.state.lastTokStartLoc) : o.properties.push(r);
|
|
1426
1425
|
}
|
|
1427
|
-
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);
|
|
1428
1427
|
}
|
|
1429
1428
|
this.expect(s), n && (o.inexact = l);
|
|
1430
1429
|
let u = this.finishNode(o, "ObjectTypeAnnotation");
|
|
1431
1430
|
return this.state.inType = a, u;
|
|
1432
1431
|
}
|
|
1433
1432
|
flowParseObjectTypeProperty(e, t, n, r, i, a, o) {
|
|
1434
|
-
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"));
|
|
1435
1434
|
{
|
|
1436
1435
|
e.key = this.flowParseObjectPropertyKey(), e.static = t, e.proto = n != null, e.kind = i;
|
|
1437
1436
|
let o = !1;
|
|
1438
|
-
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");
|
|
1439
1438
|
}
|
|
1440
1439
|
}
|
|
1441
1440
|
flowCheckGetterSetterParams(e) {
|
|
1442
1441
|
let t = e.kind === "get" ? 0 : 1, n = e.value, r = n.params.length + +!!n.rest;
|
|
1443
|
-
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);
|
|
1444
1443
|
}
|
|
1445
1444
|
flowObjectTypeSemicolon() {
|
|
1446
1445
|
!this.eat(9) && !this.eat(8) && !this.match(4) && !this.match(5) && this.unexpected();
|
|
@@ -1469,7 +1468,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1469
1468
|
}
|
|
1470
1469
|
flowParseFunctionTypeParam(e) {
|
|
1471
1470
|
let t = null, n = !1, r, i = this.startNode(), a = this.lookahead(), o = this.state.type === 74;
|
|
1472
|
-
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");
|
|
1473
1472
|
}
|
|
1474
1473
|
reinterpretTypeAsFunctionTypeParam(e) {
|
|
1475
1474
|
let t = this.startNodeAtNode(e);
|
|
@@ -1522,7 +1521,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1522
1521
|
case 6: {
|
|
1523
1522
|
let e = this.startNode();
|
|
1524
1523
|
if (this.next(), !this.match(7) && !this.match(17)) {
|
|
1525
|
-
if (
|
|
1524
|
+
if (E(this.state.type) || this.match(74)) {
|
|
1526
1525
|
let e = this.lookahead().type;
|
|
1527
1526
|
i = e !== 13 && e !== 10;
|
|
1528
1527
|
} else i = !0;
|
|
@@ -1540,7 +1539,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1540
1539
|
if (this.state.value === "-") {
|
|
1541
1540
|
if (this.next(), this.match(131)) return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", t);
|
|
1542
1541
|
if (this.match(132)) return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", t);
|
|
1543
|
-
throw this.raise(
|
|
1542
|
+
throw this.raise(N.UnexpectedSubtractionOperand, this.state.startLoc);
|
|
1544
1543
|
}
|
|
1545
1544
|
throw this.unexpected();
|
|
1546
1545
|
case 131: return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
|
|
@@ -1551,11 +1550,11 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1551
1550
|
case 51: return this.next(), this.finishNode(t, "ExistsTypeAnnotation");
|
|
1552
1551
|
case 83: return this.flowParseTypeofType();
|
|
1553
1552
|
default:
|
|
1554
|
-
if (
|
|
1555
|
-
let e =
|
|
1553
|
+
if (xe(this.state.type)) {
|
|
1554
|
+
let e = k(this.state.type);
|
|
1556
1555
|
return this.next(), super.createIdentifier(t, e);
|
|
1557
1556
|
}
|
|
1558
|
-
if (
|
|
1557
|
+
if (E(this.state.type)) return this.isContextual(125) ? this.flowParseInterfaceType() : this.flowIdentToTypeAnnotation(e, t, this.parseIdentifier());
|
|
1559
1558
|
}
|
|
1560
1559
|
throw this.unexpected();
|
|
1561
1560
|
}
|
|
@@ -1637,7 +1636,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1637
1636
|
}
|
|
1638
1637
|
parseStatementLike(e) {
|
|
1639
1638
|
if (this.state.strict && this.isContextual(125)) {
|
|
1640
|
-
if (
|
|
1639
|
+
if (D(this.lookahead().type)) {
|
|
1641
1640
|
let e = this.startNode();
|
|
1642
1641
|
return this.next(), this.flowParseInterface(e);
|
|
1643
1642
|
}
|
|
@@ -1651,8 +1650,8 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1651
1650
|
parseExpressionStatement(e, t, n) {
|
|
1652
1651
|
if (t.type === "Identifier") {
|
|
1653
1652
|
if (t.name === "declare") {
|
|
1654
|
-
if (this.match(76) ||
|
|
1655
|
-
} 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)) {
|
|
1656
1655
|
if (t.name === "interface") return this.flowParseInterface(e);
|
|
1657
1656
|
if (t.name === "type") return this.flowParseTypeAlias(e);
|
|
1658
1657
|
if (t.name === "opaque") return this.flowParseOpaqueType(e, !1);
|
|
@@ -1662,11 +1661,11 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1662
1661
|
}
|
|
1663
1662
|
shouldParseExportDeclaration() {
|
|
1664
1663
|
let { type: e } = this.state;
|
|
1665
|
-
return e === 122 ||
|
|
1664
|
+
return e === 122 || ye(e) ? !this.state.containsEsc : super.shouldParseExportDeclaration();
|
|
1666
1665
|
}
|
|
1667
1666
|
isExportDefaultSpecifier() {
|
|
1668
1667
|
let { type: e } = this.state;
|
|
1669
|
-
return e === 122 ||
|
|
1668
|
+
return e === 122 || ye(e) ? this.state.containsEsc : super.isExportDefaultSpecifier();
|
|
1670
1669
|
}
|
|
1671
1670
|
parseExportDefaultExpression() {
|
|
1672
1671
|
if (this.isContextual(122)) {
|
|
@@ -1690,7 +1689,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1690
1689
|
for (let t = 0; t < u.length; t++) e.push(u[t].start);
|
|
1691
1690
|
({consequent: o, failed: s} = this.tryParseConditionalConsequent()), [l] = this.getArrowLikeExpressions(o);
|
|
1692
1691
|
}
|
|
1693
|
-
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());
|
|
1694
1693
|
}
|
|
1695
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");
|
|
1696
1695
|
}
|
|
@@ -1708,7 +1707,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1708
1707
|
let e = n.pop();
|
|
1709
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));
|
|
1710
1709
|
}
|
|
1711
|
-
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)));
|
|
1712
1711
|
}
|
|
1713
1712
|
finishArrowValidation(e) {
|
|
1714
1713
|
this.toAssignableList(e.params, e.extra?.trailingCommaLoc, !1), this.scope.enter(518), super.checkParams(e, !1, !0), this.scope.exit();
|
|
@@ -1771,7 +1770,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1771
1770
|
if (super.parseClassMemberFromModifier(e, t)) return;
|
|
1772
1771
|
t.declare = !0;
|
|
1773
1772
|
}
|
|
1774
|
-
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));
|
|
1775
1774
|
}
|
|
1776
1775
|
isIterator(e) {
|
|
1777
1776
|
return e === "iterator" || e === "asyncIterator";
|
|
@@ -1782,7 +1781,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1782
1781
|
}
|
|
1783
1782
|
getTokenFromCode(e) {
|
|
1784
1783
|
let t = this.input.charCodeAt(this.state.pos + 1);
|
|
1785
|
-
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);
|
|
1786
1785
|
}
|
|
1787
1786
|
isAssignable(e, t) {
|
|
1788
1787
|
return e.type === "TypeCastExpression" ? this.isAssignable(e.expression, t) : super.isAssignable(e, t);
|
|
@@ -1797,7 +1796,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1797
1796
|
toReferencedList(e, t) {
|
|
1798
1797
|
for (let n = 0; n < e.length; n++) {
|
|
1799
1798
|
let r = e[n];
|
|
1800
|
-
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);
|
|
1801
1800
|
}
|
|
1802
1801
|
return e;
|
|
1803
1802
|
}
|
|
@@ -1826,10 +1825,10 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1826
1825
|
pushClassMethod(e, t, n, r, i, a) {
|
|
1827
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) {
|
|
1828
1827
|
let e = t.params;
|
|
1829
|
-
e.length > 0 && this.isThisParam(e[0]) && this.raise(
|
|
1828
|
+
e.length > 0 && this.isThisParam(e[0]) && this.raise(N.ThisParamBannedInConstructor, t);
|
|
1830
1829
|
} else if (t.type === "MethodDefinition" && i && t.value.params) {
|
|
1831
1830
|
let e = t.value.params;
|
|
1832
|
-
e.length > 0 && this.isThisParam(e[0]) && this.raise(
|
|
1831
|
+
e.length > 0 && this.isThisParam(e[0]) && this.raise(N.ThisParamBannedInConstructor, t);
|
|
1833
1832
|
}
|
|
1834
1833
|
}
|
|
1835
1834
|
pushClassPrivateMethod(e, t, n, r) {
|
|
@@ -1852,7 +1851,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1852
1851
|
let t = this.getObjectOrClassMethodParams(e);
|
|
1853
1852
|
if (t.length > 0) {
|
|
1854
1853
|
let n = t[0];
|
|
1855
|
-
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);
|
|
1856
1855
|
}
|
|
1857
1856
|
}
|
|
1858
1857
|
parsePropertyNamePrefixOperator(e) {
|
|
@@ -1866,14 +1865,14 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1866
1865
|
return s && ((c.value || c).typeParameters = s), c;
|
|
1867
1866
|
}
|
|
1868
1867
|
parseFunctionParamType(e) {
|
|
1869
|
-
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;
|
|
1870
1869
|
}
|
|
1871
1870
|
parseMaybeDefault(e, t) {
|
|
1872
1871
|
let n = super.parseMaybeDefault(e, t);
|
|
1873
|
-
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;
|
|
1874
1873
|
}
|
|
1875
1874
|
parseImportSpecifierLocal(e, t, n) {
|
|
1876
|
-
t.local =
|
|
1875
|
+
t.local = tt(e) ? this.flowParseRestrictedIdentifier(!0, !0) : this.parseIdentifier(), e.specifiers.push(this.finishImportSpecifier(t, n));
|
|
1877
1876
|
}
|
|
1878
1877
|
isPotentialImportPhase(e) {
|
|
1879
1878
|
if (super.isPotentialImportPhase(e)) return !0;
|
|
@@ -1896,17 +1895,17 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1896
1895
|
let s = !1;
|
|
1897
1896
|
if (this.isContextual(89) && !this.isLookaheadContextual("as")) {
|
|
1898
1897
|
let t = this.parseIdentifier(!0);
|
|
1899
|
-
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());
|
|
1900
1899
|
} else {
|
|
1901
|
-
if (o !== null &&
|
|
1900
|
+
if (o !== null && D(this.state.type)) e.imported = this.parseIdentifier(!0), e.importKind = o;
|
|
1902
1901
|
else {
|
|
1903
1902
|
if (t) throw this.raise(g.ImportBindingIsString, e, { importName: a.value });
|
|
1904
1903
|
e.imported = a, e.importKind = null;
|
|
1905
1904
|
}
|
|
1906
1905
|
this.eatContextual(89) ? e.local = this.parseIdentifier() : (s = !0, e.local = this.cloneIdentifier(e.imported));
|
|
1907
1906
|
}
|
|
1908
|
-
let c =
|
|
1909
|
-
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");
|
|
1910
1909
|
}
|
|
1911
1910
|
parseBindingAtom() {
|
|
1912
1911
|
switch (this.state.type) {
|
|
@@ -1936,7 +1935,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1936
1935
|
if (this.hasPlugin("jsx") && (this.match(138) || this.match(43))) {
|
|
1937
1936
|
if (n = this.state.clone(), r = this.tryParse(() => super.parseMaybeAssign(e, t), n), !r.error) return r.node;
|
|
1938
1937
|
let { context: i } = this.state, a = i[i.length - 1];
|
|
1939
|
-
(a ===
|
|
1938
|
+
(a === A.j_oTag || a === A.j_expr) && i.pop();
|
|
1940
1939
|
}
|
|
1941
1940
|
if (r?.error || this.match(43)) {
|
|
1942
1941
|
n ||= this.state.clone();
|
|
@@ -1951,12 +1950,12 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1951
1950
|
return a.type !== "ArrowFunctionExpression" && n(), a.typeParameters = i, this.resetStartLocationFromNode(a, i), r;
|
|
1952
1951
|
}, n), o = null;
|
|
1953
1952
|
if (a.node && this.maybeUnwrapTypeCastExpression(a.node).type === "ArrowFunctionExpression") {
|
|
1954
|
-
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;
|
|
1955
1954
|
o = a.node;
|
|
1956
1955
|
}
|
|
1957
1956
|
if (r?.node) return this.state = r.failState, r.node;
|
|
1958
1957
|
if (o) return this.state = a.failState, o;
|
|
1959
|
-
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);
|
|
1960
1959
|
}
|
|
1961
1960
|
return super.parseMaybeAssign(e, t);
|
|
1962
1961
|
}
|
|
@@ -1981,7 +1980,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1981
1980
|
}
|
|
1982
1981
|
checkParams(e, t, n, r = !0) {
|
|
1983
1982
|
if (!(n && this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))) {
|
|
1984
|
-
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]);
|
|
1985
1984
|
super.checkParams(e, t, n, r);
|
|
1986
1985
|
}
|
|
1987
1986
|
}
|
|
@@ -2046,11 +2045,11 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
2046
2045
|
}
|
|
2047
2046
|
parseTopLevel(e, t) {
|
|
2048
2047
|
let n = super.parseTopLevel(e, t);
|
|
2049
|
-
return this.state.hasFlowComment && this.raise(
|
|
2048
|
+
return this.state.hasFlowComment && this.raise(N.UnterminatedFlowComment, this.state.curPosition()), n;
|
|
2050
2049
|
}
|
|
2051
2050
|
skipBlockComment() {
|
|
2052
2051
|
if (this.hasPlugin("flowComments") && this.skipFlowComment()) {
|
|
2053
|
-
if (this.state.hasFlowComment) throw this.raise(
|
|
2052
|
+
if (this.state.hasFlowComment) throw this.raise(N.NestedFlowComment, this.state.startLoc);
|
|
2054
2053
|
this.hasFlowCommentCompletion();
|
|
2055
2054
|
let e = this.skipFlowComment();
|
|
2056
2055
|
e && (this.state.pos += e, this.state.hasFlowComment = !0);
|
|
@@ -2068,16 +2067,16 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
2068
2067
|
if (this.input.indexOf("*/", this.state.pos) === -1) throw this.raise(g.UnterminatedComment, this.state.curPosition());
|
|
2069
2068
|
}
|
|
2070
2069
|
flowEnumErrorBooleanMemberNotInitialized(e, t) {
|
|
2071
|
-
this.raise(
|
|
2070
|
+
this.raise(N.EnumBooleanMemberNotInitialized, e, t);
|
|
2072
2071
|
}
|
|
2073
2072
|
flowEnumErrorInvalidMemberInitializer(e, t) {
|
|
2074
|
-
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);
|
|
2075
2074
|
}
|
|
2076
2075
|
flowEnumErrorNumberMemberNotInitialized(e, t) {
|
|
2077
|
-
this.raise(
|
|
2076
|
+
this.raise(N.EnumNumberMemberNotInitialized, e, t);
|
|
2078
2077
|
}
|
|
2079
2078
|
flowEnumErrorStringMemberInconsistentlyInitialized(e, t) {
|
|
2080
|
-
this.raise(
|
|
2079
|
+
this.raise(N.EnumStringMemberInconsistentlyInitialized, e, t);
|
|
2081
2080
|
}
|
|
2082
2081
|
flowEnumMemberInit() {
|
|
2083
2082
|
let e = this.state.startLoc, t = () => this.match(8) || this.match(4);
|
|
@@ -2143,11 +2142,11 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
2143
2142
|
}
|
|
2144
2143
|
let a = this.startNode(), { id: o, init: s } = this.flowEnumMemberRaw(), c = o.name;
|
|
2145
2144
|
if (c === "") continue;
|
|
2146
|
-
/^[a-z]/.test(c) && this.raise(
|
|
2145
|
+
/^[a-z]/.test(c) && this.raise(N.EnumInvalidMemberName, o, {
|
|
2147
2146
|
memberName: c,
|
|
2148
2147
|
suggestion: c[0].toUpperCase() + c.slice(1),
|
|
2149
2148
|
enumName: e
|
|
2150
|
-
}), n.has(c) && this.raise(
|
|
2149
|
+
}), n.has(c) && this.raise(N.EnumDuplicateMemberName, o, {
|
|
2151
2150
|
memberName: c,
|
|
2152
2151
|
enumName: e
|
|
2153
2152
|
}), n.add(c);
|
|
@@ -2196,9 +2195,9 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
2196
2195
|
}
|
|
2197
2196
|
flowEnumParseExplicitType({ enumName: e }) {
|
|
2198
2197
|
if (!this.eatContextual(98)) return null;
|
|
2199
|
-
if (!
|
|
2198
|
+
if (!E(this.state.type)) throw this.raise(N.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, { enumName: e });
|
|
2200
2199
|
let { value: t } = this.state;
|
|
2201
|
-
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, {
|
|
2202
2201
|
enumName: e,
|
|
2203
2202
|
invalidEnumType: t
|
|
2204
2203
|
}), t;
|
|
@@ -2235,7 +2234,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
2235
2234
|
});
|
|
2236
2235
|
return e.members = a.numberMembers, this.expect(4), this.finishNode(e, "EnumNumberBody");
|
|
2237
2236
|
}
|
|
2238
|
-
return this.raise(
|
|
2237
|
+
return this.raise(N.EnumInconsistentMemberValues, r, { enumName: n }), t();
|
|
2239
2238
|
}
|
|
2240
2239
|
}
|
|
2241
2240
|
}
|
|
@@ -2265,7 +2264,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
2265
2264
|
maybeUnwrapTypeCastExpression(e) {
|
|
2266
2265
|
return e.type === "TypeCastExpression" ? e.expression : e;
|
|
2267
2266
|
}
|
|
2268
|
-
},
|
|
2267
|
+
}, ot = {
|
|
2269
2268
|
__proto__: null,
|
|
2270
2269
|
quot: "\"",
|
|
2271
2270
|
amp: "&",
|
|
@@ -2520,8 +2519,8 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
2520
2519
|
clubs: "♣",
|
|
2521
2520
|
hearts: "♥",
|
|
2522
2521
|
diams: "♦"
|
|
2523
|
-
},
|
|
2524
|
-
function
|
|
2522
|
+
}, st = /* @__PURE__ */ RegExp("\\r\\n|[\\r\\n\\u2028\\u2029]", "g");
|
|
2523
|
+
function P(e) {
|
|
2525
2524
|
switch (e) {
|
|
2526
2525
|
case 10:
|
|
2527
2526
|
case 13:
|
|
@@ -2530,12 +2529,12 @@ function I(e) {
|
|
|
2530
2529
|
default: return !1;
|
|
2531
2530
|
}
|
|
2532
2531
|
}
|
|
2533
|
-
function
|
|
2534
|
-
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;
|
|
2535
2534
|
return !1;
|
|
2536
2535
|
}
|
|
2537
|
-
var
|
|
2538
|
-
function
|
|
2536
|
+
var lt = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, ut = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;
|
|
2537
|
+
function dt(e) {
|
|
2539
2538
|
switch (e) {
|
|
2540
2539
|
case 9:
|
|
2541
2540
|
case 11:
|
|
@@ -2561,7 +2560,7 @@ function lt(e) {
|
|
|
2561
2560
|
default: return !1;
|
|
2562
2561
|
}
|
|
2563
2562
|
}
|
|
2564
|
-
var
|
|
2563
|
+
var F = h`jsx`({
|
|
2565
2564
|
AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.",
|
|
2566
2565
|
MissingClosingTagElement: ({ openingTagName: e }) => `Expected corresponding JSX closing tag for <${e}>.`,
|
|
2567
2566
|
MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.",
|
|
@@ -2571,20 +2570,20 @@ var L = h`jsx`({
|
|
|
2571
2570
|
UnterminatedJsxContent: "Unterminated JSX contents.",
|
|
2572
2571
|
UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"
|
|
2573
2572
|
});
|
|
2574
|
-
function
|
|
2573
|
+
function I(e) {
|
|
2575
2574
|
return e ? e.type === "JSXOpeningFragment" || e.type === "JSXClosingFragment" : !1;
|
|
2576
2575
|
}
|
|
2577
|
-
function
|
|
2576
|
+
function L(e) {
|
|
2578
2577
|
if (e.type === "JSXIdentifier") return e.name;
|
|
2579
2578
|
if (e.type === "JSXNamespacedName") return e.namespace.name + ":" + e.name.name;
|
|
2580
|
-
if (e.type === "JSXMemberExpression") return
|
|
2579
|
+
if (e.type === "JSXMemberExpression") return L(e.object) + "." + L(e.property);
|
|
2581
2580
|
throw Error("Node had unexpected type: " + e.type);
|
|
2582
2581
|
}
|
|
2583
|
-
var
|
|
2582
|
+
var ft = (e) => class extends e {
|
|
2584
2583
|
jsxReadToken() {
|
|
2585
2584
|
let e = "", t = this.state.pos;
|
|
2586
2585
|
for (;;) {
|
|
2587
|
-
if (this.state.pos >= this.length) throw this.raise(
|
|
2586
|
+
if (this.state.pos >= this.length) throw this.raise(F.UnterminatedJsxContent, this.state.startLoc);
|
|
2588
2587
|
let n = this.input.charCodeAt(this.state.pos);
|
|
2589
2588
|
switch (n) {
|
|
2590
2589
|
case 60:
|
|
@@ -2599,11 +2598,11 @@ var ut = (e) => class extends e {
|
|
|
2599
2598
|
e += this.input.slice(t, this.state.pos), e += this.jsxReadEntity(), t = this.state.pos;
|
|
2600
2599
|
break;
|
|
2601
2600
|
case 62:
|
|
2602
|
-
case 125: this.raise(
|
|
2601
|
+
case 125: this.raise(F.UnexpectedToken, this.state.curPosition(), {
|
|
2603
2602
|
unexpected: this.input[this.state.pos],
|
|
2604
2603
|
HTMLEntity: n === 125 ? "}" : ">"
|
|
2605
2604
|
});
|
|
2606
|
-
default:
|
|
2605
|
+
default: P(n) ? (e += this.input.slice(t, this.state.pos), e += this.jsxReadNewLine(!0), t = this.state.pos) : ++this.state.pos;
|
|
2607
2606
|
}
|
|
2608
2607
|
}
|
|
2609
2608
|
}
|
|
@@ -2617,7 +2616,7 @@ var ut = (e) => class extends e {
|
|
|
2617
2616
|
if (this.state.pos >= this.length) throw this.raise(g.UnterminatedString, this.state.startLoc);
|
|
2618
2617
|
let r = this.input.charCodeAt(this.state.pos);
|
|
2619
2618
|
if (r === e) break;
|
|
2620
|
-
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;
|
|
2621
2620
|
}
|
|
2622
2621
|
t += this.input.slice(n, this.state.pos++), this.finishToken(130, t);
|
|
2623
2622
|
}
|
|
@@ -2633,7 +2632,7 @@ var ut = (e) => class extends e {
|
|
|
2633
2632
|
let t = 0, n = !1;
|
|
2634
2633
|
for (; t++ < 10 && this.state.pos < this.length && !(n = this.codePointAtPos(this.state.pos) === 59);) ++this.state.pos;
|
|
2635
2634
|
if (n) {
|
|
2636
|
-
let t =
|
|
2635
|
+
let t = ot[this.input.slice(e, this.state.pos)];
|
|
2637
2636
|
if (++this.state.pos, t) return t;
|
|
2638
2637
|
}
|
|
2639
2638
|
}
|
|
@@ -2643,12 +2642,12 @@ var ut = (e) => class extends e {
|
|
|
2643
2642
|
let e, t = this.state.pos;
|
|
2644
2643
|
do
|
|
2645
2644
|
e = this.input.charCodeAt(++this.state.pos);
|
|
2646
|
-
while (
|
|
2645
|
+
while (M(e) || e === 45);
|
|
2647
2646
|
this.finishToken(136, this.input.slice(t, this.state.pos));
|
|
2648
2647
|
}
|
|
2649
2648
|
jsxParseIdentifier() {
|
|
2650
2649
|
let e = this.startNode();
|
|
2651
|
-
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");
|
|
2652
2651
|
}
|
|
2653
2652
|
jsxParseNamespacedName() {
|
|
2654
2653
|
let e = this.state.startLoc, t = this.jsxParseIdentifier();
|
|
@@ -2668,10 +2667,10 @@ var ut = (e) => class extends e {
|
|
|
2668
2667
|
jsxParseAttributeValue() {
|
|
2669
2668
|
let e;
|
|
2670
2669
|
switch (this.state.type) {
|
|
2671
|
-
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;
|
|
2672
2671
|
case 138:
|
|
2673
2672
|
case 130: return this.parseExprAtom();
|
|
2674
|
-
default: throw this.raise(
|
|
2673
|
+
default: throw this.raise(F.UnsupportedJsxValue, this.state.startLoc);
|
|
2675
2674
|
}
|
|
2676
2675
|
}
|
|
2677
2676
|
jsxParseEmptyExpression() {
|
|
@@ -2679,20 +2678,20 @@ var ut = (e) => class extends e {
|
|
|
2679
2678
|
return this.finishNodeAt(e, "JSXEmptyExpression", this.state.startLoc);
|
|
2680
2679
|
}
|
|
2681
2680
|
jsxParseSpreadChild(e) {
|
|
2682
|
-
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");
|
|
2683
2682
|
}
|
|
2684
2683
|
jsxParseExpressionContainer(e, t) {
|
|
2685
2684
|
if (this.match(4)) e.expression = this.jsxParseEmptyExpression();
|
|
2686
2685
|
else {
|
|
2687
2686
|
let t = this.parseExpression();
|
|
2688
|
-
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;
|
|
2689
2688
|
}
|
|
2690
2689
|
return this.setContext(t), this.state.canStartJSXElement = !0, this.expect(4), this.finishNode(e, "JSXExpressionContainer");
|
|
2691
2690
|
}
|
|
2692
2691
|
jsxParseAttribute() {
|
|
2693
2692
|
if (this.match(2)) {
|
|
2694
2693
|
let e = this.startNode();
|
|
2695
|
-
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");
|
|
2696
2695
|
}
|
|
2697
2696
|
let e = this.startNode();
|
|
2698
2697
|
return e.name = this.jsxParseNamespacedName(), e.value = this.eat(25) ? this.jsxParseAttributeValue() : null, this.finishNode(e, "JSXAttribute");
|
|
@@ -2734,15 +2733,15 @@ var ut = (e) => class extends e {
|
|
|
2734
2733
|
break;
|
|
2735
2734
|
case 2: {
|
|
2736
2735
|
let e = this.startNode();
|
|
2737
|
-
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));
|
|
2738
2737
|
break;
|
|
2739
2738
|
}
|
|
2740
2739
|
default: this.unexpected();
|
|
2741
2740
|
}
|
|
2742
|
-
|
|
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) });
|
|
2743
2742
|
}
|
|
2744
|
-
if (
|
|
2745
|
-
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");
|
|
2746
2745
|
}
|
|
2747
2746
|
jsxParseElement() {
|
|
2748
2747
|
let e = this.state.startLoc;
|
|
@@ -2760,12 +2759,12 @@ var ut = (e) => class extends e {
|
|
|
2760
2759
|
}
|
|
2761
2760
|
getTokenFromCode(e) {
|
|
2762
2761
|
let t = this.curContext();
|
|
2763
|
-
if (t ===
|
|
2762
|
+
if (t === A.j_expr) {
|
|
2764
2763
|
this.jsxReadToken();
|
|
2765
2764
|
return;
|
|
2766
2765
|
}
|
|
2767
|
-
if (t ===
|
|
2768
|
-
if (
|
|
2766
|
+
if (t === A.j_oTag || t === A.j_cTag) {
|
|
2767
|
+
if (j(e)) {
|
|
2769
2768
|
this.jsxReadWord();
|
|
2770
2769
|
return;
|
|
2771
2770
|
}
|
|
@@ -2773,7 +2772,7 @@ var ut = (e) => class extends e {
|
|
|
2773
2772
|
++this.state.pos, this.finishToken(139);
|
|
2774
2773
|
return;
|
|
2775
2774
|
}
|
|
2776
|
-
if ((e === 34 || e === 39) && t ===
|
|
2775
|
+
if ((e === 34 || e === 39) && t === A.j_oTag) {
|
|
2777
2776
|
this.jsxReadString(e);
|
|
2778
2777
|
return;
|
|
2779
2778
|
}
|
|
@@ -2786,23 +2785,23 @@ var ut = (e) => class extends e {
|
|
|
2786
2785
|
}
|
|
2787
2786
|
updateContext(e) {
|
|
2788
2787
|
let { context: t, type: n } = this.state;
|
|
2789
|
-
if (n === 52 && e === 138) t.splice(-2, 2,
|
|
2790
|
-
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);
|
|
2791
2790
|
else if (n === 139) {
|
|
2792
2791
|
let n = t[t.length - 1];
|
|
2793
|
-
n ===
|
|
2794
|
-
} 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);
|
|
2795
2794
|
}
|
|
2796
|
-
},
|
|
2795
|
+
}, pt = class extends Ye {
|
|
2797
2796
|
tsNames = /* @__PURE__ */ new Map();
|
|
2798
|
-
},
|
|
2797
|
+
}, mt = class extends Xe {
|
|
2799
2798
|
get inTSNamespace() {
|
|
2800
2799
|
let e = this.scopeStack;
|
|
2801
2800
|
return e.length >= 2 && e[e.length - 1].flags === 0 && (e[e.length - 2].flags & 2048) > 0;
|
|
2802
2801
|
}
|
|
2803
2802
|
importsStack = [];
|
|
2804
2803
|
createScope(e) {
|
|
2805
|
-
return this.importsStack.push(/* @__PURE__ */ new Set()), new
|
|
2804
|
+
return this.importsStack.push(/* @__PURE__ */ new Set()), new pt(e);
|
|
2806
2805
|
}
|
|
2807
2806
|
enter(e) {
|
|
2808
2807
|
e & 3072 && this.importsStack.push(/* @__PURE__ */ new Set()), super.enter(e);
|
|
@@ -2845,7 +2844,7 @@ var ut = (e) => class extends e {
|
|
|
2845
2844
|
}
|
|
2846
2845
|
super.checkLocalExport(e);
|
|
2847
2846
|
}
|
|
2848
|
-
},
|
|
2847
|
+
}, ht = class {
|
|
2849
2848
|
sawUnambiguousESM = !1;
|
|
2850
2849
|
ambiguousScriptDifferentAst = !1;
|
|
2851
2850
|
sourceToOffsetPos(e) {
|
|
@@ -2868,21 +2867,21 @@ var ut = (e) => class extends e {
|
|
|
2868
2867
|
return this.plugins.get(e)?.[t];
|
|
2869
2868
|
}
|
|
2870
2869
|
};
|
|
2871
|
-
function
|
|
2870
|
+
function gt(e, t) {
|
|
2872
2871
|
e.trailingComments === void 0 ? e.trailingComments = t : e.trailingComments.unshift(...t);
|
|
2873
2872
|
}
|
|
2874
|
-
function
|
|
2873
|
+
function _t(e, t) {
|
|
2875
2874
|
e.leadingComments === void 0 ? e.leadingComments = t : e.leadingComments.unshift(...t);
|
|
2876
2875
|
}
|
|
2877
|
-
function
|
|
2876
|
+
function R(e, t) {
|
|
2878
2877
|
e.innerComments === void 0 ? e.innerComments = t : e.innerComments.unshift(...t);
|
|
2879
2878
|
}
|
|
2880
|
-
function
|
|
2879
|
+
function z(e, t, n) {
|
|
2881
2880
|
let r = null, i = t.length;
|
|
2882
2881
|
for (; r === null && i > 0;) r = t[--i];
|
|
2883
|
-
r === null || r.start > n.start ?
|
|
2882
|
+
r === null || r.start > n.start ? R(e, n.comments) : gt(r, n.comments);
|
|
2884
2883
|
}
|
|
2885
|
-
var
|
|
2884
|
+
var vt = class extends ht {
|
|
2886
2885
|
addComment(e) {
|
|
2887
2886
|
this.filename && (e.loc.filename = this.filename);
|
|
2888
2887
|
let { commentsLen: t } = this.state;
|
|
@@ -2905,21 +2904,21 @@ var gt = class extends pt {
|
|
|
2905
2904
|
}
|
|
2906
2905
|
finalizeComment(e) {
|
|
2907
2906
|
let { comments: t } = e;
|
|
2908
|
-
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);
|
|
2909
2908
|
else {
|
|
2910
2909
|
let n = e.containingNode, r = e.start;
|
|
2911
2910
|
if (this.input.charCodeAt(this.offsetToSourcePos(r) - 1) === 44) switch (n.type) {
|
|
2912
2911
|
case "ObjectExpression":
|
|
2913
2912
|
case "ObjectPattern":
|
|
2914
|
-
|
|
2913
|
+
z(n, n.properties, e);
|
|
2915
2914
|
break;
|
|
2916
2915
|
case "CallExpression":
|
|
2917
2916
|
case "NewExpression":
|
|
2918
2917
|
case "OptionalCallExpression":
|
|
2919
|
-
|
|
2918
|
+
z(n, n.arguments, e);
|
|
2920
2919
|
break;
|
|
2921
2920
|
case "ImportExpression":
|
|
2922
|
-
|
|
2921
|
+
z(n, [n.source, n.options ?? null], e);
|
|
2923
2922
|
break;
|
|
2924
2923
|
case "FunctionDeclaration":
|
|
2925
2924
|
case "FunctionExpression":
|
|
@@ -2928,25 +2927,25 @@ var gt = class extends pt {
|
|
|
2928
2927
|
case "ClassMethod":
|
|
2929
2928
|
case "ClassPrivateMethod":
|
|
2930
2929
|
case "TSTypeParameterDeclaration":
|
|
2931
|
-
|
|
2930
|
+
z(n, n.params, e);
|
|
2932
2931
|
break;
|
|
2933
2932
|
case "ArrayExpression":
|
|
2934
2933
|
case "ArrayPattern":
|
|
2935
|
-
|
|
2934
|
+
z(n, n.elements, e);
|
|
2936
2935
|
break;
|
|
2937
2936
|
case "ExportNamedDeclaration":
|
|
2938
2937
|
case "ImportDeclaration":
|
|
2939
|
-
|
|
2938
|
+
z(n, n.specifiers, e);
|
|
2940
2939
|
break;
|
|
2941
2940
|
case "TSEnumBody":
|
|
2942
|
-
|
|
2941
|
+
z(n, n.members, e);
|
|
2943
2942
|
break;
|
|
2944
2943
|
case "TSInterfaceBody":
|
|
2945
|
-
|
|
2944
|
+
z(n, n.body, e);
|
|
2946
2945
|
break;
|
|
2947
|
-
default:
|
|
2946
|
+
default: R(n, t);
|
|
2948
2947
|
}
|
|
2949
|
-
else
|
|
2948
|
+
else R(n, t);
|
|
2950
2949
|
}
|
|
2951
2950
|
}
|
|
2952
2951
|
finalizeRemainingComments() {
|
|
@@ -2971,7 +2970,7 @@ var gt = class extends pt {
|
|
|
2971
2970
|
else if (o < t) break;
|
|
2972
2971
|
}
|
|
2973
2972
|
}
|
|
2974
|
-
},
|
|
2973
|
+
}, yt = class t {
|
|
2975
2974
|
flags = 2048;
|
|
2976
2975
|
get strict() {
|
|
2977
2976
|
return (this.flags & 1) > 0;
|
|
@@ -3060,7 +3059,7 @@ var gt = class extends pt {
|
|
|
3060
3059
|
end = 0;
|
|
3061
3060
|
lastTokEndLoc = null;
|
|
3062
3061
|
lastTokStartLoc = null;
|
|
3063
|
-
context = [
|
|
3062
|
+
context = [A.brace];
|
|
3064
3063
|
get canStartJSXElement() {
|
|
3065
3064
|
return (this.flags & 2048) > 0;
|
|
3066
3065
|
}
|
|
@@ -3089,9 +3088,9 @@ var gt = class extends pt {
|
|
|
3089
3088
|
let e = new t();
|
|
3090
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;
|
|
3091
3090
|
}
|
|
3092
|
-
},
|
|
3091
|
+
}, bt = function(e) {
|
|
3093
3092
|
return e >= 48 && e <= 57;
|
|
3094
|
-
},
|
|
3093
|
+
}, xt = {
|
|
3095
3094
|
decBinOct: /* @__PURE__ */ new Set([
|
|
3096
3095
|
46,
|
|
3097
3096
|
66,
|
|
@@ -3108,13 +3107,13 @@ var gt = class extends pt {
|
|
|
3108
3107
|
95,
|
|
3109
3108
|
120
|
|
3110
3109
|
])
|
|
3111
|
-
},
|
|
3110
|
+
}, St = {
|
|
3112
3111
|
bin: (e) => e === 48 || e === 49,
|
|
3113
3112
|
oct: (e) => e >= 48 && e <= 55,
|
|
3114
3113
|
dec: (e) => e >= 48 && e <= 57,
|
|
3115
3114
|
hex: (e) => e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102
|
|
3116
3115
|
};
|
|
3117
|
-
function
|
|
3116
|
+
function Ct(e, t, n, r, i, a) {
|
|
3118
3117
|
let o = n, s = r, c = i, l = "", u = null, d = n, { length: f } = t;
|
|
3119
3118
|
for (;;) {
|
|
3120
3119
|
if (n >= f) {
|
|
@@ -3122,13 +3121,13 @@ function xt(e, t, n, r, i, a) {
|
|
|
3122
3121
|
break;
|
|
3123
3122
|
}
|
|
3124
3123
|
let p = t.charCodeAt(n);
|
|
3125
|
-
if (
|
|
3124
|
+
if (wt(e, p, t, n)) {
|
|
3126
3125
|
l += t.slice(d, n);
|
|
3127
3126
|
break;
|
|
3128
3127
|
}
|
|
3129
3128
|
if (p === 92) {
|
|
3130
3129
|
l += t.slice(d, n);
|
|
3131
|
-
let o =
|
|
3130
|
+
let o = Tt(t, n, r, i, e === "template", a);
|
|
3132
3131
|
o.ch === null && !u ? u = {
|
|
3133
3132
|
pos: n,
|
|
3134
3133
|
lineStart: r,
|
|
@@ -3144,10 +3143,10 @@ function xt(e, t, n, r, i, a) {
|
|
|
3144
3143
|
curLine: i
|
|
3145
3144
|
};
|
|
3146
3145
|
}
|
|
3147
|
-
function
|
|
3146
|
+
function wt(e, t, n, r) {
|
|
3148
3147
|
return e === "template" ? t === 96 || t === 36 && n.charCodeAt(r + 1) === 123 : t === (e === "double" ? 34 : 39);
|
|
3149
3148
|
}
|
|
3150
|
-
function
|
|
3149
|
+
function Tt(e, t, n, r, i, a) {
|
|
3151
3150
|
let o = !i;
|
|
3152
3151
|
t++;
|
|
3153
3152
|
let s = (e) => ({
|
|
@@ -3161,11 +3160,11 @@ function Ct(e, t, n, r, i, a) {
|
|
|
3161
3160
|
case 114: return s("\r");
|
|
3162
3161
|
case 120: {
|
|
3163
3162
|
let i;
|
|
3164
|
-
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));
|
|
3165
3164
|
}
|
|
3166
3165
|
case 117: {
|
|
3167
3166
|
let i;
|
|
3168
|
-
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));
|
|
3169
3168
|
}
|
|
3170
3169
|
case 116: return s(" ");
|
|
3171
3170
|
case 98: return s("\b");
|
|
@@ -3193,15 +3192,15 @@ function Ct(e, t, n, r, i, a) {
|
|
|
3193
3192
|
return s(String.fromCharCode(c));
|
|
3194
3193
|
}
|
|
3195
3194
|
}
|
|
3196
|
-
function
|
|
3195
|
+
function Et(e, t, n, r, i, a, o, s) {
|
|
3197
3196
|
let c = t, l;
|
|
3198
|
-
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), {
|
|
3199
3198
|
code: l,
|
|
3200
3199
|
pos: t
|
|
3201
3200
|
};
|
|
3202
3201
|
}
|
|
3203
|
-
function
|
|
3204
|
-
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;
|
|
3205
3204
|
for (let u = 0, h = a ?? Infinity; u < h; ++u) {
|
|
3206
3205
|
let a = e.charCodeAt(t), u;
|
|
3207
3206
|
if (a === 95 && s !== "bail") {
|
|
@@ -3222,7 +3221,7 @@ function Tt(e, t, n, r, i, a, o, s, c, l) {
|
|
|
3222
3221
|
++t;
|
|
3223
3222
|
continue;
|
|
3224
3223
|
}
|
|
3225
|
-
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) {
|
|
3226
3225
|
if (u <= 9 && l) return {
|
|
3227
3226
|
n: null,
|
|
3228
3227
|
pos: t
|
|
@@ -3241,26 +3240,26 @@ function Tt(e, t, n, r, i, a, o, s, c, l) {
|
|
|
3241
3240
|
pos: t
|
|
3242
3241
|
};
|
|
3243
3242
|
}
|
|
3244
|
-
function
|
|
3243
|
+
function Ot(e, t, n, r, i, a) {
|
|
3245
3244
|
let o = e.charCodeAt(t), s;
|
|
3246
3245
|
if (o === 123) {
|
|
3247
|
-
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) {
|
|
3248
3247
|
if (i) a.invalidCodePoint(t, n, r);
|
|
3249
3248
|
else return {
|
|
3250
3249
|
code: null,
|
|
3251
3250
|
pos: t
|
|
3252
3251
|
};
|
|
3253
3252
|
}
|
|
3254
|
-
} else ({code: s, pos: t} =
|
|
3253
|
+
} else ({code: s, pos: t} = Et(e, t, n, r, 4, !1, i, a));
|
|
3255
3254
|
return {
|
|
3256
3255
|
code: s,
|
|
3257
3256
|
pos: t
|
|
3258
3257
|
};
|
|
3259
3258
|
}
|
|
3260
|
-
function
|
|
3259
|
+
function B(t, n, r) {
|
|
3261
3260
|
return new e(r, t - n, t);
|
|
3262
3261
|
}
|
|
3263
|
-
var
|
|
3262
|
+
var kt = /* @__PURE__ */ new Set([
|
|
3264
3263
|
103,
|
|
3265
3264
|
109,
|
|
3266
3265
|
115,
|
|
@@ -3269,16 +3268,16 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3269
3268
|
117,
|
|
3270
3269
|
100,
|
|
3271
3270
|
118
|
|
3272
|
-
]),
|
|
3271
|
+
]), At = class {
|
|
3273
3272
|
constructor(e) {
|
|
3274
3273
|
let n = e.startIndex || 0;
|
|
3275
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);
|
|
3276
3275
|
}
|
|
3277
|
-
},
|
|
3276
|
+
}, jt, Mt = class extends vt {
|
|
3278
3277
|
isLookahead;
|
|
3279
3278
|
tokens = [];
|
|
3280
3279
|
constructor(e, t) {
|
|
3281
|
-
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;
|
|
3282
3281
|
}
|
|
3283
3282
|
setLoc(e) {
|
|
3284
3283
|
let t = this.offsetToSourcePos(e.index);
|
|
@@ -3292,7 +3291,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3292
3291
|
this.tokens.length = this.state.tokensLength, this.tokens.push(e), ++this.state.tokensLength;
|
|
3293
3292
|
}
|
|
3294
3293
|
next() {
|
|
3295
|
-
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();
|
|
3296
3295
|
}
|
|
3297
3296
|
eat(e) {
|
|
3298
3297
|
return this.match(e) ? (this.next(), !0) : !1;
|
|
@@ -3326,7 +3325,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3326
3325
|
return this.nextTokenStartSince(this.state.pos);
|
|
3327
3326
|
}
|
|
3328
3327
|
nextTokenStartSince(e) {
|
|
3329
|
-
return
|
|
3328
|
+
return lt.lastIndex = e, lt.test(this.input) ? lt.lastIndex : e;
|
|
3330
3329
|
}
|
|
3331
3330
|
lookaheadCharCode() {
|
|
3332
3331
|
return this.lookaheadCharCodeSince(this.state.pos);
|
|
@@ -3338,7 +3337,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3338
3337
|
return this.nextTokenInLineStartSince(this.state.pos);
|
|
3339
3338
|
}
|
|
3340
3339
|
nextTokenInLineStartSince(e) {
|
|
3341
|
-
return
|
|
3340
|
+
return ut.lastIndex = e, ut.test(this.input) ? ut.lastIndex : e;
|
|
3342
3341
|
}
|
|
3343
3342
|
lookaheadInLineCharCode() {
|
|
3344
3343
|
return this.input.charCodeAt(this.nextTokenInLineStart());
|
|
@@ -3369,7 +3368,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3369
3368
|
this.isLookahead || (n = this.state.curPosition());
|
|
3370
3369
|
let r = this.state.pos, i = this.input.indexOf(e, r + 2);
|
|
3371
3370
|
if (i === -1) throw this.raise(g.UnterminatedComment, this.state.curPosition());
|
|
3372
|
-
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;
|
|
3373
3372
|
if (this.isLookahead) return;
|
|
3374
3373
|
let a = {
|
|
3375
3374
|
type: "CommentBlock",
|
|
@@ -3384,7 +3383,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3384
3383
|
let n = this.state.pos, r;
|
|
3385
3384
|
this.isLookahead || (r = this.state.curPosition());
|
|
3386
3385
|
let i = this.input.charCodeAt(this.state.pos += e);
|
|
3387
|
-
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);
|
|
3388
3387
|
if (this.isLookahead) return;
|
|
3389
3388
|
let a = this.state.pos, o = {
|
|
3390
3389
|
type: "CommentLine",
|
|
@@ -3426,7 +3425,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3426
3425
|
default: break loop;
|
|
3427
3426
|
}
|
|
3428
3427
|
break;
|
|
3429
|
-
default: if (
|
|
3428
|
+
default: if (dt(n)) ++this.state.pos;
|
|
3430
3429
|
else if (n === 45 && !this.inModule && this.optionFlags & 16384) {
|
|
3431
3430
|
let n = this.state.pos;
|
|
3432
3431
|
if (this.input.charCodeAt(n + 1) === 45 && this.input.charCodeAt(n + 2) === 62 && (e === 0 || this.state.lineStart > e)) {
|
|
@@ -3466,7 +3465,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3466
3465
|
if (this.state.pos === 0 && this.readToken_interpreter()) return;
|
|
3467
3466
|
let e = this.state.pos + 1, t = this.codePointAtPos(e);
|
|
3468
3467
|
if (t >= 48 && t <= 57) throw this.raise(g.UnexpectedDigitAfterHash, this.state.curPosition());
|
|
3469
|
-
|
|
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);
|
|
3470
3469
|
}
|
|
3471
3470
|
readToken_dot() {
|
|
3472
3471
|
let e = this.input.charCodeAt(this.state.pos + 1);
|
|
@@ -3484,7 +3483,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3484
3483
|
let e = this.input.charCodeAt(this.state.pos + 1);
|
|
3485
3484
|
if (e !== 33) return !1;
|
|
3486
3485
|
let t = this.state.pos;
|
|
3487
|
-
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);
|
|
3488
3487
|
let n = this.input.slice(t + 2, this.state.pos);
|
|
3489
3488
|
return this.finishToken(24, n), !0;
|
|
3490
3489
|
}
|
|
@@ -3686,7 +3685,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3686
3685
|
case 92:
|
|
3687
3686
|
this.readWord();
|
|
3688
3687
|
return;
|
|
3689
|
-
default: if (
|
|
3688
|
+
default: if (j(e)) {
|
|
3690
3689
|
this.readWord(e);
|
|
3691
3690
|
return;
|
|
3692
3691
|
}
|
|
@@ -3702,7 +3701,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3702
3701
|
for (;; ++a) {
|
|
3703
3702
|
if (a >= this.length) throw this.raise(g.UnterminatedRegExp, n(e, 1));
|
|
3704
3703
|
let t = this.input.charCodeAt(a);
|
|
3705
|
-
if (
|
|
3704
|
+
if (P(t)) throw this.raise(g.UnterminatedRegExp, n(e, 1));
|
|
3706
3705
|
if (r) r = !1;
|
|
3707
3706
|
else {
|
|
3708
3707
|
if (t === 91) i = !0;
|
|
@@ -3716,8 +3715,8 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3716
3715
|
let s = "", c = () => n(e, a + 2 - t);
|
|
3717
3716
|
for (; a < this.length;) {
|
|
3718
3717
|
let e = this.codePointAtPos(a), t = String.fromCharCode(e);
|
|
3719
|
-
if (
|
|
3720
|
-
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());
|
|
3721
3720
|
else break;
|
|
3722
3721
|
++a, s += t;
|
|
3723
3722
|
}
|
|
@@ -3727,14 +3726,14 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3727
3726
|
});
|
|
3728
3727
|
}
|
|
3729
3728
|
readInt(e, t, n = !1, r = !0) {
|
|
3730
|
-
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);
|
|
3731
3730
|
return this.state.pos = a, i;
|
|
3732
3731
|
}
|
|
3733
3732
|
readRadixNumber(e) {
|
|
3734
3733
|
let t = this.state.pos, r = this.state.curPosition(), i = !1;
|
|
3735
3734
|
this.state.pos += 2;
|
|
3736
3735
|
let a = this.readInt(e);
|
|
3737
|
-
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());
|
|
3738
3737
|
if (i) {
|
|
3739
3738
|
let e = this.input.slice(t, this.state.pos).replace(/[_n]/g, "");
|
|
3740
3739
|
this.finishToken(132, e);
|
|
@@ -3757,7 +3756,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3757
3756
|
let c = this.input.charCodeAt(this.state.pos);
|
|
3758
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));
|
|
3759
3758
|
let l = this.input.slice(t, this.state.pos).replaceAll("_", "");
|
|
3760
|
-
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());
|
|
3761
3760
|
if (a) {
|
|
3762
3761
|
this.finishToken(132, l);
|
|
3763
3762
|
return;
|
|
@@ -3766,18 +3765,18 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3766
3765
|
this.finishToken(131, u);
|
|
3767
3766
|
}
|
|
3768
3767
|
readCodePoint(e) {
|
|
3769
|
-
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);
|
|
3770
3769
|
return this.state.pos = n, t;
|
|
3771
3770
|
}
|
|
3772
3771
|
readString(e) {
|
|
3773
|
-
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);
|
|
3774
3773
|
this.state.pos = n + 1, this.state.lineStart = i, this.state.curLine = r, this.finishToken(130, t);
|
|
3775
3774
|
}
|
|
3776
3775
|
readTemplateContinuation() {
|
|
3777
3776
|
this.match(4) || this.unexpected(null, 4), this.state.pos--, this.readTemplateToken();
|
|
3778
3777
|
}
|
|
3779
3778
|
readTemplateToken() {
|
|
3780
|
-
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);
|
|
3781
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 + "${"));
|
|
3782
3781
|
}
|
|
3783
3782
|
recordStrictModeErrors(e, t) {
|
|
@@ -3789,10 +3788,10 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3789
3788
|
let t = "", n = this.state.pos, r = this.state.pos;
|
|
3790
3789
|
for (e !== void 0 && (this.state.pos += e <= 65535 ? 1 : 2); this.state.pos < this.length;) {
|
|
3791
3790
|
let e = this.codePointAtPos(this.state.pos);
|
|
3792
|
-
if (
|
|
3791
|
+
if (M(e)) this.state.pos += e <= 65535 ? 1 : 2;
|
|
3793
3792
|
else if (e === 92) {
|
|
3794
3793
|
this.state.containsEsc = !0, t += this.input.slice(r, this.state.pos);
|
|
3795
|
-
let e = this.state.curPosition(), i = this.state.pos === n ?
|
|
3794
|
+
let e = this.state.curPosition(), i = this.state.pos === n ? j : M;
|
|
3796
3795
|
if (this.input.charCodeAt(++this.state.pos) !== 117) {
|
|
3797
3796
|
this.raise(g.MissingUnicodeEscape, this.state.curPosition()), r = this.state.pos - 1;
|
|
3798
3797
|
continue;
|
|
@@ -3805,12 +3804,12 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3805
3804
|
return t + this.input.slice(r, this.state.pos);
|
|
3806
3805
|
}
|
|
3807
3806
|
readWord(e) {
|
|
3808
|
-
let t = this.readWord1(e), n =
|
|
3809
|
-
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));
|
|
3810
3809
|
}
|
|
3811
3810
|
checkKeywordEscapes() {
|
|
3812
3811
|
let { type: e } = this.state;
|
|
3813
|
-
|
|
3812
|
+
xe(e) && this.state.containsEsc && this.raise(g.InvalidEscapedReservedWord, this.state.startLoc, { reservedWord: k(e) });
|
|
3814
3813
|
}
|
|
3815
3814
|
raise(t, n, r = {}) {
|
|
3816
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);
|
|
@@ -3828,7 +3827,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3828
3827
|
}
|
|
3829
3828
|
updateContext(e) {}
|
|
3830
3829
|
unexpected(e, t) {
|
|
3831
|
-
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 });
|
|
3832
3831
|
}
|
|
3833
3832
|
expectPlugin(e, t) {
|
|
3834
3833
|
if (this.hasPlugin(e)) return !0;
|
|
@@ -3839,11 +3838,11 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3839
3838
|
}
|
|
3840
3839
|
errorBuilder(e) {
|
|
3841
3840
|
return (t, n, r) => {
|
|
3842
|
-
this.raise(e,
|
|
3841
|
+
this.raise(e, B(t, n, r));
|
|
3843
3842
|
};
|
|
3844
3843
|
}
|
|
3845
3844
|
errorHandlers_readInt = {
|
|
3846
|
-
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,
|
|
3847
3846
|
numericSeparatorInEscapeSequence: this.errorBuilder(g.NumericSeparatorInEscapeSequence),
|
|
3848
3847
|
unexpectedNumericSeparator: this.errorBuilder(g.UnexpectedNumericSeparator)
|
|
3849
3848
|
};
|
|
@@ -3855,24 +3854,24 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3855
3854
|
errorHandlers_readStringContents_string = {
|
|
3856
3855
|
...this.errorHandlers_readCodePoint,
|
|
3857
3856
|
strictNumericEscape: (e, t, n) => {
|
|
3858
|
-
this.recordStrictModeErrors(g.StrictNumericEscape,
|
|
3857
|
+
this.recordStrictModeErrors(g.StrictNumericEscape, B(e, t, n));
|
|
3859
3858
|
},
|
|
3860
3859
|
unterminated: (e, t, n) => {
|
|
3861
|
-
throw this.raise(g.UnterminatedString,
|
|
3860
|
+
throw this.raise(g.UnterminatedString, B(e - 1, t, n));
|
|
3862
3861
|
}
|
|
3863
3862
|
};
|
|
3864
3863
|
errorHandlers_readStringContents_template = {
|
|
3865
3864
|
...this.errorHandlers_readCodePoint,
|
|
3866
3865
|
strictNumericEscape: this.errorBuilder(g.StrictNumericEscape),
|
|
3867
3866
|
unterminated: (e, t, n) => {
|
|
3868
|
-
throw this.raise(g.UnterminatedTemplate,
|
|
3867
|
+
throw this.raise(g.UnterminatedTemplate, B(e, t, n));
|
|
3869
3868
|
}
|
|
3870
3869
|
};
|
|
3871
|
-
},
|
|
3870
|
+
}, Nt = class {
|
|
3872
3871
|
privateNames = /* @__PURE__ */ new Set();
|
|
3873
3872
|
loneAccessors = /* @__PURE__ */ new Map();
|
|
3874
3873
|
undefinedPrivateNames = /* @__PURE__ */ new Map();
|
|
3875
|
-
},
|
|
3874
|
+
}, Pt = class {
|
|
3876
3875
|
parser;
|
|
3877
3876
|
stack = [];
|
|
3878
3877
|
constructor(e) {
|
|
@@ -3882,7 +3881,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3882
3881
|
return this.stack[this.stack.length - 1];
|
|
3883
3882
|
}
|
|
3884
3883
|
enter() {
|
|
3885
|
-
this.stack.push(new
|
|
3884
|
+
this.stack.push(new Nt());
|
|
3886
3885
|
}
|
|
3887
3886
|
exit() {
|
|
3888
3887
|
let e = this.stack.pop(), t = this.current();
|
|
@@ -3904,7 +3903,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3904
3903
|
for (n of this.stack) if (n.privateNames.has(e)) return;
|
|
3905
3904
|
n ? n.undefinedPrivateNames.set(e, t) : this.parser.raise(g.InvalidPrivateFieldResolution, t, { identifierName: e });
|
|
3906
3905
|
}
|
|
3907
|
-
},
|
|
3906
|
+
}, Ft = class {
|
|
3908
3907
|
constructor(e = 0) {
|
|
3909
3908
|
this.type = e;
|
|
3910
3909
|
}
|
|
@@ -3914,7 +3913,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3914
3913
|
isCertainlyParameterDeclaration() {
|
|
3915
3914
|
return this.type === 3;
|
|
3916
3915
|
}
|
|
3917
|
-
},
|
|
3916
|
+
}, It = class extends Ft {
|
|
3918
3917
|
declarationErrors = /* @__PURE__ */ new Map();
|
|
3919
3918
|
constructor(e) {
|
|
3920
3919
|
super(e);
|
|
@@ -3928,9 +3927,9 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3928
3927
|
iterateErrors(e) {
|
|
3929
3928
|
this.declarationErrors.forEach(e);
|
|
3930
3929
|
}
|
|
3931
|
-
},
|
|
3930
|
+
}, Lt = class {
|
|
3932
3931
|
parser;
|
|
3933
|
-
stack = [new
|
|
3932
|
+
stack = [new Ft()];
|
|
3934
3933
|
constructor(e) {
|
|
3935
3934
|
this.parser = e;
|
|
3936
3935
|
}
|
|
@@ -3968,19 +3967,19 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3968
3967
|
});
|
|
3969
3968
|
}
|
|
3970
3969
|
};
|
|
3971
|
-
function It() {
|
|
3972
|
-
return new Nt(3);
|
|
3973
|
-
}
|
|
3974
|
-
function Lt() {
|
|
3975
|
-
return new Pt(1);
|
|
3976
|
-
}
|
|
3977
3970
|
function Rt() {
|
|
3978
|
-
return new
|
|
3971
|
+
return new Ft(3);
|
|
3979
3972
|
}
|
|
3980
3973
|
function zt() {
|
|
3981
|
-
return new
|
|
3974
|
+
return new It(1);
|
|
3975
|
+
}
|
|
3976
|
+
function Bt() {
|
|
3977
|
+
return new It(2);
|
|
3978
|
+
}
|
|
3979
|
+
function Vt() {
|
|
3980
|
+
return new Ft();
|
|
3982
3981
|
}
|
|
3983
|
-
var
|
|
3982
|
+
var Ht = class {
|
|
3984
3983
|
stacks = [];
|
|
3985
3984
|
enter(e) {
|
|
3986
3985
|
this.stacks.push(e);
|
|
@@ -4007,10 +4006,10 @@ var Bt = class {
|
|
|
4007
4006
|
return !(this.currentFlags() & 16);
|
|
4008
4007
|
}
|
|
4009
4008
|
};
|
|
4010
|
-
function
|
|
4009
|
+
function Ut(e, t) {
|
|
4011
4010
|
return (e ? 2 : 0) | !!t;
|
|
4012
4011
|
}
|
|
4013
|
-
var
|
|
4012
|
+
var Wt = class extends Mt {
|
|
4014
4013
|
addExtra(e, t, n, r = !0) {
|
|
4015
4014
|
if (!e) return;
|
|
4016
4015
|
let { extra: i } = e;
|
|
@@ -4025,7 +4024,7 @@ var Ht = class extends At {
|
|
|
4025
4024
|
isUnparsedContextual(e, t) {
|
|
4026
4025
|
if (this.input.startsWith(t, e)) {
|
|
4027
4026
|
let n = this.input.charCodeAt(e + t.length);
|
|
4028
|
-
return !(
|
|
4027
|
+
return !(M(n) || (n & 64512) == 55296);
|
|
4029
4028
|
}
|
|
4030
4029
|
return !1;
|
|
4031
4030
|
}
|
|
@@ -4046,10 +4045,10 @@ var Ht = class extends At {
|
|
|
4046
4045
|
return this.match(135) || this.match(4) || this.hasPrecedingLineBreak();
|
|
4047
4046
|
}
|
|
4048
4047
|
hasPrecedingLineBreak() {
|
|
4049
|
-
return
|
|
4048
|
+
return ct(this.input, this.offsetToSourcePos(this.state.lastTokEndLoc.index), this.state.start);
|
|
4050
4049
|
}
|
|
4051
4050
|
hasFollowingLineBreak() {
|
|
4052
|
-
return
|
|
4051
|
+
return ct(this.input, this.state.end, this.nextTokenStart());
|
|
4053
4052
|
}
|
|
4054
4053
|
isLineTerminator() {
|
|
4055
4054
|
return this.eat(9) || this.canInsertSemicolon();
|
|
@@ -4109,7 +4108,7 @@ var Ht = class extends At {
|
|
|
4109
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);
|
|
4110
4109
|
}
|
|
4111
4110
|
isLiteralPropertyName() {
|
|
4112
|
-
return
|
|
4111
|
+
return ge(this.state.type);
|
|
4113
4112
|
}
|
|
4114
4113
|
isPrivateName(e) {
|
|
4115
4114
|
return e.type === "PrivateName";
|
|
@@ -4136,11 +4135,11 @@ var Ht = class extends At {
|
|
|
4136
4135
|
let i = this.scope, a = this.getScopeHandler();
|
|
4137
4136
|
this.scope = new a(this, e);
|
|
4138
4137
|
let o = this.prodParam;
|
|
4139
|
-
this.prodParam = new
|
|
4138
|
+
this.prodParam = new Ht();
|
|
4140
4139
|
let s = this.classScope;
|
|
4141
|
-
this.classScope = new
|
|
4140
|
+
this.classScope = new Pt(this);
|
|
4142
4141
|
let c = this.expressionScope;
|
|
4143
|
-
return this.expressionScope = new
|
|
4142
|
+
return this.expressionScope = new Lt(this), () => {
|
|
4144
4143
|
this.state.labels = t, this.exportedIdentifiers = n, this.inModule = r, this.scope = i, this.prodParam = o, this.classScope = s, this.expressionScope = c;
|
|
4145
4144
|
};
|
|
4146
4145
|
}
|
|
@@ -4156,18 +4155,18 @@ var Ht = class extends At {
|
|
|
4156
4155
|
let { privateKeyLoc: t } = e;
|
|
4157
4156
|
t !== null && this.expectPlugin("destructuringPrivate", t);
|
|
4158
4157
|
}
|
|
4159
|
-
},
|
|
4158
|
+
}, Gt = class {
|
|
4160
4159
|
shorthandAssignLoc = null;
|
|
4161
4160
|
doubleProtoLoc = null;
|
|
4162
4161
|
privateKeyLoc = null;
|
|
4163
4162
|
optionalParametersLoc = null;
|
|
4164
4163
|
voidPatternLoc = null;
|
|
4165
|
-
},
|
|
4164
|
+
}, V = class {
|
|
4166
4165
|
constructor(e, n, r, i) {
|
|
4167
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);
|
|
4168
4167
|
}
|
|
4169
4168
|
type = "";
|
|
4170
|
-
},
|
|
4169
|
+
}, Kt = V.prototype, qt = class extends Wt {
|
|
4171
4170
|
createPosition(e) {
|
|
4172
4171
|
return e;
|
|
4173
4172
|
}
|
|
@@ -4177,11 +4176,11 @@ var Ht = class extends At {
|
|
|
4177
4176
|
}
|
|
4178
4177
|
startNodeAt(e) {
|
|
4179
4178
|
let { optionFlags: t, filename: n } = this;
|
|
4180
|
-
return t & 256 ? new
|
|
4179
|
+
return t & 256 ? new V(t, n, e.index, this.createPosition(e)) : new V(t, n, e.index);
|
|
4181
4180
|
}
|
|
4182
4181
|
startNodeAtNode(e) {
|
|
4183
4182
|
let { optionFlags: t, filename: n } = this;
|
|
4184
|
-
return t & 256 ? new
|
|
4183
|
+
return t & 256 ? new V(t, n, e.start, e.loc.start) : new V(t, n, e.start);
|
|
4185
4184
|
}
|
|
4186
4185
|
finishNode(e, t) {
|
|
4187
4186
|
return this.finishNodeAt(e, t, this.state.lastTokEndLoc);
|
|
@@ -4220,17 +4219,17 @@ var Ht = class extends At {
|
|
|
4220
4219
|
return e.type = t, e;
|
|
4221
4220
|
}
|
|
4222
4221
|
cloneIdentifier(e) {
|
|
4223
|
-
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);
|
|
4224
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;
|
|
4225
4224
|
}
|
|
4226
4225
|
cloneStringLiteral(e) {
|
|
4227
|
-
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);
|
|
4228
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;
|
|
4229
4228
|
}
|
|
4230
|
-
},
|
|
4229
|
+
}, Jt = (e) => e.type === "ParenthesizedExpression" ? Jt(e.expression) : e, Yt = class extends qt {
|
|
4231
4230
|
toAssignable(e, t = !1) {
|
|
4232
4231
|
let n;
|
|
4233
|
-
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) {
|
|
4234
4233
|
case "Identifier":
|
|
4235
4234
|
case "ObjectPattern":
|
|
4236
4235
|
case "ArrayPattern":
|
|
@@ -4397,7 +4396,7 @@ var Ht = class extends At {
|
|
|
4397
4396
|
return;
|
|
4398
4397
|
}
|
|
4399
4398
|
s === "VoidPattern" && t.type === "CatchClause" && this.raise(g.VoidPatternCatchClauseParam, e);
|
|
4400
|
-
let l =
|
|
4399
|
+
let l = Jt(e);
|
|
4401
4400
|
o ||= l.type === "CallExpression" && (l.callee.type === "Import" || l.callee.type === "Super");
|
|
4402
4401
|
let u = this.isValidLVal(s, o, !(a || e.extra?.parenthesized) && t.type === "AssignmentExpression", n);
|
|
4403
4402
|
if (u === !0) return;
|
|
@@ -4413,7 +4412,7 @@ var Ht = class extends At {
|
|
|
4413
4412
|
else m && this.checkLVal(m, p, n, r, i, f, o);
|
|
4414
4413
|
}
|
|
4415
4414
|
checkIdentifier(e, t, n = !1) {
|
|
4416
|
-
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);
|
|
4417
4416
|
}
|
|
4418
4417
|
declareNameFromIdentifier(e, t) {
|
|
4419
4418
|
this.scope.declareName(e.name, t, e.start);
|
|
@@ -4433,7 +4432,7 @@ var Ht = class extends At {
|
|
|
4433
4432
|
checkCommaAfterRest(e) {
|
|
4434
4433
|
return this.match(8) ? (this.raise(this.lookaheadCharCode() === e ? g.RestTrailingComma : g.ElementAfterRest, this.state.startLoc), !0) : !1;
|
|
4435
4434
|
}
|
|
4436
|
-
},
|
|
4435
|
+
}, Xt = class extends Yt {
|
|
4437
4436
|
checkProto(e, t, n) {
|
|
4438
4437
|
if (e.type === "SpreadElement" || this.isObjectMethod(e) || e.computed || e.shorthand) return t;
|
|
4439
4438
|
let r = e.key;
|
|
@@ -4446,7 +4445,7 @@ var Ht = class extends At {
|
|
|
4446
4445
|
if (this.enterInitialScopes(), this.nextToken(), this.match(135)) throw this.raise(g.ParseExpressionEmptyInput, this.state.startLoc);
|
|
4447
4446
|
let e = this.parseExpression();
|
|
4448
4447
|
if (!this.match(135)) throw this.raise(g.ParseExpressionExpectsEOF, this.state.startLoc, { unexpected: this.input.codePointAt(this.state.start) });
|
|
4449
|
-
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;
|
|
4450
4449
|
}
|
|
4451
4450
|
parseExpression(e, t) {
|
|
4452
4451
|
return e ? this.disallowInAnd(() => this.parseExpressionBase(t)) : this.allowInAnd(() => this.parseExpressionBase(t));
|
|
@@ -4477,9 +4476,9 @@ var Ht = class extends At {
|
|
|
4477
4476
|
return t && (e = t.call(this, e, n)), e;
|
|
4478
4477
|
}
|
|
4479
4478
|
let i;
|
|
4480
|
-
e ? i = !1 : (e = new
|
|
4479
|
+
e ? i = !1 : (e = new Gt(), i = !0), this.state.canStartArrow = !0;
|
|
4481
4480
|
let a = this.parseMaybeConditional(e);
|
|
4482
|
-
if (t && (a = t.call(this, a, n)),
|
|
4481
|
+
if (t && (a = t.call(this, a, n)), ve(this.state.type)) {
|
|
4483
4482
|
let t = this.startNodeAt(n), r = this.state.value;
|
|
4484
4483
|
if (t.operator = r, this.match(25)) {
|
|
4485
4484
|
this.toAssignable(a, !0), t.left = a;
|
|
@@ -4490,7 +4489,7 @@ var Ht = class extends At {
|
|
|
4490
4489
|
}
|
|
4491
4490
|
if (i && this.checkExpressionErrors(e, !0), r) {
|
|
4492
4491
|
let { type: e } = this.state;
|
|
4493
|
-
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);
|
|
4494
4493
|
}
|
|
4495
4494
|
return a;
|
|
4496
4495
|
}
|
|
@@ -4515,17 +4514,17 @@ var Ht = class extends At {
|
|
|
4515
4514
|
parseExprOp(e, t, n) {
|
|
4516
4515
|
if (this.isPrivateName(e)) {
|
|
4517
4516
|
let r = this.getPrivateNameSV(e);
|
|
4518
|
-
(n >=
|
|
4517
|
+
(n >= De(54) || !this.prodParam.hasIn || !this.match(54)) && this.raise(g.PrivateInExpectedIn, t, { identifierName: r }), this.classScope.usePrivateName(r, t);
|
|
4519
4518
|
}
|
|
4520
4519
|
let r = this.state.type;
|
|
4521
|
-
if (
|
|
4522
|
-
let i =
|
|
4520
|
+
if (Se(r) && (this.prodParam.hasIn || !this.match(54))) {
|
|
4521
|
+
let i = De(r);
|
|
4523
4522
|
if (i > n) {
|
|
4524
4523
|
if (r === 35 && (this.expectPlugin("pipelineOperator"), this.prodParam.inFSharpPipelineDirectBody)) return e;
|
|
4525
4524
|
let a = this.startNodeAt(t);
|
|
4526
4525
|
a.left = e, a.operator = this.state.value;
|
|
4527
4526
|
let o = r === 37 || r === 38, s = r === 36;
|
|
4528
|
-
s && (i =
|
|
4527
|
+
s && (i = De(38)), this.next(), a.right = this.parseExprOpRightExpr(r, i);
|
|
4529
4528
|
let c = this.finishNode(a, o || s ? "LogicalExpression" : "BinaryExpression"), l = this.state.type;
|
|
4530
4529
|
if (s && (l === 37 || l === 38) || o && l === 36) throw this.raise(g.MixingCoalesceWithLogical, this.state.startLoc);
|
|
4531
4530
|
return this.parseExprOp(c, t, n);
|
|
@@ -4544,7 +4543,7 @@ var Ht = class extends At {
|
|
|
4544
4543
|
}
|
|
4545
4544
|
parseExprOpBaseRightExpr(e, t) {
|
|
4546
4545
|
let n = this.state.startLoc;
|
|
4547
|
-
return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), n,
|
|
4546
|
+
return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), n, Oe(e) ? t - 1 : t);
|
|
4548
4547
|
}
|
|
4549
4548
|
parseHackPipeBody() {
|
|
4550
4549
|
let { startLoc: e } = this.state, t = this.parseMaybeAssign();
|
|
@@ -4561,7 +4560,7 @@ var Ht = class extends At {
|
|
|
4561
4560
|
return t || this.checkExponentialAfterUnary(e), e;
|
|
4562
4561
|
}
|
|
4563
4562
|
let i = this.match(30), a = this.startNode();
|
|
4564
|
-
if (
|
|
4563
|
+
if (we(this.state.type)) {
|
|
4565
4564
|
a.operator = this.state.value, a.prefix = !0, this.state.canStartArrow = !1, this.match(68) && this.expectPlugin("throwExpressions");
|
|
4566
4565
|
let n = this.match(85);
|
|
4567
4566
|
if (this.next(), a.argument = this.parseMaybeUnary(null, !0), this.checkExpressionErrors(e, !0), this.state.strict && n) {
|
|
@@ -4573,7 +4572,7 @@ var Ht = class extends At {
|
|
|
4573
4572
|
let o = this.parseUpdate(a, i, e);
|
|
4574
4573
|
if (r) {
|
|
4575
4574
|
let { type: e } = this.state;
|
|
4576
|
-
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);
|
|
4577
4576
|
}
|
|
4578
4577
|
return o;
|
|
4579
4578
|
}
|
|
@@ -4584,7 +4583,7 @@ var Ht = class extends At {
|
|
|
4584
4583
|
}
|
|
4585
4584
|
let r = this.state.startLoc, i = this.parseExprSubscripts(n);
|
|
4586
4585
|
if (this.checkExpressionErrors(n, !1)) return i;
|
|
4587
|
-
for (;
|
|
4586
|
+
for (; Ce(this.state.type) && !this.canInsertSemicolon();) {
|
|
4588
4587
|
let e = this.startNodeAt(r);
|
|
4589
4588
|
e.operator = this.state.value, e.prefix = !1, e.argument = i, this.next(), this.checkLVal(i, i = this.finishNode(e, "UpdateExpression"));
|
|
4590
4589
|
}
|
|
@@ -4610,7 +4609,7 @@ var Ht = class extends At {
|
|
|
4610
4609
|
parseSubscript(e, t, n, r) {
|
|
4611
4610
|
let { type: i } = this.state;
|
|
4612
4611
|
if (!n && i === 11) return this.parseBind(e, t, r);
|
|
4613
|
-
if (
|
|
4612
|
+
if (ke(i)) return this.parseTaggedTemplateExpression(e, t, r);
|
|
4614
4613
|
let a = !1;
|
|
4615
4614
|
if (i === 14) {
|
|
4616
4615
|
if (n && (this.raise(g.OptionalChainingNoNew, this.state.startLoc), this.lookaheadCharCode() === 40)) return this.stopParseSubscript(e, r);
|
|
@@ -4642,7 +4641,7 @@ var Ht = class extends At {
|
|
|
4642
4641
|
let a = this.startNodeAt(t);
|
|
4643
4642
|
a.callee = e;
|
|
4644
4643
|
let { maybeAsyncArrow: o, optionalChainMember: s } = n;
|
|
4645
|
-
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);
|
|
4646
4645
|
let c = this.finishCallExpression(a, s);
|
|
4647
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;
|
|
4648
4647
|
}
|
|
@@ -4676,7 +4675,7 @@ var Ht = class extends At {
|
|
|
4676
4675
|
return this.match(15) && !this.canInsertSemicolon();
|
|
4677
4676
|
}
|
|
4678
4677
|
parseAsyncArrowFromCallExpression(e, t) {
|
|
4679
|
-
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;
|
|
4680
4679
|
}
|
|
4681
4680
|
parseNoCallExpr() {
|
|
4682
4681
|
let e = this.state.startLoc;
|
|
@@ -4726,20 +4725,20 @@ var Ht = class extends At {
|
|
|
4726
4725
|
}
|
|
4727
4726
|
case 43: {
|
|
4728
4727
|
let e = this.input.codePointAt(this.nextTokenStart());
|
|
4729
|
-
throw
|
|
4728
|
+
throw j(e) || e === 62 ? this.expectOnePlugin([
|
|
4730
4729
|
"jsx",
|
|
4731
4730
|
"flow",
|
|
4732
4731
|
"typescript"
|
|
4733
4732
|
]) : this.unexpected();
|
|
4734
4733
|
}
|
|
4735
4734
|
default:
|
|
4736
|
-
if (
|
|
4735
|
+
if (E(r)) {
|
|
4737
4736
|
if (this.isContextual(123) && this.lookaheadInLineCharCode() === 123) return this.parseModuleExpression();
|
|
4738
4737
|
let { canStartArrow: e, containsEsc: t } = this.state, n = this.parseIdentifier();
|
|
4739
4738
|
if (!t && n.name === "async" && !this.canInsertSemicolon()) {
|
|
4740
4739
|
let { type: t } = this.state;
|
|
4741
4740
|
if (t === 64) return this.resetPreviousNodeTrailingComments(n), this.next(), this.parseAsyncFunctionExpression(this.startNodeAtNode(n));
|
|
4742
|
-
if (
|
|
4741
|
+
if (E(t)) return e && this.lookaheadCharCode() === 61 ? this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(n)) : n;
|
|
4743
4742
|
if (t === 86) return this.resetPreviousNodeTrailingComments(n), this.parseDo(this.startNodeAtNode(n), !0);
|
|
4744
4743
|
}
|
|
4745
4744
|
return e && this.match(15) && !this.canInsertSemicolon() ? (this.next(), this.parseArrowExpression(this.startNodeAtNode(n), [n], !1)) : n;
|
|
@@ -4758,16 +4757,16 @@ var Ht = class extends At {
|
|
|
4758
4757
|
}
|
|
4759
4758
|
finishTopicReference(e, t, n, r) {
|
|
4760
4759
|
if (this.testTopicReferenceConfiguration(n, t, r)) return this.topicReferenceIsAllowedInCurrentContext() || this.raise(g.PipeTopicUnbound, t), this.registerTopicReference(), this.finishNode(e, "TopicReference");
|
|
4761
|
-
throw this.raise(g.PipeTopicUnconfiguredToken, t, { token:
|
|
4760
|
+
throw this.raise(g.PipeTopicUnconfiguredToken, t, { token: k(r) });
|
|
4762
4761
|
}
|
|
4763
4762
|
testTopicReferenceConfiguration(e, t, n) {
|
|
4764
4763
|
switch (e) {
|
|
4765
|
-
case "hack": return this.hasPlugin(["pipelineOperator", { topicToken:
|
|
4764
|
+
case "hack": return this.hasPlugin(["pipelineOperator", { topicToken: k(n) }]);
|
|
4766
4765
|
default: throw this.raise(g.PipeTopicRequiresHackPipes, t);
|
|
4767
4766
|
}
|
|
4768
4767
|
}
|
|
4769
4768
|
parseAsyncArrowUnaryFunction(e) {
|
|
4770
|
-
this.prodParam.enter(
|
|
4769
|
+
this.prodParam.enter(Ut(!0, this.prodParam.hasYield));
|
|
4771
4770
|
let t = [this.parseIdentifier()];
|
|
4772
4771
|
return this.prodParam.exit(), this.hasPrecedingLineBreak() && this.raise(g.LineTerminatorBeforeArrow, this.state.curPosition()), this.expect(15), this.parseArrowExpression(e, t, !0);
|
|
4773
4772
|
}
|
|
@@ -4846,8 +4845,8 @@ var Ht = class extends At {
|
|
|
4846
4845
|
}
|
|
4847
4846
|
parseParenAndDistinguishExpression(e) {
|
|
4848
4847
|
let t = this.state.startLoc, n;
|
|
4849
|
-
this.next(), this.expressionScope.enter(
|
|
4850
|
-
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;
|
|
4851
4850
|
for (; !this.match(7);) {
|
|
4852
4851
|
if (o) o = !1;
|
|
4853
4852
|
else if (this.expect(8, a.optionalParametersLoc === null ? null : a.optionalParametersLoc), this.match(7)) {
|
|
@@ -4993,7 +4992,7 @@ var Ht = class extends At {
|
|
|
4993
4992
|
if (this.eat(0)) e.computed = !0, e.key = this.parseMaybeAssignAllowIn(), this.expect(1);
|
|
4994
4993
|
else {
|
|
4995
4994
|
let { type: n, value: r } = this.state, i;
|
|
4996
|
-
if (
|
|
4995
|
+
if (D(n)) i = this.parseIdentifier(!0);
|
|
4997
4996
|
else switch (n) {
|
|
4998
4997
|
case 131:
|
|
4999
4998
|
i = this.parseNumericLiteral(r);
|
|
@@ -5018,7 +5017,7 @@ var Ht = class extends At {
|
|
|
5018
5017
|
e.id = null, e.generator = !1, e.async = t;
|
|
5019
5018
|
}
|
|
5020
5019
|
parseMethod(e, t, n, r, i, a, o = !1) {
|
|
5021
|
-
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);
|
|
5022
5021
|
let s = this.parseFunctionBodyAndFinish(e, a, !0);
|
|
5023
5022
|
return this.prodParam.exit(), this.scope.exit(), s;
|
|
5024
5023
|
}
|
|
@@ -5028,7 +5027,7 @@ var Ht = class extends At {
|
|
|
5028
5027
|
}
|
|
5029
5028
|
parseArrowExpression(e, t, n, r) {
|
|
5030
5029
|
this.scope.enter(518);
|
|
5031
|
-
let i =
|
|
5030
|
+
let i = Ut(n, !1);
|
|
5032
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");
|
|
5033
5032
|
}
|
|
5034
5033
|
setArrowFunctionParameters(e, t, n) {
|
|
@@ -5039,7 +5038,7 @@ var Ht = class extends At {
|
|
|
5039
5038
|
}
|
|
5040
5039
|
parseFunctionBody(e, t, n = !1) {
|
|
5041
5040
|
let r = t && !this.match(2);
|
|
5042
|
-
if (this.expressionScope.enter(
|
|
5041
|
+
if (this.expressionScope.enter(Vt()), r) e.body = this.parseMaybeAssign(), this.checkParams(e, !1, t, !1);
|
|
5043
5042
|
else {
|
|
5044
5043
|
let r = this.state.strict, i = this.state.labels;
|
|
5045
5044
|
this.state.labels = [], this.prodParam.enter(this.prodParam.currentFlags() | 4), e.body = this.parseBlock(!0, !1, (i) => {
|
|
@@ -5099,17 +5098,17 @@ var Ht = class extends At {
|
|
|
5099
5098
|
}
|
|
5100
5099
|
parseIdentifierName(e) {
|
|
5101
5100
|
let t, { start: n, type: r } = this.state;
|
|
5102
|
-
|
|
5103
|
-
let i =
|
|
5101
|
+
D(r) ? t = this.state.value : this.unexpected();
|
|
5102
|
+
let i = he(r);
|
|
5104
5103
|
return e ? i && this.replaceToken(128) : this.checkReservedWord(t, this.sourceToOffsetPos(n), i, !1), this.next(), t;
|
|
5105
5104
|
}
|
|
5106
5105
|
checkReservedWord(e, t, n, r) {
|
|
5107
|
-
if (!(e.length > 10) &&
|
|
5108
|
-
if (n &&
|
|
5106
|
+
if (!(e.length > 10) && Je(e)) {
|
|
5107
|
+
if (n && Ge(e)) {
|
|
5109
5108
|
this.raise(g.UnexpectedKeyword, t, { keyword: e });
|
|
5110
5109
|
return;
|
|
5111
5110
|
}
|
|
5112
|
-
if ((this.state.strict ? r ?
|
|
5111
|
+
if ((this.state.strict ? r ? We : He : Ve)(e, this.inModule)) {
|
|
5113
5112
|
this.raise(g.UnexpectedReservedWord, t, { reservedWord: e });
|
|
5114
5113
|
return;
|
|
5115
5114
|
}
|
|
@@ -5147,7 +5146,7 @@ var Ht = class extends At {
|
|
|
5147
5146
|
isAmbiguousPrefixOrIdentifier() {
|
|
5148
5147
|
if (this.hasPrecedingLineBreak()) return !0;
|
|
5149
5148
|
let { type: e } = this.state;
|
|
5150
|
-
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;
|
|
5151
5150
|
}
|
|
5152
5151
|
parseYield(e) {
|
|
5153
5152
|
this.setLoc(e);
|
|
@@ -5225,7 +5224,7 @@ var Ht = class extends At {
|
|
|
5225
5224
|
if (this.isContextual(92) && this.recordAwaitIfAllowed()) {
|
|
5226
5225
|
this.next(), n = this.parseAwait(t, !0);
|
|
5227
5226
|
let e = this.state.type;
|
|
5228
|
-
|
|
5227
|
+
Se(e) && e !== 35 && (this.prodParam.hasIn || e !== 54) && this.raise(g.PipelineUnparenthesized, t);
|
|
5229
5228
|
} else this.state.canStartArrow = !0, n = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), t, e);
|
|
5230
5229
|
return this.prodParam.exit(), n;
|
|
5231
5230
|
}
|
|
@@ -5257,17 +5256,17 @@ var Ht = class extends At {
|
|
|
5257
5256
|
return this.parseMaybeAssignAllowIn(t, n);
|
|
5258
5257
|
}
|
|
5259
5258
|
parsePropertyNamePrefixOperator(e) {}
|
|
5260
|
-
},
|
|
5261
|
-
function
|
|
5259
|
+
}, Zt = { kind: 1 }, Qt = { kind: 2 }, $t = /[\uD800-\uDFFF]/u, en = /in(?:stanceof)?/y;
|
|
5260
|
+
function tn(e) {
|
|
5262
5261
|
for (let t = 0; t < e.length; t++) {
|
|
5263
5262
|
let n = e[t], { type: r } = n;
|
|
5264
|
-
typeof r == "number" && (n.type =
|
|
5263
|
+
typeof r == "number" && (n.type = Ae(r));
|
|
5265
5264
|
}
|
|
5266
5265
|
return e;
|
|
5267
5266
|
}
|
|
5268
|
-
var
|
|
5267
|
+
var nn = class extends Xt {
|
|
5269
5268
|
parseTopLevel(e, t) {
|
|
5270
|
-
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");
|
|
5271
5270
|
}
|
|
5272
5271
|
parseProgram(e, t, r) {
|
|
5273
5272
|
if (e.sourceType = r, e.interpreter = this.parseInterpreterDirective(), this.parseBlockBody(e, !0, !0, t), this.inModule) {
|
|
@@ -5316,10 +5315,10 @@ var en = class extends Jt {
|
|
|
5316
5315
|
return !1;
|
|
5317
5316
|
}
|
|
5318
5317
|
chStartsBindingIdentifier(e, t) {
|
|
5319
|
-
if (
|
|
5320
|
-
if (
|
|
5321
|
-
let e = this.codePointAtPos(
|
|
5322
|
-
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;
|
|
5323
5322
|
}
|
|
5324
5323
|
return !0;
|
|
5325
5324
|
}
|
|
@@ -5405,7 +5404,7 @@ var en = class extends Jt {
|
|
|
5405
5404
|
default: if (this.isAsyncFunction()) return i || this.raise(g.AsyncFunctionInSingleStatementContext, this.state.startLoc), this.next(), this.parseFunctionStatement(r, !0, !i && a);
|
|
5406
5405
|
}
|
|
5407
5406
|
let s = this.state.value, c = this.parseExpression();
|
|
5408
|
-
return
|
|
5407
|
+
return E(n) && c.type === "Identifier" && this.eat(10) ? this.parseLabeledStatement(r, s, c, e) : this.parseExpressionStatement(r, c, t);
|
|
5409
5408
|
}
|
|
5410
5409
|
assertModuleNodeAllowed(e) {
|
|
5411
5410
|
!(this.optionFlags & 8) && !this.inModule && this.raise(g.ImportOutsideModule, e);
|
|
@@ -5475,10 +5474,10 @@ var en = class extends Jt {
|
|
|
5475
5474
|
return this.expect(7), e;
|
|
5476
5475
|
}
|
|
5477
5476
|
parseDoWhileStatement(e) {
|
|
5478
|
-
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");
|
|
5479
5478
|
}
|
|
5480
5479
|
parseForStatement(e) {
|
|
5481
|
-
this.next(), this.state.labels.push(
|
|
5480
|
+
this.next(), this.state.labels.push(Zt);
|
|
5482
5481
|
let t = null;
|
|
5483
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);
|
|
5484
5483
|
let n = this.isContextual(96);
|
|
@@ -5491,7 +5490,7 @@ var en = class extends Jt {
|
|
|
5491
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));
|
|
5492
5491
|
}
|
|
5493
5492
|
}
|
|
5494
|
-
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);
|
|
5495
5494
|
if (o && (n && this.raise(g.ForOfLet, a), t === null && r && a.type === "Identifier" && this.raise(g.ForOfAsync, a)), o || this.match(54)) {
|
|
5496
5495
|
this.checkDestructuringPrivate(i), this.toAssignable(a, !0);
|
|
5497
5496
|
let n = o ? "ForOfStatement" : "ForInStatement";
|
|
@@ -5511,7 +5510,7 @@ var en = class extends Jt {
|
|
|
5511
5510
|
parseSwitchStatement(e) {
|
|
5512
5511
|
this.next(), e.discriminant = this.parseHeaderExpression();
|
|
5513
5512
|
let t = e.cases = [];
|
|
5514
|
-
this.expect(2), this.state.labels.push(
|
|
5513
|
+
this.expect(2), this.state.labels.push(Qt), this.scope.enter(256);
|
|
5515
5514
|
let n;
|
|
5516
5515
|
for (let e; !this.match(4);) if (this.match(57) || this.match(61)) {
|
|
5517
5516
|
let r = this.match(57);
|
|
@@ -5537,7 +5536,7 @@ var en = class extends Jt {
|
|
|
5537
5536
|
return this.next(), this.parseVar(e, !1, t, n), this.semicolon(), this.finishNode(e, "VariableDeclaration");
|
|
5538
5537
|
}
|
|
5539
5538
|
parseWhileStatement(e) {
|
|
5540
|
-
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");
|
|
5541
5540
|
}
|
|
5542
5541
|
parseWithStatement(e) {
|
|
5543
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");
|
|
@@ -5547,7 +5546,7 @@ var en = class extends Jt {
|
|
|
5547
5546
|
}
|
|
5548
5547
|
parseLabeledStatement(e, t, n, r) {
|
|
5549
5548
|
for (let e of this.state.labels) e.name === t && this.raise(g.LabelRedeclaration, n, { labelName: t });
|
|
5550
|
-
let i =
|
|
5549
|
+
let i = be(this.state.type) ? 1 : this.match(67) ? 2 : null;
|
|
5551
5550
|
for (let t = this.state.labels.length - 1; t >= 0; t--) {
|
|
5552
5551
|
let n = this.state.labels[t];
|
|
5553
5552
|
if (n.statementStart === e.start) n.statementStart = this.sourceToOffsetPos(this.state.start), n.kind = i;
|
|
@@ -5613,13 +5612,13 @@ var en = class extends Jt {
|
|
|
5613
5612
|
}
|
|
5614
5613
|
parseFunction(e, t = 0) {
|
|
5615
5614
|
let n = t & 2, r = !!(t & 1), i = r && !(t & 4), a = !!(t & 8);
|
|
5616
|
-
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;
|
|
5617
5616
|
}
|
|
5618
5617
|
parseFunctionId(e) {
|
|
5619
|
-
return e ||
|
|
5618
|
+
return e || E(this.state.type) ? this.parseIdentifier() : null;
|
|
5620
5619
|
}
|
|
5621
5620
|
parseFunctionParams(e, t) {
|
|
5622
|
-
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();
|
|
5623
5622
|
}
|
|
5624
5623
|
registerFunctionStatementId(e) {
|
|
5625
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);
|
|
@@ -5697,7 +5696,7 @@ var en = class extends Jt {
|
|
|
5697
5696
|
this.isNonstaticConstructor(i) && this.raise(g.ConstructorIsGenerator, i.key), this.pushClassMethod(e, i, !0, !1, !1, !1);
|
|
5698
5697
|
return;
|
|
5699
5698
|
}
|
|
5700
|
-
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;
|
|
5701
5700
|
if (this.parsePostMemberNameModifiers(u), this.isClassMethod()) {
|
|
5702
5701
|
if (l.kind = "method", m) {
|
|
5703
5702
|
this.pushClassPrivateMethod(e, a, !1, !1);
|
|
@@ -5773,10 +5772,10 @@ var en = class extends Jt {
|
|
|
5773
5772
|
return this.parseInitializer(e), this.semicolon(), this.finishNode(e, "ClassAccessorProperty");
|
|
5774
5773
|
}
|
|
5775
5774
|
parseInitializer(e) {
|
|
5776
|
-
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();
|
|
5777
5776
|
}
|
|
5778
5777
|
parseClassId(e, t, n, r = 8331) {
|
|
5779
|
-
if (
|
|
5778
|
+
if (E(this.state.type)) e.id = this.parseIdentifier(), t && this.declareNameFromIdentifier(e.id, r);
|
|
5780
5779
|
else if (n || !t) e.id = null;
|
|
5781
5780
|
else throw this.raise(g.MissingClassName, this.state.startLoc);
|
|
5782
5781
|
}
|
|
@@ -5861,7 +5860,7 @@ var en = class extends Jt {
|
|
|
5861
5860
|
}
|
|
5862
5861
|
isExportDefaultSpecifier() {
|
|
5863
5862
|
let { type: e } = this.state;
|
|
5864
|
-
if (
|
|
5863
|
+
if (E(e)) {
|
|
5865
5864
|
if (e === 91 && !this.state.containsEsc || e === 96) return !1;
|
|
5866
5865
|
if ((e === 126 || e === 125) && !this.state.containsEsc) {
|
|
5867
5866
|
let e = this.nextTokenStart(), t = this.input.charCodeAt(e);
|
|
@@ -5869,7 +5868,7 @@ var en = class extends Jt {
|
|
|
5869
5868
|
}
|
|
5870
5869
|
} else if (!this.match(61)) return !1;
|
|
5871
5870
|
let t = this.nextTokenStart(), n = this.isUnparsedContextual(t, "from");
|
|
5872
|
-
if (this.input.charCodeAt(t) === 44 ||
|
|
5871
|
+
if (this.input.charCodeAt(t) === 44 || E(this.state.type) && n) return !0;
|
|
5873
5872
|
if (this.match(61) && n) {
|
|
5874
5873
|
let e = this.input.charCodeAt(this.nextTokenStartSince(t + 4));
|
|
5875
5874
|
return e === 34 || e === 39;
|
|
@@ -5934,7 +5933,7 @@ var en = class extends Jt {
|
|
|
5934
5933
|
}
|
|
5935
5934
|
parseModuleExportName() {
|
|
5936
5935
|
if (this.match(130)) {
|
|
5937
|
-
let e = this.parseStringLiteral(this.state.value), t =
|
|
5936
|
+
let e = this.parseStringLiteral(this.state.value), t = $t.exec(e.value);
|
|
5938
5937
|
return t && this.raise(g.ModuleExportNameHasLoneSurrogate, e, { surrogateCharCode: t[0].charCodeAt(0) }), e;
|
|
5939
5938
|
}
|
|
5940
5939
|
return this.parseIdentifier(!0);
|
|
@@ -5952,11 +5951,11 @@ var en = class extends Jt {
|
|
|
5952
5951
|
parseMaybeImportPhase(e, t) {
|
|
5953
5952
|
if (!this.isPotentialImportPhase(t)) return this.applyImportPhase(e, t, null), null;
|
|
5954
5953
|
let n = this.startNode(), r = this.parseIdentifierName(!0), { type: i } = this.state;
|
|
5955
|
-
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));
|
|
5956
5955
|
}
|
|
5957
5956
|
isPrecedingIdImportPhase(e) {
|
|
5958
5957
|
let { type: t } = this.state;
|
|
5959
|
-
return
|
|
5958
|
+
return E(t) ? t !== 94 || this.lookaheadCharCode() === 102 : t !== 8;
|
|
5960
5959
|
}
|
|
5961
5960
|
parseImport(e) {
|
|
5962
5961
|
return this.match(130) ? this.parseImportSourceAndAttributes(e) : this.parseImportSpecifiersAndAfter(e, this.parseMaybeImportPhase(e, !1));
|
|
@@ -6002,7 +6001,7 @@ var en = class extends Jt {
|
|
|
6002
6001
|
let n = this.startNodeAtNode(t);
|
|
6003
6002
|
return n.local = t, e.specifiers.push(this.finishImportSpecifier(n, "ImportDefaultSpecifier")), !0;
|
|
6004
6003
|
}
|
|
6005
|
-
return
|
|
6004
|
+
return D(this.state.type) ? (this.parseImportSpecifierLocal(e, this.startNode(), "ImportDefaultSpecifier"), !0) : !1;
|
|
6006
6005
|
}
|
|
6007
6006
|
maybeParseStarImportSpecifier(e) {
|
|
6008
6007
|
if (this.match(51)) {
|
|
@@ -6037,15 +6036,15 @@ var en = class extends Jt {
|
|
|
6037
6036
|
isThisParam(e) {
|
|
6038
6037
|
return e.type === "Identifier" && e.name === "this";
|
|
6039
6038
|
}
|
|
6040
|
-
},
|
|
6041
|
-
function
|
|
6039
|
+
}, rn = /in(?:stanceof)?|as|satisfies/y;
|
|
6040
|
+
function an(e) {
|
|
6042
6041
|
if (e == null) throw Error(`Unexpected ${e} value.`);
|
|
6043
6042
|
return e;
|
|
6044
6043
|
}
|
|
6045
|
-
function
|
|
6044
|
+
function on(e) {
|
|
6046
6045
|
if (!e) throw Error("Assert fail");
|
|
6047
6046
|
}
|
|
6048
|
-
var
|
|
6047
|
+
var H = h`typescript`({
|
|
6049
6048
|
AbstractMethodHasImplementation: ({ methodName: e }) => `Method '${e}' cannot have an implementation because it is marked abstract.`,
|
|
6050
6049
|
AbstractPropertyHasInitializer: ({ propertyName: e }) => `Property '${e}' cannot have an initializer because it is marked abstract.`,
|
|
6051
6050
|
AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.",
|
|
@@ -6123,7 +6122,7 @@ var W = h`typescript`({
|
|
|
6123
6122
|
UnsupportedSignatureParameterKind: ({ type: e }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,
|
|
6124
6123
|
UsingDeclarationInAmbientContext: (e) => `'${e}' declarations are not allowed in ambient contexts.`
|
|
6125
6124
|
});
|
|
6126
|
-
function
|
|
6125
|
+
function sn(e) {
|
|
6127
6126
|
switch (e) {
|
|
6128
6127
|
case "any": return "TSAnyKeyword";
|
|
6129
6128
|
case "boolean": return "TSBooleanKeyword";
|
|
@@ -6138,27 +6137,27 @@ function an(e) {
|
|
|
6138
6137
|
default: return;
|
|
6139
6138
|
}
|
|
6140
6139
|
}
|
|
6141
|
-
function
|
|
6140
|
+
function cn(e) {
|
|
6142
6141
|
return e === "private" || e === "public" || e === "protected";
|
|
6143
6142
|
}
|
|
6144
|
-
function
|
|
6143
|
+
function ln(e) {
|
|
6145
6144
|
return e === "in" || e === "out";
|
|
6146
6145
|
}
|
|
6147
|
-
function
|
|
6146
|
+
function un(e) {
|
|
6148
6147
|
if (e.extra?.parenthesized) return !1;
|
|
6149
6148
|
switch (e.type) {
|
|
6150
6149
|
case "Identifier": return !0;
|
|
6151
|
-
case "MemberExpression": return !e.computed &&
|
|
6152
|
-
case "TSInstantiationExpression": return
|
|
6150
|
+
case "MemberExpression": return !e.computed && un(e.object);
|
|
6151
|
+
case "TSInstantiationExpression": return un(e.expression);
|
|
6153
6152
|
default: return !1;
|
|
6154
6153
|
}
|
|
6155
6154
|
}
|
|
6156
|
-
var
|
|
6155
|
+
var dn = (e) => class extends e {
|
|
6157
6156
|
getScopeHandler() {
|
|
6158
|
-
return
|
|
6157
|
+
return mt;
|
|
6159
6158
|
}
|
|
6160
6159
|
tsIsIdentifier() {
|
|
6161
|
-
return
|
|
6160
|
+
return E(this.state.type);
|
|
6162
6161
|
}
|
|
6163
6162
|
tsTokenCanFollowModifier() {
|
|
6164
6163
|
return this.match(0) || this.match(2) || this.match(51) || this.match(17) || this.match(134) || this.isLiteralPropertyName();
|
|
@@ -6170,23 +6169,23 @@ var ln = (e) => class extends e {
|
|
|
6170
6169
|
return this.match(102) ? (this.next(), this.tsTokenCanFollowModifier()) : this.tsNextTokenOnSameLineAndCanFollowModifier();
|
|
6171
6170
|
}
|
|
6172
6171
|
tsParseModifier(e, t, n) {
|
|
6173
|
-
if (!
|
|
6172
|
+
if (!E(this.state.type) && this.state.type !== 54 && this.state.type !== 71) return;
|
|
6174
6173
|
let r = this.state.value;
|
|
6175
6174
|
if (e.includes(r)) {
|
|
6176
6175
|
if (n && this.match(102) || t && this.tsIsStartOfStaticBlocks()) return;
|
|
6177
6176
|
if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) return r;
|
|
6178
6177
|
}
|
|
6179
6178
|
}
|
|
6180
|
-
tsParseModifiers({ allowedModifiers: e, disallowedModifiers: t, stopOnStartOfClassStaticBlock: n, errorTemplate: r =
|
|
6179
|
+
tsParseModifiers({ allowedModifiers: e, disallowedModifiers: t, stopOnStartOfClassStaticBlock: n, errorTemplate: r = H.InvalidModifierOnTypeMember }, i) {
|
|
6181
6180
|
let a = (e, t, n, r) => {
|
|
6182
|
-
t === n && i[r] && this.raise(
|
|
6181
|
+
t === n && i[r] && this.raise(H.InvalidModifiersOrder, e, { orderedModifiers: [n, r] });
|
|
6183
6182
|
}, o = (e, t, n, r) => {
|
|
6184
|
-
(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] });
|
|
6185
6184
|
};
|
|
6186
6185
|
for (;;) {
|
|
6187
6186
|
let { startLoc: s } = this.state, c = this.tsParseModifier(e.concat(t ?? []), n, i.static);
|
|
6188
6187
|
if (!c) break;
|
|
6189
|
-
|
|
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 });
|
|
6190
6189
|
}
|
|
6191
6190
|
}
|
|
6192
6191
|
tsIsListTerminator(e) {
|
|
@@ -6204,7 +6203,7 @@ var ln = (e) => class extends e {
|
|
|
6204
6203
|
return n;
|
|
6205
6204
|
}
|
|
6206
6205
|
tsParseDelimitedList(e, t, n) {
|
|
6207
|
-
return
|
|
6206
|
+
return an(this.tsParseDelimitedListWorker(e, t, !0, n));
|
|
6208
6207
|
}
|
|
6209
6208
|
tsParseDelimitedListWorker(e, t, n, r) {
|
|
6210
6209
|
let i = [], a = -1;
|
|
@@ -6229,7 +6228,7 @@ var ln = (e) => class extends e {
|
|
|
6229
6228
|
}
|
|
6230
6229
|
tsParseImportType() {
|
|
6231
6230
|
let e = this.startNode();
|
|
6232
|
-
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");
|
|
6233
6232
|
}
|
|
6234
6233
|
tsParseImportTypeOptions() {
|
|
6235
6234
|
let e = this.startNode();
|
|
@@ -6241,7 +6240,7 @@ var ln = (e) => class extends e {
|
|
|
6241
6240
|
let e = this.startNode(), t = [];
|
|
6242
6241
|
for (this.expect(2); !this.match(4);) {
|
|
6243
6242
|
let e = this.state.type;
|
|
6244
|
-
|
|
6243
|
+
E(e) || e === 130 ? t.push(super.parsePropertyDefinition(null)) : this.unexpected(), this.eat(8);
|
|
6245
6244
|
}
|
|
6246
6245
|
return e.properties = t, this.next(), this.finishNode(e, "ObjectExpression");
|
|
6247
6246
|
}
|
|
@@ -6289,12 +6288,12 @@ var ln = (e) => class extends e {
|
|
|
6289
6288
|
"abstract",
|
|
6290
6289
|
"override"
|
|
6291
6290
|
],
|
|
6292
|
-
errorTemplate:
|
|
6291
|
+
errorTemplate: H.InvalidModifierOnTypeParameter
|
|
6293
6292
|
});
|
|
6294
6293
|
tsParseConstModifier = this.tsParseModifiers.bind(this, {
|
|
6295
6294
|
allowedModifiers: ["const"],
|
|
6296
6295
|
disallowedModifiers: ["in", "out"],
|
|
6297
|
-
errorTemplate:
|
|
6296
|
+
errorTemplate: H.InvalidModifierOnTypeParameterPositions
|
|
6298
6297
|
});
|
|
6299
6298
|
tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, {
|
|
6300
6299
|
allowedModifiers: [
|
|
@@ -6311,7 +6310,7 @@ var ln = (e) => class extends e {
|
|
|
6311
6310
|
"abstract",
|
|
6312
6311
|
"override"
|
|
6313
6312
|
],
|
|
6314
|
-
errorTemplate:
|
|
6313
|
+
errorTemplate: H.InvalidModifierOnTypeParameter
|
|
6315
6314
|
});
|
|
6316
6315
|
tsParseTypeParameter(e) {
|
|
6317
6316
|
let t = this.startNode();
|
|
@@ -6324,7 +6323,7 @@ var ln = (e) => class extends e {
|
|
|
6324
6323
|
let t = this.startNode();
|
|
6325
6324
|
this.match(43) || this.match(138) ? this.next() : this.unexpected();
|
|
6326
6325
|
let n = { value: -1 };
|
|
6327
|
-
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");
|
|
6328
6327
|
}
|
|
6329
6328
|
tsFillSignature(e, t) {
|
|
6330
6329
|
let n = e === 15;
|
|
@@ -6334,7 +6333,7 @@ var ln = (e) => class extends e {
|
|
|
6334
6333
|
let e = super.parseBindingList(7, 41, 2);
|
|
6335
6334
|
for (let t of e) {
|
|
6336
6335
|
let { type: e } = t;
|
|
6337
|
-
(e === "AssignmentPattern" || e === "TSParameterProperty") && this.raise(
|
|
6336
|
+
(e === "AssignmentPattern" || e === "TSParameterProperty") && this.raise(H.UnsupportedSignatureParameterKind, t, { type: e });
|
|
6338
6337
|
}
|
|
6339
6338
|
return e;
|
|
6340
6339
|
}
|
|
@@ -6345,7 +6344,7 @@ var ln = (e) => class extends e {
|
|
|
6345
6344
|
return this.tsFillSignature(10, t), this.tsParseTypeMemberSemicolon(), this.finishNode(t, e);
|
|
6346
6345
|
}
|
|
6347
6346
|
tsIsUnambiguouslyIndexSignature() {
|
|
6348
|
-
return this.next(),
|
|
6347
|
+
return this.next(), E(this.state.type) ? (this.next(), this.match(10)) : !1;
|
|
6349
6348
|
}
|
|
6350
6349
|
tsTryParseIndexSignature(e) {
|
|
6351
6350
|
if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) return;
|
|
@@ -6357,16 +6356,16 @@ var ln = (e) => class extends e {
|
|
|
6357
6356
|
}
|
|
6358
6357
|
tsParsePropertyOrMethodSignature(e, t) {
|
|
6359
6358
|
if (this.eat(13) && (e.optional = !0), this.match(6) || this.match(43)) {
|
|
6360
|
-
t && this.raise(
|
|
6359
|
+
t && this.raise(H.ReadonlyForMethodSignature, e);
|
|
6361
6360
|
let n = e;
|
|
6362
|
-
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()));
|
|
6363
6362
|
else if (n.kind === "set") {
|
|
6364
6363
|
if (n.params.length !== 1) this.raise(g.BadSetterArity, this.state.curPosition());
|
|
6365
6364
|
else {
|
|
6366
6365
|
let e = n.params[0];
|
|
6367
|
-
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());
|
|
6368
6367
|
}
|
|
6369
|
-
n.returnType && this.raise(
|
|
6368
|
+
n.returnType && this.raise(H.SetAccessorCannotHaveReturnType, n.returnType);
|
|
6370
6369
|
} else n.kind = "method";
|
|
6371
6370
|
return this.finishNode(n, "TSMethodSignature");
|
|
6372
6371
|
}
|
|
@@ -6419,11 +6418,11 @@ var ln = (e) => class extends e {
|
|
|
6419
6418
|
let t = !1;
|
|
6420
6419
|
return e.elementTypes.forEach((e) => {
|
|
6421
6420
|
let { type: n } = e;
|
|
6422
|
-
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";
|
|
6423
6422
|
}), this.finishNode(e, "TSTupleType");
|
|
6424
6423
|
}
|
|
6425
6424
|
tsParseTupleElementType() {
|
|
6426
|
-
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;
|
|
6427
6426
|
if (s === 58) r = !0, a = !1, i = this.parseIdentifier(!0), this.expect(10), o = this.tsParseType();
|
|
6428
6427
|
else if (s === 63) {
|
|
6429
6428
|
a = !0;
|
|
@@ -6432,7 +6431,7 @@ var ln = (e) => class extends e {
|
|
|
6432
6431
|
} else o = this.tsParseType(), a = this.eat(13), r = this.eat(10);
|
|
6433
6432
|
if (r) {
|
|
6434
6433
|
let e;
|
|
6435
|
-
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");
|
|
6436
6435
|
} else if (a) {
|
|
6437
6436
|
let e = this.startNodeAt(n);
|
|
6438
6437
|
e.typeAnnotation = o, o = this.finishNode(e, "TSOptionalType");
|
|
@@ -6515,8 +6514,8 @@ var ln = (e) => class extends e {
|
|
|
6515
6514
|
case 20: return this.tsParseTemplateLiteralType();
|
|
6516
6515
|
default: {
|
|
6517
6516
|
let { type: e } = this.state;
|
|
6518
|
-
if (
|
|
6519
|
-
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);
|
|
6520
6519
|
if (t !== void 0 && this.lookaheadCharCode() !== 46) {
|
|
6521
6520
|
let e = this.startNode();
|
|
6522
6521
|
return this.next(), this.finishNode(e, t);
|
|
@@ -6546,7 +6545,7 @@ var ln = (e) => class extends e {
|
|
|
6546
6545
|
switch (e.typeAnnotation.type) {
|
|
6547
6546
|
case "TSTupleType":
|
|
6548
6547
|
case "TSArrayType": return;
|
|
6549
|
-
default: this.raise(
|
|
6548
|
+
default: this.raise(H.UnexpectedReadonly, e);
|
|
6550
6549
|
}
|
|
6551
6550
|
}
|
|
6552
6551
|
tsParseInferType() {
|
|
@@ -6562,7 +6561,7 @@ var ln = (e) => class extends e {
|
|
|
6562
6561
|
}
|
|
6563
6562
|
}
|
|
6564
6563
|
tsParseTypeOperatorOrHigher() {
|
|
6565
|
-
return
|
|
6564
|
+
return Te(this.state.type) && !this.state.containsEsc ? this.tsParseTypeOperator() : this.isContextual(111) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher());
|
|
6566
6565
|
}
|
|
6567
6566
|
tsParseUnionOrIntersectionType(e, t, n) {
|
|
6568
6567
|
let r = this.startNode(), i = this.eat(n), a = [];
|
|
@@ -6581,7 +6580,7 @@ var ln = (e) => class extends e {
|
|
|
6581
6580
|
return this.match(43) ? !0 : this.match(6) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));
|
|
6582
6581
|
}
|
|
6583
6582
|
tsSkipParameterStart() {
|
|
6584
|
-
if (
|
|
6583
|
+
if (E(this.state.type) || this.match(74)) return this.next(), !0;
|
|
6585
6584
|
if (this.match(2)) {
|
|
6586
6585
|
let { errors: e } = this.state, t = e.length;
|
|
6587
6586
|
try {
|
|
@@ -6635,7 +6634,7 @@ var ln = (e) => class extends e {
|
|
|
6635
6634
|
tsParseTypePredicateAsserts() {
|
|
6636
6635
|
if (this.state.type !== 105) return !1;
|
|
6637
6636
|
let e = this.state.containsEsc;
|
|
6638
|
-
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);
|
|
6639
6638
|
}
|
|
6640
6639
|
tsParseTypeAnnotation(e = !0, t = this.startNode()) {
|
|
6641
6640
|
return this.tsInType(() => {
|
|
@@ -6643,7 +6642,7 @@ var ln = (e) => class extends e {
|
|
|
6643
6642
|
}), this.finishNode(t, "TSTypeAnnotation");
|
|
6644
6643
|
}
|
|
6645
6644
|
tsParseType() {
|
|
6646
|
-
|
|
6645
|
+
on(this.state.inType);
|
|
6647
6646
|
let e = this.tsParseNonConditionalType();
|
|
6648
6647
|
if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(77)) return e;
|
|
6649
6648
|
let t = this.startNodeAtNode(e);
|
|
@@ -6656,24 +6655,24 @@ var ln = (e) => class extends e {
|
|
|
6656
6655
|
return this.tsIsStartOfFunctionType() ? this.tsParseFunctionOrConstructorType("TSFunctionType") : this.match(73) ? this.tsParseFunctionOrConstructorType("TSConstructorType") : this.isAbstractConstructorSignature() ? this.tsParseFunctionOrConstructorType("TSConstructorType", !0) : this.tsParseUnionTypeOrHigher();
|
|
6657
6656
|
}
|
|
6658
6657
|
tsParseTypeAssertion() {
|
|
6659
|
-
this.getPluginOption("typescript", "disallowAmbiguousJSXLike") && this.raise(
|
|
6658
|
+
this.getPluginOption("typescript", "disallowAmbiguousJSXLike") && this.raise(H.ReservedTypeAssertion, this.state.startLoc);
|
|
6660
6659
|
let e = this.startNode();
|
|
6661
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");
|
|
6662
6661
|
}
|
|
6663
6662
|
tsParseHeritageClause(e) {
|
|
6664
6663
|
let t = this.state.startLoc, n = this.tsParseDelimitedList("HeritageClauseElement", () => {
|
|
6665
6664
|
let t = (this.state.canStartArrow = !1, super.parseExprSubscripts());
|
|
6666
|
-
|
|
6665
|
+
un(t) || this.raise(H.InvalidHeritageClauseType, t.start, { token: e });
|
|
6667
6666
|
let n = e === "extends" ? "TSInterfaceHeritage" : "TSClassImplements";
|
|
6668
6667
|
if (t.type === "TSInstantiationExpression") return t.type = n, t;
|
|
6669
6668
|
let r = this.startNodeAtNode(t);
|
|
6670
6669
|
return r.expression = t, (this.match(43) || this.match(47)) && (r.typeArguments = this.tsParseTypeArgumentsInExpression()), this.finishNode(r, n);
|
|
6671
6670
|
});
|
|
6672
|
-
return n.length || this.raise(
|
|
6671
|
+
return n.length || this.raise(H.EmptyHeritageClauseType, t, { token: e }), n;
|
|
6673
6672
|
}
|
|
6674
6673
|
tsParseInterfaceDeclaration(e, t = {}) {
|
|
6675
6674
|
if (this.hasFollowingLineBreak()) return null;
|
|
6676
|
-
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"));
|
|
6677
6676
|
let n = this.startNode();
|
|
6678
6677
|
return n.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)), e.body = this.finishNode(n, "TSInterfaceBody"), this.finishNode(e, "TSInterfaceDeclaration");
|
|
6679
6678
|
}
|
|
@@ -6687,7 +6686,7 @@ var ln = (e) => class extends e {
|
|
|
6687
6686
|
}), this.semicolon(), this.finishNode(e, "TSTypeAliasDeclaration");
|
|
6688
6687
|
}
|
|
6689
6688
|
tsInTopLevelContext(e) {
|
|
6690
|
-
if (this.curContext() !==
|
|
6689
|
+
if (this.curContext() !== A.brace) {
|
|
6691
6690
|
let t = this.state.context;
|
|
6692
6691
|
this.state.context = [t[0]];
|
|
6693
6692
|
try {
|
|
@@ -6695,8 +6694,7 @@ var ln = (e) => class extends e {
|
|
|
6695
6694
|
} finally {
|
|
6696
6695
|
this.state.context = t;
|
|
6697
6696
|
}
|
|
6698
|
-
}
|
|
6699
|
-
return e();
|
|
6697
|
+
} else return e();
|
|
6700
6698
|
}
|
|
6701
6699
|
tsInType(e) {
|
|
6702
6700
|
let t = this.state.inType;
|
|
@@ -6758,14 +6756,14 @@ var ln = (e) => class extends e {
|
|
|
6758
6756
|
else {
|
|
6759
6757
|
e.kind = "module";
|
|
6760
6758
|
let { type: t, value: n } = this.state;
|
|
6761
|
-
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());
|
|
6762
6760
|
}
|
|
6763
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");
|
|
6764
6762
|
}
|
|
6765
6763
|
tsParseImportEqualsDeclaration(e, t) {
|
|
6766
6764
|
e.id = t || this.parseIdentifier(), this.checkIdentifier(e.id, 4096), this.expect(25);
|
|
6767
6765
|
let n = this.tsParseModuleReference();
|
|
6768
|
-
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");
|
|
6769
6767
|
}
|
|
6770
6768
|
tsIsExternalModuleReference() {
|
|
6771
6769
|
return this.isContextual(115) && this.lookaheadCharCode() === 40;
|
|
@@ -6806,16 +6804,16 @@ var ln = (e) => class extends e {
|
|
|
6806
6804
|
declare: !0
|
|
6807
6805
|
}));
|
|
6808
6806
|
case 103:
|
|
6809
|
-
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);
|
|
6810
6808
|
break;
|
|
6811
6809
|
case 92:
|
|
6812
|
-
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);
|
|
6813
6811
|
break;
|
|
6814
6812
|
case 125: {
|
|
6815
6813
|
let t = this.tsParseInterfaceDeclaration(e, { declare: !0 });
|
|
6816
6814
|
if (t) return t;
|
|
6817
6815
|
}
|
|
6818
|
-
default: if (
|
|
6816
|
+
default: if (E(t)) return this.tsParseDeclaration(e, this.state.type, !0, null);
|
|
6819
6817
|
}
|
|
6820
6818
|
});
|
|
6821
6819
|
}
|
|
@@ -6825,15 +6823,15 @@ var ln = (e) => class extends e {
|
|
|
6825
6823
|
tsParseDeclaration(e, t, n, r) {
|
|
6826
6824
|
switch (t) {
|
|
6827
6825
|
case 120:
|
|
6828
|
-
if (this.tsCheckLineTerminator(n) && (this.match(76) ||
|
|
6826
|
+
if (this.tsCheckLineTerminator(n) && (this.match(76) || E(this.state.type))) return this.tsParseAbstractDeclaration(e, r);
|
|
6829
6827
|
break;
|
|
6830
6828
|
case 123:
|
|
6831
6829
|
if (this.tsCheckLineTerminator(n)) return this.tsParseAmbientExternalModuleDeclaration(e);
|
|
6832
6830
|
break;
|
|
6833
6831
|
case 124:
|
|
6834
|
-
if (this.tsCheckLineTerminator(n) &&
|
|
6832
|
+
if (this.tsCheckLineTerminator(n) && E(this.state.type)) return e.kind = "namespace", this.tsParseNamespaceDeclaration(e);
|
|
6835
6833
|
break;
|
|
6836
|
-
case 126: if (this.tsCheckLineTerminator(n) &&
|
|
6834
|
+
case 126: if (this.tsCheckLineTerminator(n) && E(this.state.type)) return this.tsParseTypeAliasDeclaration(e);
|
|
6837
6835
|
}
|
|
6838
6836
|
}
|
|
6839
6837
|
tsCheckLineTerminator(e) {
|
|
@@ -6852,10 +6850,10 @@ var ln = (e) => class extends e {
|
|
|
6852
6850
|
}
|
|
6853
6851
|
tsParseTypeArguments() {
|
|
6854
6852
|
let e = this.startNode();
|
|
6855
|
-
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");
|
|
6856
6854
|
}
|
|
6857
6855
|
tsIsDeclarationStart() {
|
|
6858
|
-
return
|
|
6856
|
+
return Ee(this.state.type);
|
|
6859
6857
|
}
|
|
6860
6858
|
isExportDefaultSpecifier() {
|
|
6861
6859
|
return !this.tsIsDeclarationStart() && super.isExportDefaultSpecifier();
|
|
@@ -6870,13 +6868,13 @@ var ln = (e) => class extends e {
|
|
|
6870
6868
|
"readonly"
|
|
6871
6869
|
] }, r);
|
|
6872
6870
|
let i = r.accessibility, a = r.override, o = r.readonly;
|
|
6873
|
-
!(e & 4) && (i || o || a) && this.raise(
|
|
6871
|
+
!(e & 4) && (i || o || a) && this.raise(H.UnexpectedParameterModifier, n || t[0]);
|
|
6874
6872
|
let s = this.state.startLoc, c = this.parseMaybeDefault(s);
|
|
6875
6873
|
e & 2 && this.parseFunctionParamType(c);
|
|
6876
6874
|
let l = this.parseMaybeDefault(s, c);
|
|
6877
6875
|
if (i || o || a) {
|
|
6878
6876
|
let e = n ? this.startNodeAt(n) : this.startNodeAtNode(t[0]);
|
|
6879
|
-
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");
|
|
6880
6878
|
}
|
|
6881
6879
|
return t.length && (c.decorators = t), l;
|
|
6882
6880
|
}
|
|
@@ -6884,7 +6882,7 @@ var ln = (e) => class extends e {
|
|
|
6884
6882
|
return e.type === "TSParameterProperty" && super.isSimpleParameter(e.parameter) || super.isSimpleParameter(e);
|
|
6885
6883
|
}
|
|
6886
6884
|
tsDisallowOptionalPattern(e) {
|
|
6887
|
-
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);
|
|
6888
6886
|
}
|
|
6889
6887
|
setArrowFunctionParameters(e, t, n) {
|
|
6890
6888
|
super.setArrowFunctionParameters(e, t, n), this.tsDisallowOptionalPattern(e);
|
|
@@ -6893,18 +6891,18 @@ var ln = (e) => class extends e {
|
|
|
6893
6891
|
this.match(10) && (e.returnType = this.tsParseTypeOrTypePredicateAnnotation(10));
|
|
6894
6892
|
let r = t === "FunctionDeclaration" ? "TSDeclareFunction" : t === "ClassMethod" || t === "ClassPrivateMethod" ? "TSDeclareMethod" : void 0;
|
|
6895
6893
|
if (r && !this.match(2) && this.isLineTerminator()) {
|
|
6896
|
-
if (r === "TSDeclareMethod" && e.kind === "constructor") for (let t of e.params) t.type === "TSParameterProperty" ? this.raise(
|
|
6897
|
-
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);
|
|
6898
6896
|
return this.finishNode(e, r);
|
|
6899
6897
|
}
|
|
6900
|
-
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));
|
|
6901
6899
|
}
|
|
6902
6900
|
registerFunctionStatementId(e) {
|
|
6903
6901
|
!e.body && e.id ? this.checkIdentifier(e.id, 1024) : super.registerFunctionStatementId(e);
|
|
6904
6902
|
}
|
|
6905
6903
|
tsCheckForInvalidTypeCasts(e) {
|
|
6906
6904
|
e.forEach((e) => {
|
|
6907
|
-
e?.type === "TSTypeCastExpression" && this.raise(
|
|
6905
|
+
e?.type === "TSTypeCastExpression" && this.raise(H.UnexpectedTypeAnnotation, e.typeAnnotation);
|
|
6908
6906
|
});
|
|
6909
6907
|
}
|
|
6910
6908
|
toReferencedList(e, t) {
|
|
@@ -6937,7 +6935,7 @@ var ln = (e) => class extends e {
|
|
|
6937
6935
|
a = this.state.curPosition();
|
|
6938
6936
|
return;
|
|
6939
6937
|
}
|
|
6940
|
-
if (
|
|
6938
|
+
if (ke(this.state.type)) {
|
|
6941
6939
|
let n = super.parseTaggedTemplateExpression(e, t, r);
|
|
6942
6940
|
return n.typeArguments = o, n;
|
|
6943
6941
|
}
|
|
@@ -6946,11 +6944,11 @@ var ln = (e) => class extends e {
|
|
|
6946
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);
|
|
6947
6945
|
}
|
|
6948
6946
|
let s = this.state.type;
|
|
6949
|
-
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;
|
|
6950
6948
|
let c = this.startNodeAt(t);
|
|
6951
6949
|
return c.expression = e, c.typeArguments = o, this.finishNode(c, "TSInstantiationExpression");
|
|
6952
6950
|
});
|
|
6953
|
-
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;
|
|
6954
6952
|
}
|
|
6955
6953
|
return super.parseSubscript(e, t, n, r);
|
|
6956
6954
|
}
|
|
@@ -6961,7 +6959,7 @@ var ln = (e) => class extends e {
|
|
|
6961
6959
|
}
|
|
6962
6960
|
parseExprOp(e, t, n) {
|
|
6963
6961
|
let r;
|
|
6964
|
-
if (
|
|
6962
|
+
if (De(54) > n && !this.hasPrecedingLineBreak() && (this.isContextual(89) || (r = this.isContextual(116)))) {
|
|
6965
6963
|
let i = this.startNodeAt(t);
|
|
6966
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()));
|
|
6967
6965
|
let a = this.finishNode(i, r ? "TSSatisfiesExpression" : "TSAsExpression");
|
|
@@ -6985,19 +6983,19 @@ var ln = (e) => class extends e {
|
|
|
6985
6983
|
super.applyImportPhase(e, t, n, r), t ? e.exportKind = n === "type" ? "type" : "value" : e.importKind = n === "type" || n === "typeof" ? n : "value";
|
|
6986
6984
|
}
|
|
6987
6985
|
parseImport(e) {
|
|
6988
|
-
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);
|
|
6989
6987
|
let t;
|
|
6990
|
-
if (
|
|
6988
|
+
if (E(this.state.type) && this.lookaheadCharCode() === 61) {
|
|
6991
6989
|
e.importKind = "value";
|
|
6992
6990
|
let t = this.tsParseImportEqualsDeclaration(e);
|
|
6993
|
-
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;
|
|
6994
6992
|
}
|
|
6995
6993
|
if (this.isContextual(126)) {
|
|
6996
6994
|
let n = this.parseMaybeImportPhase(e, !1);
|
|
6997
|
-
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);
|
|
6998
6996
|
t = super.parseImportSpecifiersAndAfter(e, n);
|
|
6999
6997
|
} else t = super.parseImport(e);
|
|
7000
|
-
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;
|
|
7001
6999
|
}
|
|
7002
7000
|
parseExport(e, t) {
|
|
7003
7001
|
if (this.match(79)) {
|
|
@@ -7010,15 +7008,15 @@ var ln = (e) => class extends e {
|
|
|
7010
7008
|
}
|
|
7011
7009
|
if (this.eat(25)) {
|
|
7012
7010
|
let t = e;
|
|
7013
|
-
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");
|
|
7014
7012
|
}
|
|
7015
7013
|
if (this.eatContextual(89)) {
|
|
7016
7014
|
let t = e;
|
|
7017
|
-
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");
|
|
7018
7016
|
}
|
|
7019
7017
|
{
|
|
7020
7018
|
let n = super.parseExport(e, t);
|
|
7021
|
-
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;
|
|
7022
7020
|
}
|
|
7023
7021
|
}
|
|
7024
7022
|
isAbstractClass() {
|
|
@@ -7037,10 +7035,10 @@ var ln = (e) => class extends e {
|
|
|
7037
7035
|
}
|
|
7038
7036
|
parseVarStatement(e, t, n = !1) {
|
|
7039
7037
|
let { isAmbientContext: r } = this.state, i = super.parseVarStatement(e, t, n || r);
|
|
7040
|
-
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;
|
|
7041
7039
|
for (let e of i.declarations) {
|
|
7042
7040
|
let { id: n, init: i, definite: a } = e;
|
|
7043
|
-
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));
|
|
7044
7042
|
}
|
|
7045
7043
|
return i;
|
|
7046
7044
|
}
|
|
@@ -7071,7 +7069,7 @@ var ln = (e) => class extends e {
|
|
|
7071
7069
|
break;
|
|
7072
7070
|
case 125: {
|
|
7073
7071
|
let e = this.tsParseInterfaceDeclaration(this.startNode());
|
|
7074
|
-
if (e) return n || this.raise(
|
|
7072
|
+
if (e) return n || this.raise(H.UnexpectedTypeDeclaration, e, "interface"), e;
|
|
7075
7073
|
break;
|
|
7076
7074
|
}
|
|
7077
7075
|
case 123:
|
|
@@ -7080,7 +7078,7 @@ var ln = (e) => class extends e {
|
|
|
7080
7078
|
return this.next(), this.tsParseDeclaration(e, 123, !1, t);
|
|
7081
7079
|
}
|
|
7082
7080
|
if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
7083
|
-
this.raise(
|
|
7081
|
+
this.raise(H.InlineModuleDeclarationMustUseString, this.state.startLoc);
|
|
7084
7082
|
let e = this.startNode();
|
|
7085
7083
|
return this.next(), this.tsParseDeclaration(e, 124, !1, t);
|
|
7086
7084
|
}
|
|
@@ -7093,7 +7091,7 @@ var ln = (e) => class extends e {
|
|
|
7093
7091
|
break;
|
|
7094
7092
|
case 126: if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
7095
7093
|
let e = this.startNode();
|
|
7096
|
-
return n || this.raise(
|
|
7094
|
+
return n || this.raise(H.UnexpectedTypeDeclaration, e, "type"), this.next(), this.tsParseTypeAliasDeclaration(e);
|
|
7097
7095
|
}
|
|
7098
7096
|
}
|
|
7099
7097
|
return super.parseStatementContent(e, t);
|
|
@@ -7106,7 +7104,7 @@ var ln = (e) => class extends e {
|
|
|
7106
7104
|
]);
|
|
7107
7105
|
}
|
|
7108
7106
|
tsHasSomeModifiers(e, t) {
|
|
7109
|
-
return t.some((t) =>
|
|
7107
|
+
return t.some((t) => cn(t) ? e.accessibility === t : !!e[t]);
|
|
7110
7108
|
}
|
|
7111
7109
|
tsIsStartOfStaticBlocks() {
|
|
7112
7110
|
return this.isContextual(102) && this.lookaheadCharCode() === 123;
|
|
@@ -7126,23 +7124,23 @@ var ln = (e) => class extends e {
|
|
|
7126
7124
|
allowedModifiers: r,
|
|
7127
7125
|
disallowedModifiers: ["in", "out"],
|
|
7128
7126
|
stopOnStartOfClassStaticBlock: !0,
|
|
7129
|
-
errorTemplate:
|
|
7127
|
+
errorTemplate: H.InvalidModifierOnTypeParameterPositions
|
|
7130
7128
|
}, t);
|
|
7131
7129
|
let i = () => {
|
|
7132
|
-
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);
|
|
7133
7131
|
};
|
|
7134
|
-
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" }));
|
|
7135
7133
|
}
|
|
7136
7134
|
parseClassMemberWithIsStatic(e, t, n, r) {
|
|
7137
7135
|
let i = this.tsTryParseIndexSignature(t);
|
|
7138
7136
|
if (i) {
|
|
7139
|
-
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);
|
|
7140
7138
|
return;
|
|
7141
7139
|
}
|
|
7142
|
-
!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);
|
|
7143
7141
|
}
|
|
7144
7142
|
parsePostMemberNameModifiers(e) {
|
|
7145
|
-
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);
|
|
7146
7144
|
}
|
|
7147
7145
|
shouldParseExportDeclaration() {
|
|
7148
7146
|
return this.tsIsDeclarationStart() ? !0 : super.shouldParseExportDeclaration();
|
|
@@ -7170,8 +7168,8 @@ var ln = (e) => class extends e {
|
|
|
7170
7168
|
parseExportDeclaration(e) {
|
|
7171
7169
|
if (!this.state.isAmbientContext && this.isContextual(121)) return this.tsInAmbientContext(() => this.parseExportDeclaration(e));
|
|
7172
7170
|
let t = this.state.startLoc, n = this.eatContextual(121);
|
|
7173
|
-
if (n && (this.isContextual(121) || !this.shouldParseExportDeclaration())) throw this.raise(
|
|
7174
|
-
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);
|
|
7175
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;
|
|
7176
7174
|
}
|
|
7177
7175
|
parseClassId(e, t, n, r) {
|
|
@@ -7186,26 +7184,26 @@ var ln = (e) => class extends e {
|
|
|
7186
7184
|
parseClassPropertyAnnotation(e) {
|
|
7187
7185
|
e.optional || (this.eat(31) ? e.definite = !0 : this.eat(13) && (e.optional = !0));
|
|
7188
7186
|
let t = this.tsTryParseTypeAnnotation();
|
|
7189
|
-
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));
|
|
7190
7188
|
}
|
|
7191
7189
|
parseClassProperty(e) {
|
|
7192
|
-
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)) {
|
|
7193
7191
|
let { key: t } = e;
|
|
7194
|
-
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))}]` });
|
|
7195
7193
|
}
|
|
7196
7194
|
return super.parseClassProperty(e);
|
|
7197
7195
|
}
|
|
7198
7196
|
parseClassPrivateProperty(e) {
|
|
7199
|
-
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);
|
|
7200
7198
|
}
|
|
7201
7199
|
parseClassAccessorProperty(e) {
|
|
7202
|
-
return this.parseClassPropertyAnnotation(e), e.optional && this.raise(
|
|
7200
|
+
return this.parseClassPropertyAnnotation(e), e.optional && this.raise(H.AccessorCannotBeOptional, e), super.parseClassAccessorProperty(e);
|
|
7203
7201
|
}
|
|
7204
7202
|
pushClassMethod(e, t, n, r, i, a) {
|
|
7205
7203
|
let o = this.tsTryParseTypeParameters(this.tsParseConstModifier);
|
|
7206
|
-
o && i && this.raise(
|
|
7204
|
+
o && i && this.raise(H.ConstructorHasTypeParameters, o);
|
|
7207
7205
|
let { declare: s = !1, kind: c } = t;
|
|
7208
|
-
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);
|
|
7209
7207
|
}
|
|
7210
7208
|
pushClassPrivateMethod(e, t, n, r) {
|
|
7211
7209
|
let i = this.tsTryParseTypeParameters(this.tsParseConstModifier);
|
|
@@ -7246,7 +7244,7 @@ var ln = (e) => class extends e {
|
|
|
7246
7244
|
if (this.hasPlugin("jsx") && (this.match(138) || this.match(43))) {
|
|
7247
7245
|
if (r = this.state.clone(), i = this.tryParse(() => super.parseMaybeAssign(e, t), r), !i.error) return i.node;
|
|
7248
7246
|
let { context: n } = this.state, a = n[n.length - 1];
|
|
7249
|
-
(a ===
|
|
7247
|
+
(a === A.j_oTag || a === A.j_expr) && n.pop();
|
|
7250
7248
|
}
|
|
7251
7249
|
if (!i?.error && !this.match(43)) return super.parseMaybeAssign(e, t);
|
|
7252
7250
|
(!r || r === this.state) && (r = this.state.clone());
|
|
@@ -7255,19 +7253,19 @@ var ln = (e) => class extends e {
|
|
|
7255
7253
|
let i = super.parseMaybeAssign(e, t);
|
|
7256
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) {
|
|
7257
7255
|
let e = i.typeParameters.params[0];
|
|
7258
|
-
e.constraint || this.raise(
|
|
7256
|
+
e.constraint || this.raise(H.SingleTypeParameterWithoutTrailingComma, this.optionFlags & 256 ? n(e.loc.end, 1) : e, { typeParameterName: e.name.name });
|
|
7259
7257
|
}
|
|
7260
7258
|
return i;
|
|
7261
7259
|
}, r);
|
|
7262
7260
|
if (!s.error && !s.aborted) return o && this.reportReservedArrowTypeParam(o), s.node;
|
|
7263
|
-
if (!i && (
|
|
7261
|
+
if (!i && (on(!this.hasPlugin("jsx")), a = this.tryParse(() => super.parseMaybeAssign(e, t), r), !a.error)) return a.node;
|
|
7264
7262
|
if (i?.node) return this.state = i.failState, i.node;
|
|
7265
7263
|
if (s.node) return this.state = s.failState, o && this.reportReservedArrowTypeParam(o), s.node;
|
|
7266
7264
|
if (a?.node) return this.state = a.failState, a.node;
|
|
7267
7265
|
throw i?.error || s.error || a?.error;
|
|
7268
7266
|
}
|
|
7269
7267
|
reportReservedArrowTypeParam(e) {
|
|
7270
|
-
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);
|
|
7271
7269
|
}
|
|
7272
7270
|
parseMaybeUnary(e, t) {
|
|
7273
7271
|
return !this.hasPlugin("jsx") && this.match(43) ? this.tsParseTypeAssertion() : super.parseMaybeUnary(e, t);
|
|
@@ -7304,7 +7302,7 @@ var ln = (e) => class extends e {
|
|
|
7304
7302
|
case "TSSatisfiesExpression":
|
|
7305
7303
|
case "TSNonNullExpression":
|
|
7306
7304
|
case "TSTypeAssertion":
|
|
7307
|
-
t ? this.expressionScope.recordArrowParameterBindingError(
|
|
7305
|
+
t ? this.expressionScope.recordArrowParameterBindingError(H.UnexpectedTypeCastInParameter, e) : this.raise(H.UnexpectedTypeCastInParameter, e), this.toAssignable(e.expression, t);
|
|
7308
7306
|
break;
|
|
7309
7307
|
case "AssignmentExpression": !t && e.left.type === "TSTypeCastExpression" && (e.left = this.typeCastToParameter(e.left));
|
|
7310
7308
|
default: super.toAssignable(e, t);
|
|
@@ -7369,7 +7367,7 @@ var ln = (e) => class extends e {
|
|
|
7369
7367
|
}
|
|
7370
7368
|
parseMaybeDefault(e, t) {
|
|
7371
7369
|
let n = super.parseMaybeDefault(e, t);
|
|
7372
|
-
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;
|
|
7373
7371
|
}
|
|
7374
7372
|
getTokenFromCode(e) {
|
|
7375
7373
|
if (this.state.inType) {
|
|
@@ -7449,14 +7447,14 @@ var ln = (e) => class extends e {
|
|
|
7449
7447
|
}
|
|
7450
7448
|
tsParseAbstractDeclaration(e, t) {
|
|
7451
7449
|
if (this.match(76)) return e.abstract = !0, this.maybeTakeDecorators(t, this.parseClass(e, !0, !1));
|
|
7452
|
-
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));
|
|
7453
7451
|
throw this.unexpected(null, 76);
|
|
7454
7452
|
}
|
|
7455
7453
|
parseMethod(e, t, n, r, i, a, o) {
|
|
7456
7454
|
let s = super.parseMethod(e, t, n, r, i, a, o);
|
|
7457
7455
|
if ((s.abstract || s.type === "TSAbstractMethodDefinition") && (this.hasPlugin("estree") ? s.value : s).body) {
|
|
7458
7456
|
let { key: e } = s;
|
|
7459
|
-
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))}]` });
|
|
7460
7458
|
}
|
|
7461
7459
|
return s;
|
|
7462
7460
|
}
|
|
@@ -7484,10 +7482,10 @@ var ln = (e) => class extends e {
|
|
|
7484
7482
|
let e = this.parseIdentifier();
|
|
7485
7483
|
if (this.isContextual(89)) {
|
|
7486
7484
|
let n = this.parseIdentifier();
|
|
7487
|
-
|
|
7488
|
-
} else
|
|
7489
|
-
} else
|
|
7490
|
-
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;
|
|
7491
7489
|
let u = t ? "importKind" : "exportKind";
|
|
7492
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);
|
|
7493
7491
|
}
|
|
@@ -7565,10 +7563,10 @@ var ln = (e) => class extends e {
|
|
|
7565
7563
|
}
|
|
7566
7564
|
}
|
|
7567
7565
|
chStartsBindingIdentifierAndNotRelationalOperator(e, t) {
|
|
7568
|
-
if (
|
|
7569
|
-
if (
|
|
7570
|
-
let e = this.codePointAtPos(
|
|
7571
|
-
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;
|
|
7572
7570
|
}
|
|
7573
7571
|
return !0;
|
|
7574
7572
|
}
|
|
@@ -7583,12 +7581,12 @@ var ln = (e) => class extends e {
|
|
|
7583
7581
|
return t === 34 || t === 39;
|
|
7584
7582
|
}
|
|
7585
7583
|
};
|
|
7586
|
-
function
|
|
7584
|
+
function fn(e) {
|
|
7587
7585
|
if (e.type !== "MemberExpression") return !1;
|
|
7588
7586
|
let { computed: t, property: n } = e;
|
|
7589
|
-
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);
|
|
7590
7588
|
}
|
|
7591
|
-
function
|
|
7589
|
+
function pn(e, t) {
|
|
7592
7590
|
let { type: n } = e;
|
|
7593
7591
|
if (e.extra?.parenthesized) return !1;
|
|
7594
7592
|
if (t) {
|
|
@@ -7597,25 +7595,25 @@ function dn(e, t) {
|
|
|
7597
7595
|
if (typeof t == "string" || typeof t == "boolean") return !0;
|
|
7598
7596
|
}
|
|
7599
7597
|
} else if (n === "StringLiteral" || n === "BooleanLiteral") return !0;
|
|
7600
|
-
return !!(
|
|
7598
|
+
return !!(mn(e, t) || hn(e, t) || n === "TemplateLiteral" && e.expressions.length === 0 || fn(e));
|
|
7601
7599
|
}
|
|
7602
|
-
function
|
|
7600
|
+
function mn(e, t) {
|
|
7603
7601
|
return t ? e.type === "Literal" && (typeof e.value == "number" || "bigint" in e) : e.type === "NumericLiteral" || e.type === "BigIntLiteral";
|
|
7604
7602
|
}
|
|
7605
|
-
function
|
|
7603
|
+
function hn(e, t) {
|
|
7606
7604
|
if (e.type === "UnaryExpression") {
|
|
7607
7605
|
let { operator: n, argument: r } = e;
|
|
7608
|
-
if (n === "-" &&
|
|
7606
|
+
if (n === "-" && mn(r, t)) return !0;
|
|
7609
7607
|
}
|
|
7610
7608
|
return !1;
|
|
7611
7609
|
}
|
|
7612
|
-
function
|
|
7613
|
-
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);
|
|
7614
7612
|
}
|
|
7615
|
-
var
|
|
7613
|
+
var _n = h`placeholders`({
|
|
7616
7614
|
ClassNameIsRequired: "A class name is required.",
|
|
7617
7615
|
UnexpectedSpace: "Unexpected space in placeholder."
|
|
7618
|
-
}),
|
|
7616
|
+
}), vn = (e) => class extends e {
|
|
7619
7617
|
parsePlaceholder(e) {
|
|
7620
7618
|
if (this.match(129)) {
|
|
7621
7619
|
let t = this.startNode();
|
|
@@ -7685,7 +7683,7 @@ var hn = h`placeholders`({
|
|
|
7685
7683
|
if (a) {
|
|
7686
7684
|
if (this.match(77) || this.match(129) || this.match(2)) e.id = a;
|
|
7687
7685
|
else if (n || !t) return e.id = null, e.body = this.finishPlaceholder(a, "ClassBody"), this.finishNode(e, r);
|
|
7688
|
-
else throw this.raise(
|
|
7686
|
+
else throw this.raise(_n.ClassNameIsRequired, this.state.startLoc);
|
|
7689
7687
|
} else this.parseClassId(e, t, n);
|
|
7690
7688
|
return super.parseClassSuper(e), e.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!e.superClass, i), this.finishNode(e, r);
|
|
7691
7689
|
}
|
|
@@ -7701,7 +7699,7 @@ var hn = h`placeholders`({
|
|
|
7701
7699
|
isExportDefaultSpecifier() {
|
|
7702
7700
|
if (this.match(61)) {
|
|
7703
7701
|
let e = this.nextTokenStart();
|
|
7704
|
-
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;
|
|
7705
7703
|
}
|
|
7706
7704
|
return super.isExportDefaultSpecifier();
|
|
7707
7705
|
}
|
|
@@ -7723,13 +7721,13 @@ var hn = h`placeholders`({
|
|
|
7723
7721
|
return this.parsePlaceholder("StringLiteral") || super.parseImportSource();
|
|
7724
7722
|
}
|
|
7725
7723
|
assertNoSpace() {
|
|
7726
|
-
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);
|
|
7727
7725
|
}
|
|
7728
|
-
},
|
|
7726
|
+
}, yn = (e) => class extends e {
|
|
7729
7727
|
parseV8Intrinsic() {
|
|
7730
7728
|
if (this.match(50)) {
|
|
7731
7729
|
let e = this.state.startLoc, t = this.startNode();
|
|
7732
|
-
if (this.next(),
|
|
7730
|
+
if (this.next(), E(this.state.type)) {
|
|
7733
7731
|
let e = this.parseIdentifierName(), n = this.createIdentifier(t, e);
|
|
7734
7732
|
if (this.castNodeTo(n, "V8IntrinsicIdentifier"), this.match(6)) return n;
|
|
7735
7733
|
}
|
|
@@ -7739,29 +7737,29 @@ var hn = h`placeholders`({
|
|
|
7739
7737
|
parseExprAtom(e) {
|
|
7740
7738
|
return this.parseV8Intrinsic() || super.parseExprAtom(e);
|
|
7741
7739
|
}
|
|
7742
|
-
},
|
|
7740
|
+
}, bn = ["fsharp", "hack"], xn = [
|
|
7743
7741
|
"^^",
|
|
7744
7742
|
"@@",
|
|
7745
7743
|
"^",
|
|
7746
7744
|
"%",
|
|
7747
7745
|
"#"
|
|
7748
7746
|
];
|
|
7749
|
-
function
|
|
7747
|
+
function Sn(e) {
|
|
7750
7748
|
if (e.has("decorators") && e.has("decorators-legacy")) throw Error("Cannot use the decorators and decorators-legacy plugin together");
|
|
7751
7749
|
if (e.has("flow") && e.has("typescript")) throw Error("Cannot combine flow and typescript plugins.");
|
|
7752
7750
|
if (e.has("placeholders") && e.has("v8intrinsic")) throw Error("Cannot combine placeholders and v8intrinsic plugins.");
|
|
7753
7751
|
if (e.has("pipelineOperator")) {
|
|
7754
7752
|
let t = e.get("pipelineOperator").proposal;
|
|
7755
|
-
if (!
|
|
7756
|
-
let e =
|
|
7753
|
+
if (!bn.includes(t)) {
|
|
7754
|
+
let e = bn.map((e) => `"${e}"`).join(", ");
|
|
7757
7755
|
throw Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${e}.`);
|
|
7758
7756
|
}
|
|
7759
7757
|
if (t === "hack") {
|
|
7760
7758
|
if (e.has("placeholders")) throw Error("Cannot combine placeholders plugin and Hack-style pipes.");
|
|
7761
7759
|
if (e.has("v8intrinsic")) throw Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");
|
|
7762
7760
|
let t = e.get("pipelineOperator").topicToken;
|
|
7763
|
-
if (!
|
|
7764
|
-
let e =
|
|
7761
|
+
if (!xn.includes(t)) {
|
|
7762
|
+
let e = xn.map((e) => `"${e}"`).join(", ");
|
|
7765
7763
|
throw Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${e}.`);
|
|
7766
7764
|
}
|
|
7767
7765
|
}
|
|
@@ -7778,14 +7776,14 @@ function bn(e) {
|
|
|
7778
7776
|
if (e.has("decimal")) throw Error("The 'decimal' plugin has been removed in Babel 8. Please remove it from your configuration.");
|
|
7779
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.");
|
|
7780
7778
|
}
|
|
7781
|
-
var
|
|
7779
|
+
var Cn = {
|
|
7782
7780
|
estree: ne,
|
|
7783
|
-
jsx:
|
|
7784
|
-
flow:
|
|
7785
|
-
typescript:
|
|
7786
|
-
v8intrinsic:
|
|
7787
|
-
placeholders:
|
|
7788
|
-
},
|
|
7781
|
+
jsx: ft,
|
|
7782
|
+
flow: at,
|
|
7783
|
+
typescript: dn,
|
|
7784
|
+
v8intrinsic: yn,
|
|
7785
|
+
placeholders: vn
|
|
7786
|
+
}, wn = Object.keys(Cn), Tn = class extends nn {
|
|
7789
7787
|
constructor(e, t, n) {
|
|
7790
7788
|
let r = te(e);
|
|
7791
7789
|
super(r, t), this.options = r, this.initializeScopes(), this.plugins = n, this.filename = r.sourceFilename, this.startIndex = r.startIndex;
|
|
@@ -7793,7 +7791,7 @@ var xn = {
|
|
|
7793
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;
|
|
7794
7792
|
}
|
|
7795
7793
|
getScopeHandler() {
|
|
7796
|
-
return
|
|
7794
|
+
return Xe;
|
|
7797
7795
|
}
|
|
7798
7796
|
parse() {
|
|
7799
7797
|
this.enterInitialScopes();
|
|
@@ -7803,97 +7801,106 @@ var xn = {
|
|
|
7803
7801
|
return n.errors = this.state.errors, n.comments.length = this.state.commentsLen, n;
|
|
7804
7802
|
}
|
|
7805
7803
|
};
|
|
7806
|
-
function
|
|
7804
|
+
function En(e, t) {
|
|
7807
7805
|
if (t?.sourceType === "unambiguous") {
|
|
7808
7806
|
t = { ...t };
|
|
7809
7807
|
try {
|
|
7810
7808
|
t.sourceType = "module";
|
|
7811
|
-
let n =
|
|
7809
|
+
let n = On(t, e), r = n.parse();
|
|
7812
7810
|
if (n.sawUnambiguousESM) return r;
|
|
7813
7811
|
if (n.ambiguousScriptDifferentAst) try {
|
|
7814
|
-
return t.sourceType = "script",
|
|
7812
|
+
return t.sourceType = "script", On(t, e).parse();
|
|
7815
7813
|
} catch {}
|
|
7816
7814
|
else r.program.sourceType = "script";
|
|
7817
7815
|
return r;
|
|
7818
7816
|
} catch (n) {
|
|
7819
7817
|
try {
|
|
7820
|
-
return t.sourceType = "script",
|
|
7818
|
+
return t.sourceType = "script", On(t, e).parse();
|
|
7821
7819
|
} catch {}
|
|
7822
7820
|
throw n;
|
|
7823
7821
|
}
|
|
7824
7822
|
}
|
|
7825
|
-
return
|
|
7823
|
+
return On(t, e).parse();
|
|
7826
7824
|
}
|
|
7827
|
-
function
|
|
7825
|
+
function Dn(e) {
|
|
7828
7826
|
let t = {};
|
|
7829
|
-
for (let n of Object.keys(e)) t[n] =
|
|
7827
|
+
for (let n of Object.keys(e)) t[n] = Ae(e[n]);
|
|
7830
7828
|
return t;
|
|
7831
7829
|
}
|
|
7832
|
-
|
|
7833
|
-
function
|
|
7834
|
-
let n =
|
|
7830
|
+
Dn(me);
|
|
7831
|
+
function On(e, t) {
|
|
7832
|
+
let n = Tn, r = /* @__PURE__ */ new Map();
|
|
7835
7833
|
if (e?.plugins) {
|
|
7836
7834
|
for (let t of e.plugins) {
|
|
7837
7835
|
let e, n;
|
|
7838
7836
|
typeof t == "string" ? e = t : [e, n] = t, r.has(e) || r.set(e, n || {});
|
|
7839
7837
|
}
|
|
7840
|
-
|
|
7838
|
+
Sn(r), n = An(r);
|
|
7841
7839
|
}
|
|
7842
7840
|
return new n(e, t, r);
|
|
7843
7841
|
}
|
|
7844
|
-
var
|
|
7845
|
-
function
|
|
7842
|
+
var kn = /* @__PURE__ */ new Map();
|
|
7843
|
+
function An(e) {
|
|
7846
7844
|
let t = [];
|
|
7847
|
-
for (let n of
|
|
7848
|
-
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);
|
|
7849
7847
|
if (!r) {
|
|
7850
|
-
r =
|
|
7851
|
-
for (let e of t) r =
|
|
7852
|
-
|
|
7848
|
+
r = Tn;
|
|
7849
|
+
for (let e of t) r = Cn[e](r);
|
|
7850
|
+
kn.set(n, r);
|
|
7853
7851
|
}
|
|
7854
7852
|
return r;
|
|
7855
7853
|
}
|
|
7856
|
-
var
|
|
7854
|
+
var jn = {
|
|
7857
7855
|
platformExports: /* @__PURE__ */ new Set(["engineContract", "identity"]),
|
|
7858
7856
|
platformModule: "open-flow:platform",
|
|
7859
7857
|
platformSource: `export const engineContract = ${JSON.stringify("open-flow-engine/v1")}
|
|
7860
7858
|
export function identity(value) { return value }
|
|
7861
7859
|
`
|
|
7862
7860
|
};
|
|
7863
|
-
function
|
|
7864
|
-
return e == "open-flow-engine/v1" ?
|
|
7861
|
+
function Mn(e) {
|
|
7862
|
+
return e == "open-flow-engine/v1" ? jn : void 0;
|
|
7865
7863
|
}
|
|
7866
7864
|
//#endregion
|
|
7867
|
-
//#region src/
|
|
7868
|
-
|
|
7869
|
-
|
|
7865
|
+
//#region src/flow/common/change.ts
|
|
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.map((e) => [e.handle, e]));
|
|
7871
|
+
}
|
|
7872
|
+
//#endregion
|
|
7873
|
+
//#region src/flow/common/encoding.ts
|
|
7874
|
+
var Pn = new TextEncoder();
|
|
7875
|
+
function Fn(e) {
|
|
7870
7876
|
if (e == null || typeof e == "boolean" || typeof e == "string" || typeof e == "number") return JSON.stringify(e);
|
|
7871
|
-
if (Array.isArray(e)) return `[${e.map(
|
|
7877
|
+
if (Array.isArray(e)) return `[${e.map(Fn).join(",")}]`;
|
|
7872
7878
|
let t = e;
|
|
7873
|
-
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(",")}}`;
|
|
7874
7880
|
}
|
|
7875
|
-
function
|
|
7876
|
-
return
|
|
7881
|
+
function In(e) {
|
|
7882
|
+
return Pn.encode(Fn(e));
|
|
7877
7883
|
}
|
|
7878
|
-
async function
|
|
7884
|
+
async function Ln(e) {
|
|
7879
7885
|
let t = new Uint8Array(e.byteLength);
|
|
7880
7886
|
return t.set(e), `sha256:${[...new Uint8Array(await crypto.subtle.digest("SHA-256", t))].map((e) => e.toString(16).padStart(2, "0")).join("")}`;
|
|
7881
7887
|
}
|
|
7882
|
-
function
|
|
7888
|
+
function Rn(e) {
|
|
7883
7889
|
return Object.keys(e).toSorted().map((t) => [t, e[t]]);
|
|
7884
7890
|
}
|
|
7885
|
-
function
|
|
7891
|
+
function zn(e) {
|
|
7886
7892
|
return {
|
|
7887
7893
|
...e.description == null ? {} : { description: e.description },
|
|
7894
|
+
handle: e.handle,
|
|
7888
7895
|
jsonSchema: e.jsonSchema,
|
|
7889
7896
|
nullable: e.nullable,
|
|
7890
7897
|
...Object.hasOwn(e, "value") ? { value: e.value } : {}
|
|
7891
7898
|
};
|
|
7892
7899
|
}
|
|
7893
|
-
function
|
|
7894
|
-
return
|
|
7900
|
+
function W(e) {
|
|
7901
|
+
return e.map(zn);
|
|
7895
7902
|
}
|
|
7896
|
-
function
|
|
7903
|
+
function Bn(e) {
|
|
7897
7904
|
switch (e.kind) {
|
|
7898
7905
|
case "sources": return {
|
|
7899
7906
|
kind: e.kind,
|
|
@@ -7905,23 +7912,25 @@ function Ln(e) {
|
|
|
7905
7912
|
};
|
|
7906
7913
|
}
|
|
7907
7914
|
}
|
|
7908
|
-
function
|
|
7909
|
-
return Object.fromEntries(
|
|
7915
|
+
function Vn(e) {
|
|
7916
|
+
return Object.fromEntries(Rn(e).map(([e, t]) => [e, Bn(t)]));
|
|
7910
7917
|
}
|
|
7911
|
-
function
|
|
7912
|
-
return
|
|
7913
|
-
...
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
+
function Hn(e) {
|
|
7919
|
+
return e.map((e) => ({
|
|
7920
|
+
...e.description == null ? {} : { description: e.description },
|
|
7921
|
+
handle: e.handle,
|
|
7922
|
+
jsonSchema: e.jsonSchema,
|
|
7923
|
+
nullable: e.nullable,
|
|
7924
|
+
sources: e.sources.map((e) => ({ ...e }))
|
|
7925
|
+
}));
|
|
7918
7926
|
}
|
|
7919
|
-
function
|
|
7920
|
-
if (!("inputs" in e)) return
|
|
7927
|
+
function Un(e) {
|
|
7928
|
+
if (!("inputs" in e)) return Xn(e);
|
|
7921
7929
|
let t = {
|
|
7922
7930
|
concurrency: e.concurrency,
|
|
7923
7931
|
...e.description == null ? {} : { description: e.description },
|
|
7924
|
-
|
|
7932
|
+
...e.icon == null ? {} : { icon: e.icon },
|
|
7933
|
+
inputs: Vn(e.inputs),
|
|
7925
7934
|
...e.name == null ? {} : { name: e.name },
|
|
7926
7935
|
...e.timeoutMs == null ? {} : { timeoutMs: e.timeoutMs }
|
|
7927
7936
|
};
|
|
@@ -7940,7 +7949,7 @@ function Bn(e) {
|
|
|
7940
7949
|
...e.defaultOutput == null ? {} : { defaultOutput: e.defaultOutput },
|
|
7941
7950
|
input: {
|
|
7942
7951
|
handle: e.input.handle,
|
|
7943
|
-
...
|
|
7952
|
+
...zn(e.input)
|
|
7944
7953
|
},
|
|
7945
7954
|
kind: e.kind
|
|
7946
7955
|
};
|
|
@@ -7956,40 +7965,40 @@ function Bn(e) {
|
|
|
7956
7965
|
} : {
|
|
7957
7966
|
...t,
|
|
7958
7967
|
kind: e.kind,
|
|
7959
|
-
task:
|
|
7968
|
+
task: Kn(e.task)
|
|
7960
7969
|
};
|
|
7961
7970
|
case "value": return {
|
|
7962
7971
|
...t,
|
|
7963
7972
|
kind: e.kind,
|
|
7964
|
-
values:
|
|
7973
|
+
values: W(e.values)
|
|
7965
7974
|
};
|
|
7966
7975
|
}
|
|
7967
7976
|
}
|
|
7968
|
-
function
|
|
7969
|
-
return { nodes: Object.fromEntries(
|
|
7977
|
+
function Wn(e) {
|
|
7978
|
+
return { nodes: Object.fromEntries(Rn(e.nodes).map(([e, t]) => [e, Un(t)])) };
|
|
7970
7979
|
}
|
|
7971
|
-
function
|
|
7980
|
+
function Gn(e) {
|
|
7972
7981
|
return {
|
|
7973
7982
|
executor: e.executor,
|
|
7974
|
-
inputs:
|
|
7983
|
+
inputs: W(e.inputs),
|
|
7975
7984
|
name: e.name,
|
|
7976
|
-
outputs:
|
|
7985
|
+
outputs: W(e.outputs)
|
|
7977
7986
|
};
|
|
7978
7987
|
}
|
|
7979
|
-
function
|
|
7988
|
+
function Kn(e) {
|
|
7980
7989
|
return {
|
|
7981
7990
|
...e.capabilities == null ? {} : { capabilities: e.capabilities.map(({ action: e, connectionId: t, kind: n }) => ({
|
|
7982
7991
|
action: e,
|
|
7983
7992
|
connectionId: t,
|
|
7984
7993
|
kind: n
|
|
7985
7994
|
})) },
|
|
7986
|
-
inputs:
|
|
7995
|
+
inputs: W(e.inputs),
|
|
7987
7996
|
moduleId: e.moduleId,
|
|
7988
7997
|
name: e.name,
|
|
7989
|
-
outputs:
|
|
7998
|
+
outputs: W(e.outputs)
|
|
7990
7999
|
};
|
|
7991
8000
|
}
|
|
7992
|
-
function
|
|
8001
|
+
function qn(e) {
|
|
7993
8002
|
return {
|
|
7994
8003
|
configSchema: e.configSchema,
|
|
7995
8004
|
definitionVersion: e.definitionVersion,
|
|
@@ -8011,7 +8020,7 @@ function Wn(e) {
|
|
|
8011
8020
|
type: e.type
|
|
8012
8021
|
};
|
|
8013
8022
|
}
|
|
8014
|
-
function
|
|
8023
|
+
function Jn(e) {
|
|
8015
8024
|
return {
|
|
8016
8025
|
...e.allowedMethods == null ? {} : { allowedMethods: e.allowedMethods },
|
|
8017
8026
|
...e.allowedOrigins == null ? {} : { allowedOrigins: e.allowedOrigins },
|
|
@@ -8021,7 +8030,7 @@ function Gn(e) {
|
|
|
8021
8030
|
...e.responseStatusCode == null ? {} : { responseStatusCode: e.responseStatusCode }
|
|
8022
8031
|
};
|
|
8023
8032
|
}
|
|
8024
|
-
function
|
|
8033
|
+
function Yn(e) {
|
|
8025
8034
|
switch (e.type) {
|
|
8026
8035
|
case "cron": return {
|
|
8027
8036
|
expression: e.expression,
|
|
@@ -8035,9 +8044,10 @@ function Kn(e) {
|
|
|
8035
8044
|
};
|
|
8036
8045
|
}
|
|
8037
8046
|
}
|
|
8038
|
-
function
|
|
8047
|
+
function Xn(e) {
|
|
8039
8048
|
let t = (t) => ({
|
|
8040
8049
|
...e.description == null ? {} : { description: e.description },
|
|
8050
|
+
...e.icon == null ? {} : { icon: e.icon },
|
|
8041
8051
|
kind: t,
|
|
8042
8052
|
name: e.name
|
|
8043
8053
|
});
|
|
@@ -8046,30 +8056,30 @@ function qn(e) {
|
|
|
8046
8056
|
...t(e.kind),
|
|
8047
8057
|
inputsDef: e.inputsDef.map((e) => ({
|
|
8048
8058
|
handle: e.handle,
|
|
8049
|
-
...
|
|
8059
|
+
...zn(e)
|
|
8050
8060
|
})),
|
|
8051
|
-
...e.options == null ? {} : { options:
|
|
8061
|
+
...e.options == null ? {} : { options: Jn(e.options) }
|
|
8052
8062
|
};
|
|
8053
8063
|
case "cron": return {
|
|
8054
8064
|
...t(e.kind),
|
|
8055
|
-
cronTimes: e.cronTimes.map(
|
|
8065
|
+
cronTimes: e.cronTimes.map(Yn)
|
|
8056
8066
|
};
|
|
8057
8067
|
case "poll": return {
|
|
8058
8068
|
...t(e.kind),
|
|
8059
8069
|
bindingId: e.bindingId,
|
|
8060
8070
|
config: e.config,
|
|
8061
|
-
definition:
|
|
8062
|
-
pollTimes: e.pollTimes.map(
|
|
8071
|
+
definition: qn(e.definition),
|
|
8072
|
+
pollTimes: e.pollTimes.map(Yn)
|
|
8063
8073
|
};
|
|
8064
8074
|
case "integration": return {
|
|
8065
8075
|
...t(e.kind),
|
|
8066
8076
|
bindingId: e.bindingId,
|
|
8067
8077
|
config: e.config,
|
|
8068
|
-
definition:
|
|
8078
|
+
definition: qn(e.definition)
|
|
8069
8079
|
};
|
|
8070
8080
|
}
|
|
8071
8081
|
}
|
|
8072
|
-
function
|
|
8082
|
+
function Zn(e) {
|
|
8073
8083
|
return {
|
|
8074
8084
|
imports: e.imports.toSorted(),
|
|
8075
8085
|
name: e.name,
|
|
@@ -8077,81 +8087,81 @@ function Jn(e) {
|
|
|
8077
8087
|
};
|
|
8078
8088
|
}
|
|
8079
8089
|
//#endregion
|
|
8080
|
-
//#region src/
|
|
8081
|
-
function
|
|
8090
|
+
//#region src/flow/common/semantics.ts
|
|
8091
|
+
function Qn(e) {
|
|
8082
8092
|
return Object.keys(e).toSorted().map((t) => [t, e[t]]);
|
|
8083
8093
|
}
|
|
8084
|
-
async function
|
|
8085
|
-
let n =
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
function c(e) {
|
|
8089
|
-
r.add(e);
|
|
8094
|
+
async function $n(e) {
|
|
8095
|
+
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
8096
|
+
function o(e) {
|
|
8097
|
+
t.add(e);
|
|
8090
8098
|
}
|
|
8091
|
-
function
|
|
8092
|
-
if (
|
|
8093
|
-
|
|
8099
|
+
function s(t) {
|
|
8100
|
+
if (r.has(t)) return;
|
|
8101
|
+
r.add(t);
|
|
8094
8102
|
let n = e.modules[t];
|
|
8095
|
-
if (n != null) for (let e of n.imports.toSorted())
|
|
8103
|
+
if (n != null) for (let e of n.imports.toSorted()) s(e);
|
|
8096
8104
|
}
|
|
8097
|
-
function
|
|
8098
|
-
for (let t of Object.values(e)) if (t.kind == "sources") for (let e of t.sources) e.kind == "binding" && (
|
|
8105
|
+
function c(e) {
|
|
8106
|
+
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));
|
|
8099
8107
|
}
|
|
8100
|
-
function
|
|
8101
|
-
for (let [, t] of
|
|
8108
|
+
function l(e) {
|
|
8109
|
+
for (let [, t] of Qn(e.nodes)) switch ("inputs" in t && c(t.inputs), t.kind) {
|
|
8102
8110
|
case "condition": break;
|
|
8103
8111
|
case "subflow":
|
|
8104
|
-
|
|
8112
|
+
u(t.subflowId);
|
|
8105
8113
|
break;
|
|
8106
8114
|
case "task":
|
|
8107
|
-
t.task == null ?
|
|
8115
|
+
t.task == null ? a.add(t.taskId) : s(t.task.moduleId);
|
|
8108
8116
|
break;
|
|
8109
8117
|
case "value": break;
|
|
8110
8118
|
case "poll":
|
|
8111
|
-
case "integration":
|
|
8119
|
+
case "integration": o(t.bindingId);
|
|
8112
8120
|
}
|
|
8113
8121
|
}
|
|
8114
|
-
function
|
|
8115
|
-
if (
|
|
8116
|
-
|
|
8122
|
+
function u(t) {
|
|
8123
|
+
if (i.has(t)) return;
|
|
8124
|
+
i.add(t);
|
|
8117
8125
|
let n = e.document.subflows[t];
|
|
8118
|
-
n != null &&
|
|
8126
|
+
n != null && l(n.graph);
|
|
8119
8127
|
}
|
|
8120
|
-
|
|
8121
|
-
let
|
|
8122
|
-
bindings: Object.fromEntries([...
|
|
8123
|
-
|
|
8124
|
-
graph: Vn(n.graph),
|
|
8125
|
-
id: t,
|
|
8126
|
-
name: n.name
|
|
8127
|
-
},
|
|
8128
|
+
l(e.document.graph);
|
|
8129
|
+
let d = In({
|
|
8130
|
+
bindings: Object.fromEntries([...t].toSorted().map((t) => [t, e.document.bindings[t] ?? null])),
|
|
8131
|
+
graph: Wn(e.document.graph),
|
|
8128
8132
|
kind: "open-flow-semantic-closure",
|
|
8129
8133
|
modelVersion: e.modelVersion,
|
|
8130
|
-
modules: Object.fromEntries([...
|
|
8131
|
-
tasks: Object.fromEntries([...
|
|
8132
|
-
subflows: Object.fromEntries([...
|
|
8134
|
+
modules: Object.fromEntries([...r].toSorted().map((t) => [t, e.modules[t] == null ? null : Zn(e.modules[t])])),
|
|
8135
|
+
tasks: Object.fromEntries([...a].toSorted().map((t) => [t, e.document.tasks[t] == null ? null : Gn(e.document.tasks[t])])),
|
|
8136
|
+
subflows: Object.fromEntries([...i].toSorted().map((t) => {
|
|
8133
8137
|
let n = e.document.subflows[t];
|
|
8134
8138
|
return n == null ? [t, null] : [t, {
|
|
8135
|
-
graph:
|
|
8136
|
-
inputs:
|
|
8139
|
+
graph: Wn(n.graph),
|
|
8140
|
+
inputs: W(n.inputs),
|
|
8137
8141
|
name: n.name,
|
|
8138
|
-
outputs:
|
|
8142
|
+
outputs: Hn(n.outputs)
|
|
8139
8143
|
}];
|
|
8140
8144
|
})),
|
|
8141
8145
|
version: 1
|
|
8142
8146
|
});
|
|
8143
8147
|
return {
|
|
8144
8148
|
dependencies: {
|
|
8145
|
-
bindings:
|
|
8146
|
-
inputBindings:
|
|
8147
|
-
modules:
|
|
8148
|
-
subflows:
|
|
8149
|
-
tasks:
|
|
8149
|
+
bindings: t,
|
|
8150
|
+
inputBindings: n,
|
|
8151
|
+
modules: r,
|
|
8152
|
+
subflows: i,
|
|
8153
|
+
tasks: a
|
|
8150
8154
|
},
|
|
8151
|
-
digest: await
|
|
8155
|
+
digest: await Ln(d)
|
|
8152
8156
|
};
|
|
8153
8157
|
}
|
|
8154
|
-
function
|
|
8158
|
+
function er(e, t) {
|
|
8159
|
+
return Object.fromEntries([...t].flatMap((t) => {
|
|
8160
|
+
let n = e.document.bindings[t];
|
|
8161
|
+
return n?.kind == "variable" ? [[t, n.target]] : [];
|
|
8162
|
+
}));
|
|
8163
|
+
}
|
|
8164
|
+
function tr(e) {
|
|
8155
8165
|
return e.kind == "poll" || e.kind == "integration" ? e.definition.payloadSchema : e.kind == "cron" ? {
|
|
8156
8166
|
additionalProperties: !1,
|
|
8157
8167
|
type: "object"
|
|
@@ -8162,39 +8172,39 @@ function Zn(e) {
|
|
|
8162
8172
|
type: "object"
|
|
8163
8173
|
};
|
|
8164
8174
|
}
|
|
8165
|
-
function
|
|
8175
|
+
function G(e) {
|
|
8166
8176
|
return {
|
|
8167
8177
|
column: e.loc?.start.column ?? 0,
|
|
8168
8178
|
line: e.loc?.start.line ?? 1
|
|
8169
8179
|
};
|
|
8170
8180
|
}
|
|
8171
|
-
function
|
|
8181
|
+
function K(e) {
|
|
8172
8182
|
return `/modules/${e}/source`;
|
|
8173
8183
|
}
|
|
8174
|
-
function
|
|
8184
|
+
function q(e, t) {
|
|
8175
8185
|
if (typeof e != "object" || !e) return;
|
|
8176
8186
|
let n = e;
|
|
8177
8187
|
if (n.type == "Identifier" && typeof n.name == "string") t.add(n.name);
|
|
8178
|
-
else if (n.type == "RestElement")
|
|
8179
|
-
else if (n.type == "AssignmentPattern")
|
|
8180
|
-
else if (n.type == "ArrayPattern") for (let e of n.elements ?? [])
|
|
8188
|
+
else if (n.type == "RestElement") q(n.argument, t);
|
|
8189
|
+
else if (n.type == "AssignmentPattern") q(n.left, t);
|
|
8190
|
+
else if (n.type == "ArrayPattern") for (let e of n.elements ?? []) q(e, t);
|
|
8181
8191
|
else if (n.type == "ObjectPattern") for (let e of n.properties ?? []) {
|
|
8182
8192
|
let n = e;
|
|
8183
|
-
|
|
8193
|
+
q(n.type == "RestElement" ? n.argument : n.value, t);
|
|
8184
8194
|
}
|
|
8185
8195
|
}
|
|
8186
|
-
function
|
|
8196
|
+
function nr(e) {
|
|
8187
8197
|
if (typeof e != "object" || !e) return;
|
|
8188
8198
|
let t = e;
|
|
8189
8199
|
if (t.type == "Identifier" && typeof t.name == "string") return t.name;
|
|
8190
8200
|
if (t.type == "StringLiteral" && typeof t.value == "string") return t.value;
|
|
8191
8201
|
}
|
|
8192
|
-
function
|
|
8202
|
+
function rr(e, t, n) {
|
|
8193
8203
|
let r;
|
|
8194
8204
|
try {
|
|
8195
|
-
r =
|
|
8205
|
+
r = En(t, {
|
|
8196
8206
|
createImportExpressions: !0,
|
|
8197
|
-
sourceFilename:
|
|
8207
|
+
sourceFilename: K(e),
|
|
8198
8208
|
sourceType: "module"
|
|
8199
8209
|
}).program;
|
|
8200
8210
|
} catch (t) {
|
|
@@ -8204,7 +8214,7 @@ function $n(e, t, n) {
|
|
|
8204
8214
|
column: typeof r == "object" && r && typeof Reflect.get(r, "column") == "number" ? Reflect.get(r, "column") : 0,
|
|
8205
8215
|
line: typeof r == "object" && r && typeof Reflect.get(r, "line") == "number" ? Reflect.get(r, "line") : 1,
|
|
8206
8216
|
message: `CodeModule "${e}" contains invalid JavaScript syntax.`,
|
|
8207
|
-
path:
|
|
8217
|
+
path: K(e)
|
|
8208
8218
|
});
|
|
8209
8219
|
return;
|
|
8210
8220
|
}
|
|
@@ -8214,11 +8224,11 @@ function $n(e, t, n) {
|
|
|
8214
8224
|
let e = t.specifiers.flatMap((e) => {
|
|
8215
8225
|
if (e.type == "ImportNamespaceSpecifier") return [];
|
|
8216
8226
|
if (e.type == "ImportDefaultSpecifier") return ["default"];
|
|
8217
|
-
let t =
|
|
8227
|
+
let t = nr(e.imported);
|
|
8218
8228
|
return t == null ? [] : [t];
|
|
8219
8229
|
});
|
|
8220
8230
|
a.push({
|
|
8221
|
-
...
|
|
8231
|
+
...G(t.source),
|
|
8222
8232
|
imported: e,
|
|
8223
8233
|
specifier: t.source.value
|
|
8224
8234
|
});
|
|
@@ -8232,16 +8242,16 @@ function $n(e, t, n) {
|
|
|
8232
8242
|
if (t.source != null) {
|
|
8233
8243
|
n.push({
|
|
8234
8244
|
code: "module.unsupported-import",
|
|
8235
|
-
...
|
|
8245
|
+
...G(t.source),
|
|
8236
8246
|
message: `CodeModule "${e}" must import before re-exporting values.`,
|
|
8237
|
-
path:
|
|
8247
|
+
path: K(e)
|
|
8238
8248
|
});
|
|
8239
8249
|
continue;
|
|
8240
8250
|
}
|
|
8241
|
-
if (t.declaration?.type == "VariableDeclaration") for (let e of t.declaration.declarations)
|
|
8251
|
+
if (t.declaration?.type == "VariableDeclaration") for (let e of t.declaration.declarations) q(e.id, i);
|
|
8242
8252
|
else (t.declaration?.type == "FunctionDeclaration" || t.declaration?.type == "ClassDeclaration") && t.declaration.id != null && i.add(t.declaration.id.name);
|
|
8243
8253
|
for (let e of t.specifiers) {
|
|
8244
|
-
let t =
|
|
8254
|
+
let t = nr(e.exported);
|
|
8245
8255
|
t != null && i.add(t);
|
|
8246
8256
|
}
|
|
8247
8257
|
}
|
|
@@ -8255,19 +8265,19 @@ function $n(e, t, n) {
|
|
|
8255
8265
|
let r = t, i = r.callee;
|
|
8256
8266
|
r.type == "ImportExpression" || r.type == "CallExpression" && i?.type == "Import" ? n.push({
|
|
8257
8267
|
code: "module.dynamic-import",
|
|
8258
|
-
...
|
|
8268
|
+
...G(r),
|
|
8259
8269
|
message: `CodeModule "${e}" cannot use dynamic import.`,
|
|
8260
|
-
path:
|
|
8270
|
+
path: K(e)
|
|
8261
8271
|
}) : r.type == "CallExpression" && i?.type == "Identifier" && i.name == "require" ? n.push({
|
|
8262
8272
|
code: "module.commonjs",
|
|
8263
|
-
...
|
|
8273
|
+
...G(r),
|
|
8264
8274
|
message: `CodeModule "${e}" cannot use CommonJS require.`,
|
|
8265
|
-
path:
|
|
8275
|
+
path: K(e)
|
|
8266
8276
|
}) : (r.type == "CallExpression" && i?.type == "Identifier" && (i.name == "eval" || i.name == "Function") || r.type == "NewExpression" && i?.type == "Identifier" && i.name == "Function") && n.push({
|
|
8267
8277
|
code: "module.dynamic-code",
|
|
8268
|
-
...
|
|
8278
|
+
...G(r),
|
|
8269
8279
|
message: `CodeModule "${e}" cannot evaluate dynamic code.`,
|
|
8270
|
-
path:
|
|
8280
|
+
path: K(e)
|
|
8271
8281
|
});
|
|
8272
8282
|
for (let [e, t] of Object.entries(r)) e != "loc" && e != "tokens" && e != "comments" && o(t);
|
|
8273
8283
|
};
|
|
@@ -8276,16 +8286,16 @@ function $n(e, t, n) {
|
|
|
8276
8286
|
imports: a
|
|
8277
8287
|
};
|
|
8278
8288
|
}
|
|
8279
|
-
function
|
|
8289
|
+
function ir(e) {
|
|
8280
8290
|
return /^\.\/(.+)\.mjs$/.exec(e)?.[1];
|
|
8281
8291
|
}
|
|
8282
|
-
function
|
|
8292
|
+
function ar(e, t) {
|
|
8283
8293
|
return e < t ? -1 : +(e > t);
|
|
8284
8294
|
}
|
|
8285
|
-
function
|
|
8286
|
-
return
|
|
8295
|
+
function or(e, t) {
|
|
8296
|
+
return ar(e.path, t.path) || e.line - t.line || e.column - t.column || ar(e.code, t.code) || ar(e.message, t.message);
|
|
8287
8297
|
}
|
|
8288
|
-
function
|
|
8298
|
+
function J(e, t, n) {
|
|
8289
8299
|
return {
|
|
8290
8300
|
code: e,
|
|
8291
8301
|
column: 0,
|
|
@@ -8294,21 +8304,21 @@ function Y(e, t, n) {
|
|
|
8294
8304
|
path: n
|
|
8295
8305
|
};
|
|
8296
8306
|
}
|
|
8297
|
-
function
|
|
8307
|
+
function Y(e, t) {
|
|
8298
8308
|
if (e === t) return !0;
|
|
8299
8309
|
if (e == null || t == null || typeof e != "object" || typeof t != "object") return !1;
|
|
8300
|
-
if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length == t.length && e.every((e, n) =>
|
|
8310
|
+
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]));
|
|
8301
8311
|
let n = Object.entries(e), r = t;
|
|
8302
|
-
return n.length == Object.keys(r).length && n.every(([e, t]) => Object.hasOwn(r, e) &&
|
|
8312
|
+
return n.length == Object.keys(r).length && n.every(([e, t]) => Object.hasOwn(r, e) && Y(t, r[e]));
|
|
8303
8313
|
}
|
|
8304
|
-
function
|
|
8314
|
+
function X(e) {
|
|
8305
8315
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
8306
8316
|
}
|
|
8307
|
-
function
|
|
8317
|
+
function Z(e) {
|
|
8308
8318
|
return Array.isArray(e) ? e : void 0;
|
|
8309
8319
|
}
|
|
8310
|
-
function
|
|
8311
|
-
if (Array.isArray(e)) return e.some((e) =>
|
|
8320
|
+
function sr(e, t) {
|
|
8321
|
+
if (Array.isArray(e)) return e.some((e) => sr(e, t));
|
|
8312
8322
|
switch (e) {
|
|
8313
8323
|
case void 0: return !0;
|
|
8314
8324
|
case "null": return t == null;
|
|
@@ -8321,18 +8331,18 @@ function rr(e, t) {
|
|
|
8321
8331
|
default: return !1;
|
|
8322
8332
|
}
|
|
8323
8333
|
}
|
|
8324
|
-
function
|
|
8334
|
+
function Q(e, t) {
|
|
8325
8335
|
if (typeof t == "boolean") return t;
|
|
8326
|
-
let n =
|
|
8336
|
+
let n = X(t);
|
|
8327
8337
|
if (n == null) return !1;
|
|
8328
|
-
let r =
|
|
8329
|
-
if (r != null && !r.every((t) =>
|
|
8330
|
-
let i =
|
|
8331
|
-
if (i != null && !i.some((t) =>
|
|
8332
|
-
let a =
|
|
8333
|
-
if (a != null && a.filter((t) =>
|
|
8334
|
-
let o =
|
|
8335
|
-
if (o != null && !o.some((t) =>
|
|
8338
|
+
let r = Z(n.allOf);
|
|
8339
|
+
if (r != null && !r.every((t) => Q(e, t))) return !1;
|
|
8340
|
+
let i = Z(n.anyOf);
|
|
8341
|
+
if (i != null && !i.some((t) => Q(e, t))) return !1;
|
|
8342
|
+
let a = Z(n.oneOf);
|
|
8343
|
+
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;
|
|
8344
|
+
let o = Z(n.enum);
|
|
8345
|
+
if (o != null && !o.some((t) => Y(e, t)) || !sr(n.type, e)) return !1;
|
|
8336
8346
|
if (typeof e == "string") {
|
|
8337
8347
|
if (typeof n.minLength == "number" && e.length < n.minLength || typeof n.maxLength == "number" && e.length > n.maxLength) return !1;
|
|
8338
8348
|
if (typeof n.pattern == "string") try {
|
|
@@ -8341,188 +8351,206 @@ function $(e, t) {
|
|
|
8341
8351
|
return !1;
|
|
8342
8352
|
}
|
|
8343
8353
|
}
|
|
8344
|
-
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) =>
|
|
8354
|
+
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;
|
|
8345
8355
|
if (typeof e == "object" && e && !Array.isArray(e)) {
|
|
8346
|
-
let t = e, r =
|
|
8356
|
+
let t = e, r = Z(n.required);
|
|
8347
8357
|
if (r != null && r.some((e) => typeof e != "string" || !Object.hasOwn(t, e))) return !1;
|
|
8348
|
-
let i =
|
|
8358
|
+
let i = X(n.properties ?? {});
|
|
8349
8359
|
if (i == null) return !1;
|
|
8350
8360
|
for (let [e, r] of Object.entries(t)) {
|
|
8351
8361
|
let t = i[e];
|
|
8352
8362
|
if (t != null) {
|
|
8353
|
-
if (
|
|
8363
|
+
if (!Q(r, t)) return !1;
|
|
8354
8364
|
} else if (n.additionalProperties === !1) return !1;
|
|
8355
|
-
else if (n.additionalProperties != null && n.additionalProperties !== !0 &&
|
|
8365
|
+
else if (n.additionalProperties != null && n.additionalProperties !== !0 && !Q(r, n.additionalProperties)) return !1;
|
|
8356
8366
|
}
|
|
8357
8367
|
}
|
|
8358
8368
|
return !0;
|
|
8359
8369
|
}
|
|
8360
|
-
function
|
|
8361
|
-
if (e === !0 || t === !0 ||
|
|
8370
|
+
function $(e, t) {
|
|
8371
|
+
if (e === !0 || t === !0 || Y(e, {}) || Y(t, {})) return !0;
|
|
8362
8372
|
if (e === !1 || t === !1) return !1;
|
|
8363
|
-
if (
|
|
8364
|
-
let n =
|
|
8365
|
-
if (n == null || r == null || !
|
|
8366
|
-
let i =
|
|
8373
|
+
if (Y(e, t)) return !0;
|
|
8374
|
+
let n = X(e), r = X(t);
|
|
8375
|
+
if (n == null || r == null || !Y(n.type ?? null, r.type ?? null) || n.type != "object") return !1;
|
|
8376
|
+
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");
|
|
8367
8377
|
if (i == null || a == null || s.some((e) => !o.has(e))) return !1;
|
|
8368
8378
|
for (let [e, t] of Object.entries(i)) {
|
|
8369
8379
|
let n = a[e];
|
|
8370
8380
|
if (n != null) {
|
|
8371
|
-
if (
|
|
8381
|
+
if (!$(t, n)) return !1;
|
|
8372
8382
|
} else if (r.additionalProperties === !1) return !1;
|
|
8373
|
-
else if (r.additionalProperties != null && r.additionalProperties !== !0 &&
|
|
8383
|
+
else if (r.additionalProperties != null && r.additionalProperties !== !0 && !$(t, r.additionalProperties)) return !1;
|
|
8374
8384
|
}
|
|
8375
8385
|
return n.additionalProperties === !1 || r.additionalProperties !== !1;
|
|
8376
8386
|
}
|
|
8377
|
-
function
|
|
8387
|
+
function cr(e) {
|
|
8388
|
+
let t = X(e), n = Z(t?.type);
|
|
8389
|
+
return t != null && n?.includes("string") ? $({ type: "string" }, {
|
|
8390
|
+
...t,
|
|
8391
|
+
type: "string"
|
|
8392
|
+
}) : $({ type: "string" }, e);
|
|
8393
|
+
}
|
|
8394
|
+
function lr(e) {
|
|
8395
|
+
if (typeof e != "object" || !e) return !1;
|
|
8396
|
+
let t = e;
|
|
8397
|
+
return t.contentMediaType == "oomol/ref" || Object.values(t).some(lr);
|
|
8398
|
+
}
|
|
8399
|
+
function ur(e, t, n, r, i) {
|
|
8378
8400
|
if (t.kind == "webhook") {
|
|
8379
8401
|
let e = /* @__PURE__ */ new Set();
|
|
8380
|
-
for (let [n, a] of t.inputsDef.entries()) e.has(a.handle) && i.push(
|
|
8402
|
+
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`)), e.add(a.handle);
|
|
8381
8403
|
return;
|
|
8382
8404
|
}
|
|
8383
8405
|
if (t.kind == "cron") return;
|
|
8384
8406
|
let a = n.bindings[t.bindingId];
|
|
8385
|
-
a == null ? i.push(
|
|
8386
|
-
let o =
|
|
8387
|
-
o.length > 0 ? i.push(
|
|
8407
|
+
a == null ? i.push(J("trigger.connection-missing", `Trigger Connection binding "${t.bindingId}" does not exist.`, `${r}/bindingId`)) : a.kind != "connection" && i.push(J("trigger.connection-invalid", `Trigger binding "${t.bindingId}" must be a Connection.`, `${r}/bindingId`));
|
|
8408
|
+
let o = Z(X(t.definition.configSchema)?.required)?.filter((e) => typeof e == "string" && !Object.hasOwn(t.config, e)) ?? [];
|
|
8409
|
+
o.length > 0 ? i.push(J("trigger.config-incomplete", `Complete the required Trigger config fields: ${o.join(", ")}.`, `${r}/config`)) : Q(t.config, t.definition.configSchema) || i.push(J("trigger.config-invalid", `Trigger "${e}" config does not match its fixed definition.`, `${r}/config`));
|
|
8388
8410
|
}
|
|
8389
|
-
function
|
|
8411
|
+
function dr(e, t) {
|
|
8390
8412
|
switch (t.kind) {
|
|
8391
8413
|
case "condition": return { [t.input.handle]: t.input };
|
|
8392
8414
|
case "value": return {};
|
|
8393
|
-
case "subflow": return e.subflows[t.subflowId]?.inputs ??
|
|
8394
|
-
case "task": return t.task == null ? e.tasks[t.taskId]?.inputs ??
|
|
8415
|
+
case "subflow": return U(e.subflows[t.subflowId]?.inputs ?? []);
|
|
8416
|
+
case "task": return U(t.task == null ? e.tasks[t.taskId]?.inputs ?? [] : t.task.inputs);
|
|
8395
8417
|
case "cron":
|
|
8396
8418
|
case "integration":
|
|
8397
8419
|
case "poll":
|
|
8398
8420
|
case "webhook": return {};
|
|
8399
8421
|
}
|
|
8400
8422
|
}
|
|
8401
|
-
function
|
|
8423
|
+
function fr(e, t) {
|
|
8402
8424
|
switch (t.kind) {
|
|
8403
8425
|
case "condition": {
|
|
8404
8426
|
let e = [...t.cases.map((e) => e.output), ...t.defaultOutput == null ? [] : [t.defaultOutput]];
|
|
8405
8427
|
return Object.fromEntries(e.map((e) => [e, t.input]));
|
|
8406
8428
|
}
|
|
8407
|
-
case "value": return t.values;
|
|
8408
|
-
case "subflow": return e.subflows[t.subflowId]?.outputs ??
|
|
8409
|
-
case "task": return t.task == null ? e.tasks[t.taskId]?.outputs ??
|
|
8429
|
+
case "value": return U(t.values);
|
|
8430
|
+
case "subflow": return U(e.subflows[t.subflowId]?.outputs ?? []);
|
|
8431
|
+
case "task": return U(t.task == null ? e.tasks[t.taskId]?.outputs ?? [] : t.task.outputs);
|
|
8410
8432
|
case "cron":
|
|
8411
8433
|
case "integration":
|
|
8412
8434
|
case "poll":
|
|
8413
8435
|
case "webhook": return { payload: {
|
|
8414
|
-
jsonSchema:
|
|
8436
|
+
jsonSchema: tr(t),
|
|
8415
8437
|
nullable: !1
|
|
8416
8438
|
} };
|
|
8417
8439
|
}
|
|
8418
8440
|
}
|
|
8419
|
-
function
|
|
8441
|
+
function pr(e, t, n, r, i, a, o) {
|
|
8420
8442
|
switch (e.kind) {
|
|
8421
8443
|
case "binding":
|
|
8422
|
-
n.bindings[e.bindingId]
|
|
8444
|
+
n.bindings[e.bindingId] == null ? o.push(J("graph.binding-missing", `Binding "${e.bindingId}" does not exist.`, a)) : 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)) : o.push(J("graph.binding-invalid", `Binding "${e.bindingId}" must be a Variable.`, a));
|
|
8423
8445
|
return;
|
|
8424
8446
|
case "flow":
|
|
8425
|
-
r?.has(e.input) != 1 && o.push(
|
|
8447
|
+
r?.has(e.input) != 1 && o.push(J("graph.source-missing", `Flow input "${e.input}" does not exist in this graph.`, a));
|
|
8426
8448
|
return;
|
|
8427
8449
|
case "node": {
|
|
8428
8450
|
let r = t.nodes[e.nodeId];
|
|
8429
8451
|
if (r == null) {
|
|
8430
|
-
o.push(
|
|
8452
|
+
o.push(J("graph.source-missing", `Upstream node "${e.nodeId}" does not exist.`, a));
|
|
8431
8453
|
return;
|
|
8432
8454
|
}
|
|
8433
|
-
let s =
|
|
8434
|
-
s == null ? o.push(
|
|
8455
|
+
let s = fr(n, r)[e.output];
|
|
8456
|
+
s == null ? o.push(J("graph.source-missing", `Upstream node "${e.nodeId}" does not expose output "${e.output}".`, a)) : 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));
|
|
8435
8457
|
}
|
|
8436
8458
|
}
|
|
8437
8459
|
}
|
|
8438
|
-
function
|
|
8460
|
+
function mr(e, t) {
|
|
8439
8461
|
let n = /* @__PURE__ */ new Set();
|
|
8440
8462
|
if (!("inputs" in t)) return n;
|
|
8441
8463
|
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);
|
|
8442
8464
|
return n;
|
|
8443
8465
|
}
|
|
8444
|
-
function
|
|
8445
|
-
let r = new Map(Object.entries(e.nodes).map(([t, n]) => [t,
|
|
8466
|
+
function hr(e, t, n) {
|
|
8467
|
+
let r = new Map(Object.entries(e.nodes).map(([t, n]) => [t, mr(e, n)]));
|
|
8446
8468
|
for (; r.size > 0;) {
|
|
8447
8469
|
let e = [...r].filter(([, e]) => e.size == 0).map(([e]) => e);
|
|
8448
8470
|
if (e.length == 0) {
|
|
8449
|
-
n.push(
|
|
8471
|
+
n.push(J("graph.cycle", `Graph contains a dependency cycle among nodes: ${[...r.keys()].toSorted().join(", ")}.`, t));
|
|
8450
8472
|
return;
|
|
8451
8473
|
}
|
|
8452
8474
|
for (let t of e) r.delete(t);
|
|
8453
8475
|
for (let t of r.values()) for (let n of e) t.delete(n);
|
|
8454
8476
|
}
|
|
8455
8477
|
}
|
|
8456
|
-
function
|
|
8478
|
+
function gr(e, t, n, r, i, a) {
|
|
8457
8479
|
for (let [o, s] of Object.entries(e.nodes)) {
|
|
8458
8480
|
let c = `${i}/nodes/${o}`;
|
|
8459
8481
|
if (!("inputs" in s)) {
|
|
8460
|
-
r ?
|
|
8482
|
+
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));
|
|
8461
8483
|
continue;
|
|
8462
8484
|
}
|
|
8463
|
-
s.kind == "task" && s.task == null && t.tasks[s.taskId] == null ? a.push(
|
|
8464
|
-
let l =
|
|
8485
|
+
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`)) : s.kind == "subflow" && t.subflows[s.subflowId] == null && a.push(J("graph.target-missing", `Subflow "${s.subflowId}" does not exist.`, `${c}/subflowId`));
|
|
8486
|
+
let l = dr(t, s);
|
|
8487
|
+
[...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));
|
|
8488
|
+
let u = new Set(Object.keys(l));
|
|
8465
8489
|
for (let [r, i] of Object.entries(s.inputs)) {
|
|
8466
8490
|
let s = `${c}/inputs/${r}`;
|
|
8467
|
-
if (u.has(r) || a.push(
|
|
8491
|
+
if (u.has(r) || a.push(J("graph.input-missing", `Node "${o}" does not expose input "${r}".`, s)), i.kind == "sources") {
|
|
8492
|
+
let o = i.sources.filter((e) => e.kind == "binding" && t.bindings[e.bindingId]?.kind == "variable");
|
|
8493
|
+
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));
|
|
8494
|
+
for (let o of i.sources) pr(o, e, t, n, l[r], s, a);
|
|
8495
|
+
}
|
|
8468
8496
|
}
|
|
8469
8497
|
if (s.kind != "condition") continue;
|
|
8470
8498
|
let d = /* @__PURE__ */ new Set();
|
|
8471
8499
|
for (let [e, t] of s.cases.entries()) {
|
|
8472
|
-
d.has(t.output) && a.push(
|
|
8473
|
-
for (let [n, r] of t.expressions.entries()) r.input != s.input.handle && a.push(
|
|
8500
|
+
d.has(t.output) && a.push(J("condition.output-duplicate", `Condition output "${t.output}" is declared more than once.`, `${c}/cases/${e}/output`)), d.add(t.output);
|
|
8501
|
+
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`));
|
|
8474
8502
|
}
|
|
8475
8503
|
}
|
|
8476
|
-
|
|
8504
|
+
hr(e, i, a);
|
|
8477
8505
|
}
|
|
8478
|
-
function
|
|
8479
|
-
let
|
|
8480
|
-
function a
|
|
8481
|
-
for (let [s, c] of Object.entries(
|
|
8506
|
+
function _r(e, t) {
|
|
8507
|
+
let n = /* @__PURE__ */ new Set(), r = [];
|
|
8508
|
+
function i(a, o) {
|
|
8509
|
+
for (let [s, c] of Object.entries(a.nodes)) {
|
|
8482
8510
|
if (c.kind != "subflow" || e.subflows[c.subflowId] == null) continue;
|
|
8483
|
-
let
|
|
8484
|
-
if (
|
|
8485
|
-
|
|
8511
|
+
let a = r.indexOf(c.subflowId);
|
|
8512
|
+
if (a >= 0) {
|
|
8513
|
+
t.push(J("subflow.cycle", `Subflow cycle is not executable: ${[...r.slice(a), c.subflowId].join(" -> ")}.`, `${o}/nodes/${s}/subflowId`));
|
|
8486
8514
|
continue;
|
|
8487
8515
|
}
|
|
8488
|
-
|
|
8516
|
+
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());
|
|
8489
8517
|
}
|
|
8490
8518
|
}
|
|
8491
|
-
|
|
8519
|
+
i(e.graph, "/document/graph");
|
|
8492
8520
|
}
|
|
8493
|
-
function
|
|
8494
|
-
let
|
|
8495
|
-
|
|
8496
|
-
|
|
8497
|
-
|
|
8498
|
-
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
|
|
8504
|
-
|
|
8505
|
-
|
|
8506
|
-
|
|
8507
|
-
|
|
8508
|
-
|
|
8509
|
-
for (let [
|
|
8510
|
-
let
|
|
8511
|
-
if (
|
|
8512
|
-
let a =
|
|
8521
|
+
function vr(e, t) {
|
|
8522
|
+
let n = [];
|
|
8523
|
+
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`));
|
|
8524
|
+
gr(e.document.graph, e.document, void 0, !0, "/document/graph", n);
|
|
8525
|
+
for (let r of [...t.dependencies.subflows].toSorted()) {
|
|
8526
|
+
let t = e.document.subflows[r];
|
|
8527
|
+
if (t == null) continue;
|
|
8528
|
+
let i = `/document/subflows/${r}`, a = new Set(t.inputs.map((e) => e.handle));
|
|
8529
|
+
gr(t.graph, e.document, a, !1, `${i}/graph`, n);
|
|
8530
|
+
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);
|
|
8531
|
+
}
|
|
8532
|
+
return _r(e.document, n), n;
|
|
8533
|
+
}
|
|
8534
|
+
function yr(e, t) {
|
|
8535
|
+
if (typeof t != "object" || !t || Array.isArray(t)) return "invalid";
|
|
8536
|
+
let n = e.document.graph;
|
|
8537
|
+
for (let [r, i] of Object.entries(t)) {
|
|
8538
|
+
let t = n.nodes[r];
|
|
8539
|
+
if (t == null || !("inputs" in t) || typeof i != "object" || !i || Array.isArray(i)) return "invalid";
|
|
8540
|
+
let a = dr(e.document, t);
|
|
8513
8541
|
for (let e of Object.keys(i)) {
|
|
8514
|
-
let
|
|
8515
|
-
if (
|
|
8542
|
+
let n = a[e];
|
|
8543
|
+
if (n == null || lr(n.jsonSchema) || t.inputs[e] != null || Object.hasOwn(n, "value")) return "invalid";
|
|
8516
8544
|
}
|
|
8517
8545
|
}
|
|
8518
8546
|
return "valid";
|
|
8519
8547
|
}
|
|
8520
|
-
function
|
|
8548
|
+
function br(e, t, n) {
|
|
8521
8549
|
let r = [], i = /* @__PURE__ */ new Map();
|
|
8522
8550
|
for (let n of t.toSorted()) {
|
|
8523
8551
|
let t = e.modules[n];
|
|
8524
8552
|
if (t == null) continue;
|
|
8525
|
-
let a =
|
|
8553
|
+
let a = rr(n, t.source, r);
|
|
8526
8554
|
a != null && i.set(n, a);
|
|
8527
8555
|
}
|
|
8528
8556
|
for (let a of t.toSorted()) {
|
|
@@ -8538,18 +8566,18 @@ function hr(e, t, n) {
|
|
|
8538
8566
|
column: c.column,
|
|
8539
8567
|
line: c.line,
|
|
8540
8568
|
message: `Platform Library does not export "${e}".`,
|
|
8541
|
-
path:
|
|
8569
|
+
path: K(a)
|
|
8542
8570
|
});
|
|
8543
8571
|
continue;
|
|
8544
8572
|
}
|
|
8545
|
-
let o =
|
|
8573
|
+
let o = ir(c.specifier);
|
|
8546
8574
|
if (o == null) {
|
|
8547
8575
|
r.push({
|
|
8548
8576
|
code: "module.unsupported-import",
|
|
8549
8577
|
column: c.column,
|
|
8550
8578
|
line: c.line,
|
|
8551
8579
|
message: `CodeModule "${a}" cannot import "${c.specifier}".`,
|
|
8552
|
-
path:
|
|
8580
|
+
path: K(a)
|
|
8553
8581
|
});
|
|
8554
8582
|
continue;
|
|
8555
8583
|
}
|
|
@@ -8559,7 +8587,7 @@ function hr(e, t, n) {
|
|
|
8559
8587
|
column: c.column,
|
|
8560
8588
|
line: c.line,
|
|
8561
8589
|
message: `CodeModule "${o}" does not exist.`,
|
|
8562
|
-
path:
|
|
8590
|
+
path: K(a)
|
|
8563
8591
|
});
|
|
8564
8592
|
continue;
|
|
8565
8593
|
}
|
|
@@ -8569,7 +8597,7 @@ function hr(e, t, n) {
|
|
|
8569
8597
|
column: c.column,
|
|
8570
8598
|
line: c.line,
|
|
8571
8599
|
message: `CodeModule "${a}" does not declare its import of "${o}".`,
|
|
8572
|
-
path:
|
|
8600
|
+
path: K(a)
|
|
8573
8601
|
});
|
|
8574
8602
|
continue;
|
|
8575
8603
|
}
|
|
@@ -8579,7 +8607,7 @@ function hr(e, t, n) {
|
|
|
8579
8607
|
column: c.column,
|
|
8580
8608
|
line: c.line,
|
|
8581
8609
|
message: `CodeModule "${o}" does not export "${e}".`,
|
|
8582
|
-
path:
|
|
8610
|
+
path: K(a)
|
|
8583
8611
|
});
|
|
8584
8612
|
}
|
|
8585
8613
|
for (let e of t.imports) s.has(e) || r.push({
|
|
@@ -8587,7 +8615,7 @@ function hr(e, t, n) {
|
|
|
8587
8615
|
column: 0,
|
|
8588
8616
|
line: 1,
|
|
8589
8617
|
message: `CodeModule "${a}" declares "${e}" without a matching static import.`,
|
|
8590
|
-
path:
|
|
8618
|
+
path: K(a)
|
|
8591
8619
|
});
|
|
8592
8620
|
}
|
|
8593
8621
|
return {
|
|
@@ -8595,48 +8623,47 @@ function hr(e, t, n) {
|
|
|
8595
8623
|
diagnostics: r
|
|
8596
8624
|
};
|
|
8597
8625
|
}
|
|
8598
|
-
function
|
|
8599
|
-
return
|
|
8626
|
+
function xr(e, t, n) {
|
|
8627
|
+
return br(e, t, n).diagnostics.toSorted(or);
|
|
8600
8628
|
}
|
|
8601
|
-
async function
|
|
8602
|
-
|
|
8603
|
-
|
|
8604
|
-
i.
|
|
8605
|
-
let a = [[`/document/flows/${t}/graph`, e.document.flows[t].graph], ...[...r.dependencies.subflows].toSorted().flatMap((t) => {
|
|
8629
|
+
async function Sr(e, t) {
|
|
8630
|
+
let n = await $n(e), r = br(e, [...n.dependencies.modules], t);
|
|
8631
|
+
r.diagnostics.push(...vr(e, n));
|
|
8632
|
+
let i = [["/document/graph", e.document.graph], ...[...n.dependencies.subflows].toSorted().flatMap((t) => {
|
|
8606
8633
|
let n = e.document.subflows[t];
|
|
8607
8634
|
return n == null ? [] : [[`/document/subflows/${t}/graph`, n.graph]];
|
|
8608
|
-
})],
|
|
8609
|
-
for (let [t, n] of
|
|
8610
|
-
e.modules[
|
|
8635
|
+
})], a = /* @__PURE__ */ new Set();
|
|
8636
|
+
for (let [t, n] of i) for (let [i, o] of Object.entries(n.nodes)) if (o.kind == "task" && o.task != null) {
|
|
8637
|
+
e.modules[o.task.moduleId] == null ? r.diagnostics.push({
|
|
8611
8638
|
code: "task.module-missing",
|
|
8612
8639
|
column: 0,
|
|
8613
8640
|
line: 1,
|
|
8614
|
-
message: `Inline Task "${
|
|
8615
|
-
path: `${t}/nodes/${
|
|
8616
|
-
}) : !
|
|
8641
|
+
message: `Inline Task "${i}" references missing CodeModule "${o.task.moduleId}".`,
|
|
8642
|
+
path: `${t}/nodes/${i}/task/moduleId`
|
|
8643
|
+
}) : !r.analysis.get(o.task.moduleId)?.exports.has("default") && !a.has(o.task.moduleId) && (a.add(o.task.moduleId), r.diagnostics.push({
|
|
8617
8644
|
code: "task.missing-entry",
|
|
8618
8645
|
column: 0,
|
|
8619
8646
|
line: 1,
|
|
8620
|
-
message: `CodeModule "${
|
|
8621
|
-
path: `/modules/${
|
|
8647
|
+
message: `CodeModule "${o.task.moduleId}" used by an Inline Task must export a default function.`,
|
|
8648
|
+
path: `/modules/${o.task.moduleId}/source`
|
|
8622
8649
|
}));
|
|
8623
|
-
for (let [e, n] of (
|
|
8650
|
+
for (let [e, n] of (o.task.capabilities ?? []).entries()) n.action.length > 0 && n.connectionId.length > 0 || r.diagnostics.push({
|
|
8624
8651
|
code: "task.capability-incomplete",
|
|
8625
8652
|
column: 0,
|
|
8626
8653
|
line: 1,
|
|
8627
|
-
message: `Inline Task "${
|
|
8628
|
-
path: `${t}/nodes/${
|
|
8654
|
+
message: `Inline Task "${i}" has an incomplete Connector Capability.`,
|
|
8655
|
+
path: `${t}/nodes/${i}/task/capabilities/${e}`
|
|
8629
8656
|
});
|
|
8630
8657
|
}
|
|
8631
|
-
for (let t of [...
|
|
8658
|
+
for (let t of [...n.dependencies.tasks].toSorted()) {
|
|
8632
8659
|
let n = e.document.tasks[t];
|
|
8633
|
-
n != null && (n.executor.kind == "connector" && n.executor.action.length == 0 &&
|
|
8660
|
+
n != null && (n.executor.kind == "connector" && n.executor.action.length == 0 && r.diagnostics.push({
|
|
8634
8661
|
code: "task.connector-incomplete",
|
|
8635
8662
|
column: 0,
|
|
8636
8663
|
line: 1,
|
|
8637
8664
|
message: `Connector Task "${t}" requires an action.`,
|
|
8638
8665
|
path: `/document/tasks/${t}/executor`
|
|
8639
|
-
}), n.executor.kind == "connector" && n.executor.connectionId == null &&
|
|
8666
|
+
}), n.executor.kind == "connector" && n.executor.connectionId == null && r.diagnostics.push({
|
|
8640
8667
|
code: "task.connector-connection-required",
|
|
8641
8668
|
column: 0,
|
|
8642
8669
|
line: 1,
|
|
@@ -8644,38 +8671,36 @@ async function _r(e, t, n) {
|
|
|
8644
8671
|
path: `/document/tasks/${t}/executor/connectionId`
|
|
8645
8672
|
}));
|
|
8646
8673
|
}
|
|
8647
|
-
let
|
|
8674
|
+
let o = r.diagnostics.toSorted(or);
|
|
8648
8675
|
return {
|
|
8649
|
-
closure:
|
|
8650
|
-
diagnostics:
|
|
8651
|
-
valid:
|
|
8676
|
+
closure: n,
|
|
8677
|
+
diagnostics: o,
|
|
8678
|
+
valid: o.length == 0
|
|
8652
8679
|
};
|
|
8653
8680
|
}
|
|
8654
|
-
async function
|
|
8655
|
-
let
|
|
8656
|
-
if (
|
|
8657
|
-
let
|
|
8658
|
-
if (
|
|
8659
|
-
if (!i.valid) return {
|
|
8681
|
+
async function Cr(e, t) {
|
|
8682
|
+
let n = Mn(t);
|
|
8683
|
+
if (n == null) return { kind: "engine-unsupported" };
|
|
8684
|
+
let r = await Sr(e, n);
|
|
8685
|
+
if (!r.valid) return {
|
|
8660
8686
|
kind: "flow-invalid",
|
|
8661
|
-
validation:
|
|
8687
|
+
validation: r
|
|
8662
8688
|
};
|
|
8663
|
-
let { closure:
|
|
8689
|
+
let { closure: i } = r;
|
|
8664
8690
|
return {
|
|
8665
8691
|
flow: {
|
|
8666
|
-
closureDigest:
|
|
8667
|
-
engineContract:
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
tasks: Object.fromEntries([...a.dependencies.tasks].toSorted().map((t) => [t, e.document.tasks[t]]))
|
|
8692
|
+
closureDigest: i.digest,
|
|
8693
|
+
engineContract: t,
|
|
8694
|
+
graph: e.document.graph,
|
|
8695
|
+
modules: Object.fromEntries([...i.dependencies.modules].toSorted().map((t) => [t, e.modules[t]])),
|
|
8696
|
+
subflows: Object.fromEntries([...i.dependencies.subflows].toSorted().map((t) => [t, e.document.subflows[t]])),
|
|
8697
|
+
tasks: Object.fromEntries([...i.dependencies.tasks].toSorted().map((t) => [t, e.document.tasks[t]]))
|
|
8673
8698
|
},
|
|
8674
8699
|
kind: "prepared",
|
|
8675
|
-
validation:
|
|
8700
|
+
validation: r
|
|
8676
8701
|
};
|
|
8677
8702
|
}
|
|
8678
|
-
function
|
|
8703
|
+
function wr(e, t, n) {
|
|
8679
8704
|
if (Object.hasOwn(e.modules, t)) return {
|
|
8680
8705
|
engineContract: e.engineContract,
|
|
8681
8706
|
engineDigest: n,
|
|
@@ -8684,4 +8709,4 @@ function yr(e, t, n) {
|
|
|
8684
8709
|
};
|
|
8685
8710
|
}
|
|
8686
8711
|
//#endregion
|
|
8687
|
-
export {
|
|
8712
|
+
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 };
|