Skip to content

Commit e6dcd21

Browse files
committed
better infinite loop warning
1 parent bff94f3 commit e6dcd21

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/core/observer/scheduler.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,11 @@ function runSchedulerQueue (queue: Array<Watcher>) {
8181
circular[id] = (circular[id] || 0) + 1
8282
if (circular[id] > config._maxUpdateCount) {
8383
warn(
84-
'You may have an infinite update loop for watcher ' +
85-
'with expression "' + watcher.expression + '"',
84+
'You may have an infinite update loop ' + (
85+
watcher === watcher.vm._watcher
86+
? `in a component render function.`
87+
: `in watcher with expression "${watcher.expression}"`
88+
),
8689
watcher.vm
8790
)
8891
break

0 commit comments

Comments
 (0)