@@ -36,24 +36,23 @@ export function process_children(nodes, expression, is_element, { visit, state }
36
36
}
37
37
}
38
38
39
- const text_id = get_node_id ( expression ( true ) , state , 'text' ) ;
39
+ const id = get_node_id ( expression ( true ) , state , 'text' ) ;
40
40
41
41
state . template . push ( ' ' ) ;
42
42
43
43
const { has_state, has_call, value } = build_template_literal ( sequence , visit , state ) ;
44
44
45
- const update = b . stmt ( b . call ( '$.set_text' , text_id , value ) ) ;
45
+ const update = b . stmt ( b . call ( '$.set_text' , id , value ) ) ;
46
46
47
47
if ( has_call && ! within_bound_contenteditable ) {
48
48
state . init . push ( build_update ( update ) ) ;
49
49
} else if ( has_state && ! within_bound_contenteditable ) {
50
50
state . update . push ( update ) ;
51
51
} else {
52
- state . init . push ( b . stmt ( b . assignment ( '=' , b . member ( text_id , b . id ( 'nodeValue' ) ) , value ) ) ) ;
52
+ state . init . push ( b . stmt ( b . assignment ( '=' , b . member ( id , b . id ( 'nodeValue' ) ) , value ) ) ) ;
53
53
}
54
54
55
- expression = ( is_text ) =>
56
- is_text ? b . call ( '$.sibling' , text_id , b . true ) : b . call ( '$.sibling' , text_id ) ;
55
+ expression = ( is_text ) => b . call ( '$.sibling' , id , is_text && b . true ) ;
57
56
}
58
57
59
58
for ( let i = 0 ; i < nodes . length ; i += 1 ) {
@@ -87,8 +86,7 @@ export function process_children(nodes, expression, is_element, { visit, state }
87
86
node . type === 'RegularElement' ? node . name : 'node'
88
87
) ;
89
88
90
- expression = ( is_text ) =>
91
- is_text ? b . call ( '$.sibling' , id , b . true ) : b . call ( '$.sibling' , id ) ;
89
+ expression = ( is_text ) => b . call ( '$.sibling' , id , is_text && b . true ) ;
92
90
93
91
visit ( node , {
94
92
...state ,
0 commit comments