Repository navigation
Commit 7a1bc24
committed
🐛 fix: stop <If> from reporting selected-branch errors twice
An ErrorSegment passes through Component.raise exactly once, where it is
created (spec §6.9). `<If>` broke that: the nested expandSegments() settled
each error from the selected branch, and the dispatch branch then raised the
returned segment again. A counting raise middleware saw `<Broken />` once
inline and twice inside `<If condition={true}>`.
Move the ownership split into expandIf: it reports the errors it creates
itself — invalid condition, unknown prop, malformed `<Else>` — exactly once,
and the dispatcher appends the selected branch's segments untouched, as the
`<Content />` projection branch already does. A throwing policy still aborts
at the first error, and an unselected branch stays entirely unobserved.
IF50 is the regression: it fails against the previous commit and passes now.
The same duplicate observation exists in the `<Each>`, `<Capture>`, and
ordinary component paths. That is pre-existing and tracked by #220 rather
than repaired here.1 parent 20d2b29 commit 7a1bc24
3 files changed
Lines changed: 128 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
529 | 526 | | |
530 | 527 | | |
531 | 528 | | |
| |||
1007 | 1004 | | |
1008 | 1005 | | |
1009 | 1006 | | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
1010 | 1013 | | |
1011 | 1014 | | |
1012 | 1015 | | |
| |||
1019 | 1022 | | |
1020 | 1023 | | |
1021 | 1024 | | |
1022 | | - | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
1023 | 1030 | | |
1024 | 1031 | | |
1025 | 1032 | | |
1026 | 1033 | | |
1027 | | - | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
1028 | 1039 | | |
1029 | 1040 | | |
1030 | 1041 | | |
| |||
1040 | 1051 | | |
1041 | 1052 | | |
1042 | 1053 | | |
1043 | | - | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
1044 | 1057 | | |
1045 | 1058 | | |
1046 | | - | |
| 1059 | + | |
1047 | 1060 | | |
1048 | 1061 | | |
1049 | 1062 | | |
1050 | 1063 | | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
1055 | 1070 | | |
1056 | 1071 | | |
1057 | 1072 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
694 | 695 | | |
695 | 696 | | |
696 | 697 | | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3026 | 3026 | | |
3027 | 3027 | | |
3028 | 3028 | | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
3029 | 3037 | | |
3030 | 3038 | | |
3031 | 3039 | | |
| |||
5032 | 5040 | | |
5033 | 5041 | | |
5034 | 5042 | | |
| 5043 | + | |
| 5044 | + | |
| 5045 | + | |
| 5046 | + | |
| 5047 | + | |
5035 | 5048 | | |
5036 | 5049 | | |
5037 | 5050 | | |
| |||
0 commit comments