File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/compiler/src/transforms Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ const seen = new WeakMap<
2727 WeakSet < TextLike | BlockIRNode [ 'node' ] | RootNode >
2828> ( )
2929
30+ export function markNonTemplate ( node : Node , context : TransformContext ) : void {
31+ seen . get ( context . root ) ! . add ( node )
32+ }
33+
3034export const transformText : NodeTransform = ( node , context ) => {
3135 if ( ! seen . has ( context . root ) ) seen . set ( context . root , new WeakSet ( ) )
3236 if ( seen . get ( context . root ) ! . has ( node ) ) {
@@ -69,7 +73,7 @@ export const transformText: NodeTransform = (node, context) => {
6973 prev . type === 'JSXText'
7074 ) {
7175 // mark leading text node for skipping
72- seen . get ( context . root ) ! . add ( prev )
76+ markNonTemplate ( prev , context )
7377 }
7478 }
7579 }
@@ -155,7 +159,7 @@ function createTextLikeExpressions(
155159) {
156160 const values = [ ]
157161 for ( const node of nodes ) {
158- seen . get ( context . root ) ! . add ( node )
162+ markNonTemplate ( node , context )
159163 if ( isEmptyText ( node ) ) continue
160164 values . push ( resolveExpression ( node , context , ! context . inVOnce ) )
161165 }
You can’t perform that action at this time.
0 commit comments