Skip to content

Commit b84e544

Browse files
committed
refactor: tweaks
1 parent 1c049d9 commit b84e544

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

packages/runtime-core/src/component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,8 +905,8 @@ export function finishComponentSetup(
905905
pauseTracking()
906906
try {
907907
applyOptions(instance)
908-
resetTracking()
909908
} finally {
909+
resetTracking()
910910
unsetCurrentInstance()
911911
}
912912
}

packages/server-renderer/__tests__/render.spec.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -817,21 +817,24 @@ function testRender(type: string, render: typeof renderToString) {
817817
const prev = getCurrentInstance()
818818

819819
expect(prev).toBe(null)
820+
821+
const Child = {
822+
created() {
823+
throw new Error()
824+
}
825+
}
820826
try {
821827
await render(
822828
createApp({
823829
errorCaptured() {
824830
throw new Error()
825831
},
826-
template: `<div>hello</div>`,
827-
created() {
828-
throw new Error()
829-
}
832+
render: () => h(Child)
830833
})
831834
)
832835
} catch {}
833836
expect(
834-
'Unhandled error during execution of created hook'
837+
'Unhandled error during execution of errorCaptured hook'
835838
).toHaveBeenWarned()
836839
expect(getCurrentInstance()).toBe(null)
837840
})

0 commit comments

Comments
 (0)