@@ -5,9 +5,9 @@ import { genBlock } from './block'
5
5
import { genExpression } from './expression'
6
6
import {
7
7
type CodeFragment ,
8
- INDENT_END ,
9
- INDENT_START ,
10
8
NEWLINE ,
9
+ SEGMENTS_ARRAY ,
10
+ SEGMENTS_OBJECT_NEWLINE ,
11
11
buildCodeFragment ,
12
12
genCall ,
13
13
genMulti ,
@@ -24,7 +24,7 @@ export function genSlotOutlet(oper: SlotOutletIRNode, context: CodegenContext) {
24
24
? genExpression ( name , context )
25
25
: [ '() => (' , ...genExpression ( name , context ) , ')' ]
26
26
27
- let fallbackArg : false | CodeFragment [ ] = false
27
+ let fallbackArg : CodeFragment [ ] | undefined
28
28
if ( fallback ) {
29
29
fallbackArg = genBlock ( fallback , context )
30
30
}
@@ -56,17 +56,13 @@ export function genSlotOutlet(oper: SlotOutletIRNode, context: CodegenContext) {
56
56
} )
57
57
. filter ( Boolean )
58
58
if ( props . length ) {
59
- return genMulti ( [ '[' , ']' , ', ' ] , ...props )
59
+ return genMulti ( SEGMENTS_ARRAY , ...props )
60
60
}
61
61
}
62
62
63
63
function genStaticProps ( props : IRProp [ ] ) {
64
64
return genMulti (
65
- [
66
- [ '{' , INDENT_START , NEWLINE ] ,
67
- [ INDENT_END , NEWLINE , '}' ] ,
68
- [ ', ' , NEWLINE ] ,
69
- ] ,
65
+ SEGMENTS_OBJECT_NEWLINE ,
70
66
...props . map ( prop => {
71
67
return [
72
68
...genPropKey ( prop , context ) ,
0 commit comments