@@ -933,11 +933,9 @@ function get_possible_element_siblings(node, adjacent_only, seen = new Set()) {
933
933
/**
934
934
* @param {Compiler.AST.EachBlock | Compiler.AST.IfBlock | Compiler.AST.AwaitBlock | Compiler.AST.KeyBlock | Compiler.AST.SlotElement } node
935
935
* @param {boolean } adjacent_only
936
- * @returns {Map<Compiler.AST.RegularElement, NodeExistsValue> }
936
+ * @returns {Map<Compiler.AST.RegularElement | Compiler.AST.SvelteElement , NodeExistsValue> }
937
937
*/
938
938
function get_possible_last_child ( node , adjacent_only ) {
939
- /** @typedef {Map<Compiler.AST.RegularElement, NodeExistsValue> } NodeMap */
940
-
941
939
/** @type {Array<Compiler.AST.Fragment | undefined | null> } */
942
940
let fragments = [ ] ;
943
941
@@ -960,7 +958,7 @@ function get_possible_last_child(node, adjacent_only) {
960
958
break ;
961
959
}
962
960
963
- /** @type {NodeMap } */
961
+ /** @type {Map<Compiler.AST.RegularElement | Compiler.AST.SvelteElement, NodeExistsValue> } NodeMap */
964
962
const result = new Map ( ) ;
965
963
966
964
let exhaustive = node . type !== 'SlotElement' ;
@@ -1001,9 +999,10 @@ function has_definite_elements(result) {
1001
999
}
1002
1000
1003
1001
/**
1004
- * @template T
1005
- * @param {Map<T, NodeExistsValue> } from
1006
- * @param {Map<T, NodeExistsValue> } to
1002
+ * @template T2
1003
+ * @template {T2} T1
1004
+ * @param {Map<T1, NodeExistsValue> } from
1005
+ * @param {Map<T2, NodeExistsValue> } to
1007
1006
* @returns {void }
1008
1007
*/
1009
1008
function add_to_map ( from , to ) {
@@ -1028,7 +1027,7 @@ function higher_existence(exist1, exist2) {
1028
1027
* @param {boolean } adjacent_only
1029
1028
*/
1030
1029
function loop_child ( children , adjacent_only ) {
1031
- /** @type {Map<Compiler.AST.RegularElement, NodeExistsValue> } */
1030
+ /** @type {Map<Compiler.AST.RegularElement | Compiler.AST.SvelteElement , NodeExistsValue> } */
1032
1031
const result = new Map ( ) ;
1033
1032
1034
1033
let i = children . length ;
@@ -1041,6 +1040,8 @@ function loop_child(children, adjacent_only) {
1041
1040
if ( adjacent_only ) {
1042
1041
break ;
1043
1042
}
1043
+ } else if ( child . type === 'SvelteElement' ) {
1044
+ result . set ( child , NODE_PROBABLY_EXISTS ) ;
1044
1045
} else if ( is_block ( child ) ) {
1045
1046
const child_result = get_possible_last_child ( child , adjacent_only ) ;
1046
1047
add_to_map ( child_result , result ) ;
0 commit comments