From: OnlyWick Date: Tue, 13 Feb 2024 09:15:18 +0000 (+0800) Subject: chore(errorHandling): directly return value in callWithErrorHandling function (#10315) X-Git-Tag: v3.4.19~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f7a0a08b21e3893191818ba2d8d4f42ee86d89c;p=thirdparty%2Fvuejs%2Fcore.git chore(errorHandling): directly return value in callWithErrorHandling function (#10315) --- diff --git a/packages/runtime-core/src/errorHandling.ts b/packages/runtime-core/src/errorHandling.ts index a1ed69cc3c..041eb12393 100644 --- a/packages/runtime-core/src/errorHandling.ts +++ b/packages/runtime-core/src/errorHandling.ts @@ -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(