]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
feat(runtime-core): throw real error when scheduler detects infinite loop during...
authorAlanYu <35493996+smallnine9@users.noreply.github.com>
Tue, 19 Dec 2023 08:59:47 +0000 (16:59 +0800)
committerGitHub <noreply@github.com>
Tue, 19 Dec 2023 08:59:47 +0000 (16:59 +0800)
close #7437

packages/runtime-core/src/scheduler.ts

index 5b096b563e4a52373b59e39f085a19a423e62208..0b3175810631bb50a701d34c5df076b869aff62b 100644 (file)
@@ -1,7 +1,6 @@
-import { ErrorCodes, callWithErrorHandling } from './errorHandling'
+import { ErrorCodes, callWithErrorHandling, handleError } from './errorHandling'
 import { Awaited, isArray, NOOP } from '@vue/shared'
 import { ComponentInternalInstance, getComponentName } from './component'
-import { warn } from './warning'
 
 export interface SchedulerJob extends Function {
   id?: number
@@ -271,14 +270,16 @@ function checkRecursiveUpdates(seen: CountMap, fn: SchedulerJob) {
     if (count > RECURSION_LIMIT) {
       const instance = fn.ownerInstance
       const componentName = instance && getComponentName(instance.type)
-      warn(
+      handleError(
         `Maximum recursive updates exceeded${
           componentName ? ` in component <${componentName}>` : ``
         }. ` +
           `This means you have a reactive effect that is mutating its own ` +
           `dependencies and thus recursively triggering itself. Possible sources ` +
           `include component template, render function, updated hook or ` +
-          `watcher source function.`
+          `watcher source function.`,
+        null,
+        ErrorCodes.APP_ERROR_HANDLER
       )
       return true
     } else {