test: tests for error handling
This commit is contained in:
@@ -2,7 +2,8 @@ import {
|
||||
ComponentInstance,
|
||||
LifecycleHooks,
|
||||
currentInstance,
|
||||
setCurrentInstance
|
||||
setCurrentInstance,
|
||||
ComponentRenderProxy
|
||||
} from './component'
|
||||
import { callWithAsyncErrorHandling, ErrorTypeStrings } from './errorHandling'
|
||||
import { warn } from './warning'
|
||||
@@ -92,7 +93,11 @@ export function onRenderTracked(
|
||||
}
|
||||
|
||||
export function onErrorCaptured(
|
||||
hook: Function,
|
||||
hook: (
|
||||
err: Error,
|
||||
instance: ComponentRenderProxy | null,
|
||||
info: string
|
||||
) => boolean | void,
|
||||
target: ComponentInstance | null = currentInstance
|
||||
) {
|
||||
injectHook(LifecycleHooks.ERROR_CAPTURED, hook, target)
|
||||
|
||||
@@ -443,6 +443,5 @@ function hasPropsChanged(prevProps: Data, nextProps: Data): boolean {
|
||||
return true
|
||||
}
|
||||
}
|
||||
console.log(111)
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ export function handleError(
|
||||
errorCapturedHooks[i](
|
||||
err,
|
||||
instance && instance.renderProxy,
|
||||
contextVNode
|
||||
ErrorTypeStrings[type]
|
||||
)
|
||||
) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user