From f5f1e387381e909ce13b8c11fedce61ce539ecca Mon Sep 17 00:00:00 2001 From: smallnine Date: Mon, 2 Jan 2023 16:18:16 +0800 Subject: [PATCH] fix(runtime-core): Infinite Loop detection should throw a real error (close #7423) --- packages/runtime-core/src/scheduler.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/runtime-core/src/scheduler.ts b/packages/runtime-core/src/scheduler.ts index 923f3ec8251..0407ff6357e 100644 --- a/packages/runtime-core/src/scheduler.ts +++ b/packages/runtime-core/src/scheduler.ts @@ -1,7 +1,6 @@ import { ErrorCodes, callWithErrorHandling } from './errorHandling' import { isArray, NOOP } from '@vue/shared' import { ComponentInternalInstance, getComponentName } from './component' -import { warn } from './warning' export interface SchedulerJob extends Function { id?: number @@ -262,7 +261,7 @@ function checkRecursiveUpdates(seen: CountMap, fn: SchedulerJob) { if (count > RECURSION_LIMIT) { const instance = fn.ownerInstance const componentName = instance && getComponentName(instance.type) - warn( + throw new Error( `Maximum recursive updates exceeded${ componentName ? ` in component <${componentName}>` : `` }. ` +