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<
27
27
WeakSet < TextLike | BlockIRNode [ 'node' ] | RootNode >
28
28
> ( )
29
29
30
+ export function markNonTemplate ( node : Node , context : TransformContext ) : void {
31
+ seen . get ( context . root ) ! . add ( node )
32
+ }
33
+
30
34
export const transformText : NodeTransform = ( node , context ) => {
31
35
if ( ! seen . has ( context . root ) ) seen . set ( context . root , new WeakSet ( ) )
32
36
if ( seen . get ( context . root ) ! . has ( node ) ) {
@@ -69,7 +73,7 @@ export const transformText: NodeTransform = (node, context) => {
69
73
prev . type === 'JSXText'
70
74
) {
71
75
// mark leading text node for skipping
72
- seen . get ( context . root ) ! . add ( prev )
76
+ markNonTemplate ( prev , context )
73
77
}
74
78
}
75
79
}
@@ -155,7 +159,7 @@ function createTextLikeExpressions(
155
159
) {
156
160
const values = [ ]
157
161
for ( const node of nodes ) {
158
- seen . get ( context . root ) ! . add ( node )
162
+ markNonTemplate ( node , context )
159
163
if ( isEmptyText ( node ) ) continue
160
164
values . push ( resolveExpression ( node , context , ! context . inVOnce ) )
161
165
}
You can’t perform that action at this time.
0 commit comments