Skip to content

Commit 2800df5

Browse files
committed
refactor: undefined
1 parent 958a9ca commit 2800df5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Diff for: packages/compiler-vapor/src/transform.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ export class TransformContext<T extends AllNode = AllNode> {
7979

8080
comment: CommentNode[] = []
8181
component: Set<string> = this.ir.component
82-
slots: ComponentSlots | null = null
83-
dynamicSlots: ComponentDynamicSlot[] | null = null
82+
slots?: ComponentSlots
83+
dynamicSlots?: ComponentDynamicSlot[]
8484

8585
private globalId = 0
8686

@@ -100,8 +100,8 @@ export class TransformContext<T extends AllNode = AllNode> {
100100
this.dynamic = ir.dynamic
101101
this.template = ''
102102
this.childrenTemplate = []
103-
this.slots = null
104-
this.dynamicSlots = null
103+
this.slots = undefined
104+
this.dynamicSlots = undefined
105105
isVFor && this.inVFor++
106106
return () => {
107107
// exit

Diff for: packages/compiler-vapor/src/transforms/transformElement.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ function transformComponentElement(
104104
props: propsResult[0] ? propsResult[1] : [propsResult[1]],
105105
resolve,
106106
root,
107-
slots: context.slots || undefined,
108-
dynamicSlots: context.dynamicSlots || undefined,
107+
slots: context.slots,
108+
dynamicSlots: context.dynamicSlots,
109109
})
110-
context.slots = null
111-
context.dynamicSlots = null
110+
context.slots = undefined
111+
context.dynamicSlots = undefined
112112
}
113113

114114
function resolveSetupReference(name: string, context: TransformContext) {

0 commit comments

Comments
 (0)