]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore(errorHandling): directly return value in callWithErrorHandling function (#10315)
authorOnlyWick <wick.linxunjie@gmail.com>
Tue, 13 Feb 2024 09:15:18 +0000 (17:15 +0800)
committerGitHub <noreply@github.com>
Tue, 13 Feb 2024 09:15:18 +0000 (17:15 +0800)
packages/runtime-core/src/errorHandling.ts

index a1ed69cc3c22041b29aecbe6c7516e46cbbba432..041eb123938447b48ac360baecd1d4b90b3a272d 100644 (file)
@@ -66,13 +66,11 @@ export function callWithErrorHandling(
   type: ErrorTypes,
   args?: unknown[],
 ) {
-  let res
   try {
-    res = args ? fn(...args) : fn()
+    return args ? fn(...args) : fn()
   } catch (err) {
     handleError(err, instance, type)
   }
-  return res
 }
 
 export function callWithAsyncErrorHandling(