File tree 2 files changed +4
-12
lines changed
2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change 1
1
/* @flow */
2
2
3
3
import type VNode from 'core/vdom/vnode'
4
- import { emptyObject } from 'core/util/index'
5
4
6
5
/**
7
6
* Runtime helper for resolving raw children VNodes into a slot object.
@@ -11,7 +10,7 @@ export function resolveSlots (
11
10
context : ?Component
12
11
) : { [ key : string ] : Array < VNode > } {
13
12
if ( ! children || ! children . length ) {
14
- return emptyObject
13
+ return { }
15
14
}
16
15
const slots = { }
17
16
for ( let i = 0 , l = children . length ; i < l ; i ++ ) {
Original file line number Diff line number Diff line change 1
1
/* @flow */
2
2
3
- import { emptyObject } from 'core/util/index'
4
-
5
3
export function normalizeScopedSlots (
6
4
slots : { [ key : string ] : Function } | void ,
7
5
normalSlots : { [ key : string ] : Array < VNode > }
8
6
) : any {
9
7
let res
10
8
if ( ! slots ) {
11
- if ( normalSlots === emptyObject ) {
12
- return emptyObject
13
- }
14
9
res = { }
15
10
} else if ( slots . _normalized ) {
16
11
return slots
@@ -19,14 +14,12 @@ export function normalizeScopedSlots (
19
14
for ( const key in slots ) {
20
15
res [ key ] = normalizeScopedSlot ( slots [ key ] )
21
16
}
22
- res . _normalized = true
23
17
}
24
18
// expose normal slots on scopedSlots
25
- if ( normalSlots !== emptyObject ) {
26
- for ( const key in normalSlots ) {
27
- res [ key ] = ( ) => normalSlots [ key ]
28
- }
19
+ for ( const key in normalSlots ) {
20
+ res [ key ] = ( ) => normalSlots [ key ]
29
21
}
22
+ res . _normalized = true
30
23
return res
31
24
}
32
25
You can’t perform that action at this time.
0 commit comments