From: Jooger Date: Mon, 14 Oct 2019 04:32:01 +0000 (+0800) Subject: refactor(scheduler): replace try catch with callWithErrorHandling (#264) X-Git-Tag: v3.0.0-alpha.0~456 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=312907c9d8e527dd46272f310806e078e8985177;p=thirdparty%2Fvuejs%2Fcore.git refactor(scheduler): replace try catch with callWithErrorHandling (#264) --- diff --git a/packages/runtime-core/src/scheduler.ts b/packages/runtime-core/src/scheduler.ts index 9af84cdbee..9a0c40810f 100644 --- a/packages/runtime-core/src/scheduler.ts +++ b/packages/runtime-core/src/scheduler.ts @@ -1,4 +1,4 @@ -import { handleError, ErrorCodes } from './errorHandling' +import { ErrorCodes, callWithErrorHandling } from './errorHandling' import { isArray } from '@vue/shared' const queue: Function[] = [] @@ -71,11 +71,7 @@ function flushJobs(seenJobs?: JobCountMap) { } } } - try { - job() - } catch (err) { - handleError(err, null, ErrorCodes.SCHEDULER) - } + callWithErrorHandling(job, null, ErrorCodes.SCHEDULER) } flushPostFlushCbs() isFlushing = false