* Run the watchers in a single queue. * * @param {Array} queue
(queue)
| 3066 | */ |
| 3067 | |
| 3068 | function runBatcherQueue(queue) { |
| 3069 | // do not cache length because more watchers might be pushed |
| 3070 | // as we run existing watchers |
| 3071 | for (var i = 0; i < queue.length; i++) { |
| 3072 | var watcher = queue[i]; |
| 3073 | var id = watcher.id; |
| 3074 | has[id] = null; |
| 3075 | watcher.run(); |
| 3076 | // in dev build, check and stop circular updates. |
| 3077 | if ('development' !== 'production' && has[id] != null) { |
| 3078 | circular[id] = (circular[id] || 0) + 1; |
| 3079 | if (circular[id] > config._maxUpdateCount) { |
| 3080 | warn('You may have an infinite update loop for watcher ' + 'with expression "' + watcher.expression + '"', watcher.vm); |
| 3081 | break; |
| 3082 | } |
| 3083 | } |
| 3084 | } |
| 3085 | queue.length = 0; |
| 3086 | } |
| 3087 | |
| 3088 | /** |
| 3089 | * Push a watcher into the watcher queue. |
no test coverage detected