@@ -8,11 +8,8 @@ export const DIRECTIVES = 'directives'
8
8
9
9
export type AssetTypes = typeof COMPONENTS | typeof DIRECTIVES
10
10
11
- export function resolveComponent (
12
- name : string ,
13
- maybeSelfReference ?: boolean ,
14
- ) : string | Component {
15
- return resolveAsset ( COMPONENTS , name , true , maybeSelfReference ) || name
11
+ export function resolveComponent ( name : string ) : string | Component {
12
+ return resolveAsset ( COMPONENTS , name , true ) || name
16
13
}
17
14
18
15
export function resolveDirective ( name : string ) : Directive | undefined {
@@ -27,30 +24,21 @@ function resolveAsset(
27
24
type : typeof COMPONENTS ,
28
25
name : string ,
29
26
warnMissing ?: boolean ,
30
- maybeSelfReference ?: boolean ,
31
27
) : Component | undefined
32
28
// overload 2: directives
33
29
function resolveAsset (
34
30
type : typeof DIRECTIVES ,
35
31
name : string ,
36
32
) : Directive | undefined
37
33
// implementation
38
- function resolveAsset (
39
- type : AssetTypes ,
40
- name : string ,
41
- warnMissing = true ,
42
- maybeSelfReference = false ,
43
- ) {
34
+ function resolveAsset ( type : AssetTypes , name : string , warnMissing = true ) {
44
35
const instance = currentInstance
45
36
if ( instance ) {
46
37
const Component = instance . type
47
38
48
39
// explicit self name has highest priority
49
40
if ( type === COMPONENTS ) {
50
- const selfName = getComponentName (
51
- Component ,
52
- false /* do not include inferred name to avoid breaking existing code */ ,
53
- )
41
+ const selfName = getComponentName ( Component )
54
42
if (
55
43
selfName &&
56
44
( selfName === name ||
@@ -65,11 +53,6 @@ function resolveAsset(
65
53
// global registration
66
54
resolve ( instance . appContext [ type ] , name )
67
55
68
- if ( ! res && maybeSelfReference ) {
69
- // fallback to implicit self-reference
70
- return Component
71
- }
72
-
73
56
if ( __DEV__ && warnMissing && ! res ) {
74
57
const extra =
75
58
type === COMPONENTS
0 commit comments