|
@@ -3,12 +3,15 @@
|
|
|
import type Watcher from './watcher'
|
|
import type Watcher from './watcher'
|
|
|
import config from '../config'
|
|
import config from '../config'
|
|
|
import { callHook } from '../instance/lifecycle'
|
|
import { callHook } from '../instance/lifecycle'
|
|
|
|
|
+
|
|
|
import {
|
|
import {
|
|
|
warn,
|
|
warn,
|
|
|
nextTick,
|
|
nextTick,
|
|
|
devtools
|
|
devtools
|
|
|
} from '../util/index'
|
|
} from '../util/index'
|
|
|
|
|
|
|
|
|
|
+export const MAX_UPDATE_COUNT = 100
|
|
|
|
|
+
|
|
|
const queue: Array<Watcher> = []
|
|
const queue: Array<Watcher> = []
|
|
|
let has: { [key: number]: ?true } = {}
|
|
let has: { [key: number]: ?true } = {}
|
|
|
let circular: { [key: number]: number } = {}
|
|
let circular: { [key: number]: number } = {}
|
|
@@ -55,7 +58,7 @@ function flushSchedulerQueue () {
|
|
|
// in dev build, check and stop circular updates.
|
|
// in dev build, check and stop circular updates.
|
|
|
if (process.env.NODE_ENV !== 'production' && has[id] != null) {
|
|
if (process.env.NODE_ENV !== 'production' && has[id] != null) {
|
|
|
circular[id] = (circular[id] || 0) + 1
|
|
circular[id] = (circular[id] || 0) + 1
|
|
|
- if (circular[id] > config._maxUpdateCount) {
|
|
|
|
|
|
|
+ if (circular[id] > MAX_UPDATE_COUNT) {
|
|
|
warn(
|
|
warn(
|
|
|
'You may have an infinite update loop ' + (
|
|
'You may have an infinite update loop ' + (
|
|
|
watcher.user
|
|
watcher.user
|