dist/main.js
/**
   * Flush both queues and run the watchers.
   */
Flush both queues and run the watchers.
Flush both queues and run the watchers .
function flushSchedulerQueue() {
    currentFlushTimestamp = getNow();
    flushing = true;
    var watcher, id;
    queue.sort(function (a, b) {
      return a.id - b.id;
    });
    for (index = 0; index < queue.length; index++) {
      watcher = queue[index];
      if (watcher.before) {
        watcher.before();
      }
      id = watcher.id;
      has[id] = null;
      watcher.run();
      if (has[id] != null) {
        circular[id] = (circular[id] || 0) + 1;
        if (circular[id] > MAX_UPDATE_COUNT) {
          warn('You may have an infinite update loop ' + (watcher.user ? "in watcher with expression \"" + watcher.expression + "\"" : "in a component render function."), watcher.vm);
          break;
        }
      }
    }
    var activatedQueue = activatedChildren.slice();
    var updatedQueue = queue.slice();
    resetSchedulerState();
    callActivatedHooks(activatedQueue);
    callUpdatedHooks(updatedQueue);
    if (devtools && config.devtools) {
      devtools.emit('flush');
    }
  }
function flushSchedulerQueue ( ) { currentFlushTimestamp = getNow ( ) ; flushing = true ; var watcher , id ; queue . sort ( function ( a , b ) { return a . id - b . id ; } ) ; for ( index = 0 ; index < queue . length ; index ++ ) { watcher = queue [ index ] ; if ( watcher . before ) { watcher . before ( ) ; } id = watcher . id ; has [ id ] = null ; watcher . run ( ) ; if ( has [ id ] != null ) { circular [ id ] = ( circular [ id ] || 0 ) + 1 ; if ( circular [ id ] > MAX_UPDATE_COUNT ) { warn ( 'You may have an infinite update loop ' + ( watcher . user ? "in watcher with expression \"" + watcher . expression + "\"" : "in a component render function." ) , watcher . vm ) ; break ; } } } var activatedQueue = activatedChildren . slice ( ) ; var updatedQueue = queue . slice ( ) ; resetSchedulerState ( ) ; callActivatedHooks ( activatedQueue ) ; callUpdatedHooks ( updatedQueue ) ; if ( devtools && config . devtools ) { devtools . emit ( 'flush' ) ; } }
Flush both queues and run the watchers.
Flush both queues and run the watchers .
// Sort queue before flush. // This ensures that: // 1. Components are updated from parent to child. (because parent is always //    created before the child) // 2. A component's user watchers are run before its render watcher (because //    user watchers are created before the render watcher) // 3. If a component is destroyed during a parent component's watcher run, //    its watchers can be skipped. // do not cache length because more watchers might be pushed // as we run existing watchers // in dev build, check and stop circular updates. // keep copies of post queues before resetting state // call component updated and activated hooks // devtool hook /* istanbul ignore if */