@@ -61,16 +61,24 @@ export function process_children(nodes, initial, is_element, { visit, state }) {
6161 * @param {Sequence } sequence
6262 */
6363 function flush_sequence ( sequence ) {
64+ // TODO this should be folded into the `is_inlinable_sequence` block below,
65+ // but it currently causes a test to fail
6466 if ( sequence . every ( ( node ) => node . type === 'Text' ) ) {
6567 skipped += 1 ;
6668 state . template . push ( sequence . map ( ( node ) => node . raw ) . join ( '' ) ) ;
6769 return ;
6870 }
6971
70- state . template . push ( ' ' ) ;
71-
7272 const { has_state, has_call, value } = build_template_literal ( sequence , visit , state ) ;
7373
74+ if ( is_inlinable_sequence ( sequence ) ) {
75+ skipped += 1 ;
76+ state . template . push ( escape_inline_expression ( value ) ) ;
77+ return ;
78+ }
79+
80+ state . template . push ( ' ' ) ;
81+
7482 // if this is a standalone `{expression}`, make sure we handle the case where
7583 // no text node was created because the expression was empty during SSR
7684 const is_text = sequence . length === 1 ;
@@ -83,13 +91,7 @@ export function process_children(nodes, initial, is_element, { visit, state }) {
8391 } else if ( has_state && ! within_bound_contenteditable ) {
8492 state . update . push ( update ) ;
8593 } else {
86- // if the expression is inlinable we just push it to the template
87- if ( ! is_text && is_inlinable_sequence ( sequence ) ) {
88- state . template . push ( escape_inline_expression ( value ) ) ;
89- } else {
90- // else we programmatically set the value
91- state . init . push ( b . stmt ( b . assignment ( '=' , b . member ( id , 'nodeValue' ) , value ) ) ) ;
92- }
94+ state . init . push ( b . stmt ( b . assignment ( '=' , b . member ( id , 'nodeValue' ) , value ) ) ) ;
9395 }
9496 }
9597
0 commit comments