docs: function scan () {
    rootInstances.length = 0
    let inFragment = false
    let currentFragment = null
  
    function processInstance (instance) {
      if (instance) {
        if (rootInstances.indexOf(instance.$root) === -1) {
          instance = instance.$root
        }
        if (instance._isFragment) {
          inFragment = true
          currentFragment = instance
        }
  
        // respect Vue.config.devtools option
        let baseVue = instance.constructor
        while (baseVue.super) {
          baseVue = baseVue.super
        }
        if (baseVue.config && baseVue.config.devtools) {
          // give a unique id to root instance so we can
          // 'namespace' its children
          if (typeof instance.__VUE_DEVTOOLS_ROOT_UID__ === 'undefined') {
            instance.__VUE_DEVTOOLS_ROOT_UID__ = ++rootUID
          }
          rootInstances.push(instance)
        }
  
        return true
      }
    }
  
    if (isBrowser) {
      walk(document, function (node) {
        if (inFragment) {
          if (node === currentFragment._fragmentEnd) {
            inFragment = false
            currentFragment = null
          }
          return true
        }
        let instance = node.__vue__
  
        return processInstance(instance)
      })
    } else {
      if (Array.isArray(target.__VUE_ROOT_INSTANCES__)) {
        target.__VUE_ROOT_INSTANCES__.map(processInstance)
      }
    }
    hook.emit('router:init')
    flush()
  }