@@ -8,11 +8,8 @@ export const DIRECTIVES = 'directives'
88
99export type AssetTypes = typeof COMPONENTS | typeof DIRECTIVES
1010
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
1613}
1714
1815export function resolveDirective ( name : string ) : Directive | undefined {
@@ -27,30 +24,21 @@ function resolveAsset(
2724 type : typeof COMPONENTS ,
2825 name : string ,
2926 warnMissing ?: boolean ,
30- maybeSelfReference ?: boolean ,
3127) : Component | undefined
3228// overload 2: directives
3329function resolveAsset (
3430 type : typeof DIRECTIVES ,
3531 name : string ,
3632) : Directive | undefined
3733// 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 ) {
4435 const instance = currentInstance
4536 if ( instance ) {
4637 const Component = instance . type
4738
4839 // explicit self name has highest priority
4940 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 )
5442 if (
5543 selfName &&
5644 ( selfName === name ||
@@ -65,11 +53,6 @@ function resolveAsset(
6553 // global registration
6654 resolve ( instance . appContext [ type ] , name )
6755
68- if ( ! res && maybeSelfReference ) {
69- // fallback to implicit self-reference
70- return Component
71- }
72-
7356 if ( __DEV__ && warnMissing && ! res ) {
7457 const extra =
7558 type === COMPONENTS
0 commit comments