|
|
@@ -15,7 +15,7 @@ import {
|
|
|
type VaporDirectiveNode,
|
|
|
} from '../ir'
|
|
|
import { extend } from '@vue/shared'
|
|
|
-import { newDynamic, wrapTemplate } from './utils'
|
|
|
+import { newBlock, wrapTemplate } from './utils'
|
|
|
import { getSiblingIf } from './transformComment'
|
|
|
|
|
|
export const transformVIf = createStructuralDirectiveTransform(
|
|
|
@@ -114,15 +114,7 @@ export function createIfBranch(
|
|
|
): [BlockIRNode, () => void] {
|
|
|
context.node = node = wrapTemplate(node, ['if', 'else-if', 'else'])
|
|
|
|
|
|
- const branch: BlockIRNode = {
|
|
|
- type: IRNodeTypes.BLOCK,
|
|
|
- node,
|
|
|
- dynamic: newDynamic(),
|
|
|
- effect: [],
|
|
|
- operation: [],
|
|
|
- returns: [],
|
|
|
- }
|
|
|
-
|
|
|
+ const branch: BlockIRNode = newBlock(node)
|
|
|
const exitBlock = context.enterBlock(branch)
|
|
|
context.reference()
|
|
|
return [branch, exitBlock]
|