]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(scheduler): replace try catch with callWithErrorHandling (#264)
authorJooger <iamjooger@gmail.com>
Mon, 14 Oct 2019 04:32:01 +0000 (12:32 +0800)
committerEvan You <yyx990803@gmail.com>
Mon, 14 Oct 2019 04:32:01 +0000 (00:32 -0400)
packages/runtime-core/src/scheduler.ts

index 9af84cdbee0e7d2c84699ef75676956b6d1089bf..9a0c40810f52203d18ac8616902f68b7f31face8 100644 (file)
@@ -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