import { currentRenderingInstance } from '../componentRenderUtils'
-import { currentInstance, Component, FunctionalComponent } from '../component'
+import {
+ currentInstance,
+ Component,
+ FunctionalComponent,
+ ComponentOptions
+} from '../component'
import { Directive } from '../directives'
import {
camelize,
res = self
}
}
- if (__DEV__ && warnMissing && !res) {
- warn(`Failed to resolve ${type.slice(0, -1)}: ${name}`)
+ if (__DEV__) {
+ if (res) {
+ // in dev, infer anonymous component's name based on registered name
+ if (type === COMPONENTS && !(res as Component).name) {
+ ;(res as ComponentOptions).name = name
+ }
+ } else if (warnMissing) {
+ warn(`Failed to resolve ${type.slice(0, -1)}: ${name}`)
+ }
}
return res
} else if (__DEV__) {