Skip to content

Commit e85e0a7

Browse files
authored
chore: use ast node creation helper (#5255)
1 parent 9def7aa commit e85e0a7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/compiler-core/src/transforms/transformText.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import {
55
createCallExpression,
66
CallExpression,
77
ElementTypes,
8-
ConstantTypes
8+
ConstantTypes,
9+
createCompoundExpression
910
} from '../ast'
1011
import { isText } from '../utils'
1112
import { CREATE_TEXT } from '../runtimeHelpers'
@@ -36,11 +37,10 @@ export const transformText: NodeTransform = (node, context) => {
3637
const next = children[j]
3738
if (isText(next)) {
3839
if (!currentContainer) {
39-
currentContainer = children[i] = {
40-
type: NodeTypes.COMPOUND_EXPRESSION,
41-
loc: child.loc,
42-
children: [child]
43-
}
40+
currentContainer = children[i] = createCompoundExpression(
41+
[child],
42+
child.loc
43+
)
4444
}
4545
// merge adjacent text node into current
4646
currentContainer.children.push(` + `, next)

0 commit comments

Comments
 (0)