Przeglądaj źródła

refactor(scheduler): replace try catch with callWithErrorHandling (#264)

Jooger 6 lat temu
rodzic
commit
312907c9d8
1 zmienionych plików z 2 dodań i 6 usunięć
  1. 2 6
      packages/runtime-core/src/scheduler.ts

+ 2 - 6
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