This repository was archived by the owner on Jul 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +9
-18
lines changed
packages/compiler-vapor/src Expand file tree Collapse file tree 4 files changed +9
-18
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import {
2525 type VaporDirectiveNode ,
2626} from './ir'
2727import { isConstantExpression } from './utils'
28- import { genDefaultDynamic } from './transforms/utils'
28+ import { newDynamic } from './transforms/utils'
2929
3030export type NodeTransform = (
3131 node : RootNode | TemplateChildNode ,
@@ -174,7 +174,7 @@ export class TransformContext<T extends AllNode = AllNode> {
174174
175175 template : '' ,
176176 childrenTemplate : [ ] ,
177- dynamic : genDefaultDynamic ( ) ,
177+ dynamic : newDynamic ( ) ,
178178 } satisfies Partial < TransformContext < T > > )
179179 }
180180}
@@ -217,9 +217,7 @@ export function transform(
217217 block : {
218218 type : IRNodeTypes . BLOCK ,
219219 node : root ,
220- dynamic : extend ( genDefaultDynamic ( ) , {
221- flags : DynamicFlag . REFERENCED ,
222- } satisfies Partial < IRDynamicInfo > ) ,
220+ dynamic : newDynamic ( ) ,
223221 effect : [ ] ,
224222 operation : [ ] ,
225223 returns : [ ] ,
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ import {
1111import { extend } from '@vue/shared'
1212import { DynamicFlag , type IRDynamicInfo } from '../ir'
1313
14- export const genDefaultDynamic = ( ) : IRDynamicInfo => ( {
15- flags : DynamicFlag . NONE ,
14+ export const newDynamic = ( ) : IRDynamicInfo => ( {
15+ flags : DynamicFlag . REFERENCED ,
1616 children : [ ] ,
1717} )
1818
Original file line number Diff line number Diff line change @@ -11,13 +11,11 @@ import {
1111import {
1212 type BlockIRNode ,
1313 DynamicFlag ,
14- type IRDynamicInfo ,
1514 IRNodeTypes ,
1615 type VaporDirectiveNode ,
1716} from '../ir'
18- import { extend } from '@vue/shared'
1917import { findProp , propToExpression } from '../utils'
20- import { genDefaultDynamic , wrapTemplate } from './utils'
18+ import { newDynamic , wrapTemplate } from './utils'
2119
2220export const transformVFor = createStructuralDirectiveTransform (
2321 'for' ,
@@ -53,9 +51,7 @@ export function processFor(
5351 const render : BlockIRNode = {
5452 type : IRNodeTypes . BLOCK ,
5553 node,
56- dynamic : extend ( genDefaultDynamic ( ) , {
57- flags : DynamicFlag . REFERENCED ,
58- } satisfies Partial < IRDynamicInfo > ) ,
54+ dynamic : newDynamic ( ) ,
5955 effect : [ ] ,
6056 operation : [ ] ,
6157 returns : [ ] ,
Original file line number Diff line number Diff line change @@ -11,12 +11,11 @@ import {
1111import {
1212 type BlockIRNode ,
1313 DynamicFlag ,
14- type IRDynamicInfo ,
1514 IRNodeTypes ,
1615 type VaporDirectiveNode ,
1716} from '../ir'
1817import { extend } from '@vue/shared'
19- import { genDefaultDynamic , wrapTemplate } from './utils'
18+ import { newDynamic , wrapTemplate } from './utils'
2019import { getSiblingIf } from './transformComment'
2120
2221export const transformVIf = createStructuralDirectiveTransform (
@@ -118,9 +117,7 @@ export function createIfBranch(
118117 const branch : BlockIRNode = {
119118 type : IRNodeTypes . BLOCK ,
120119 node,
121- dynamic : extend ( genDefaultDynamic ( ) , {
122- flags : DynamicFlag . REFERENCED ,
123- } satisfies Partial < IRDynamicInfo > ) ,
120+ dynamic : newDynamic ( ) ,
124121 effect : [ ] ,
125122 operation : [ ] ,
126123 returns : [ ] ,
You can’t perform that action at this time.
0 commit comments