|
|
@@ -1,10 +1,6 @@
|
|
|
import type { SimpleExpressionNode } from '@vue/compiler-dom'
|
|
|
import type { CodegenContext } from '../generate'
|
|
|
-import type {
|
|
|
- CreateTextNodeIRNode,
|
|
|
- GetTextChildIRNode,
|
|
|
- SetTextIRNode,
|
|
|
-} from '../ir'
|
|
|
+import type { GetTextChildIRNode, SetTextIRNode } from '../ir'
|
|
|
import { getLiteralExpressionValue } from '../utils'
|
|
|
import { genExpression } from './expression'
|
|
|
import { type CodeFragment, NEWLINE, genCall } from './utils'
|
|
|
@@ -22,22 +18,6 @@ export function genSetText(
|
|
|
]
|
|
|
}
|
|
|
|
|
|
-export function genCreateTextNode(
|
|
|
- oper: CreateTextNodeIRNode,
|
|
|
- context: CodegenContext,
|
|
|
-): CodeFragment[] {
|
|
|
- const { helper } = context
|
|
|
- const { id, values, jsx } = oper
|
|
|
- return [
|
|
|
- NEWLINE,
|
|
|
- `const n${id} = `,
|
|
|
- ...genCall(
|
|
|
- helper('createTextNode'),
|
|
|
- values && combineValues(values, context, jsx),
|
|
|
- ),
|
|
|
- ]
|
|
|
-}
|
|
|
-
|
|
|
function combineValues(
|
|
|
values: SimpleExpressionNode[],
|
|
|
context: CodegenContext,
|