docs: function capture (instance, index, list) {
    if (process.env.NODE_ENV !== 'production') {
      captureCount++
    }
  
    if (instance.$options && instance.$options.abstract && instance._vnode && instance._vnode.componentInstance) {
      instance = instance._vnode.componentInstance
    }
  
    // Functional component.
    if (instance.fnContext && !instance.componentInstance) {
      const contextUid = instance.fnContext.__VUE_DEVTOOLS_UID__
      let id = functionalIds.get(contextUid)
      if (id == null) {
        id = 0
      } else {
        id++
      }
      functionalIds.set(contextUid, id)
      const functionalId = contextUid + ':functional:' + id
      markFunctional(functionalId, instance)
      return {
        id: functionalId,
        functional: true,
        name: getInstanceName(instance),
        renderKey: getRenderKey(instance.key),
        children: (instance.children ? instance.children.map(
          child => child.fnContext
            ? captureChild(child)
            : child.componentInstance
              ? capture(child.componentInstance)
              : undefined
        )
          // router-view has both fnContext and componentInstance on vnode.
          : instance.componentInstance ? [capture(instance.componentInstance)] : []).filter(Boolean),
        inactive: false,
        isFragment: false // TODO: Check what is it for.
      }
    }
    // instance._uid is not reliable in devtools as there
    // may be 2 roots with same _uid which causes unexpected
    // behaviour
    instance.__VUE_DEVTOOLS_UID__ = getUniqueId(instance)
  
    // Dedupe
    if (captureIds.has(instance.__VUE_DEVTOOLS_UID__)) {
      return
    } else {
      captureIds.set(instance.__VUE_DEVTOOLS_UID__, undefined)
    }
  
    mark(instance)
    const name = getInstanceName(instance)
  
    const ret = {
      uid: instance._uid,
      id: instance.__VUE_DEVTOOLS_UID__,
      name,
      renderKey: getRenderKey(instance.$vnode ? instance.$vnode['key'] : null),
      inactive: !!instance._inactive,
      isFragment: !!instance._isFragment,
      children: instance.$children
        .filter(child => !child._isBeingDestroyed)
        .map(capture)
        .filter(Boolean)
    }
  
    if (instance._vnode && instance._vnode.children) {
      ret.children = ret.children.concat(
        flatten(instance._vnode.children.map(captureChild))
          .filter(Boolean)
      )
    }
  
    // record screen position to ensure correct ordering
    if ((!list || list.length > 1) && !instance._inactive) {
      const rect = getInstanceOrVnodeRect(instance)
      ret.top = rect ? rect.top : Infinity
    } else {
      ret.top = Infinity
    }
    // check if instance is available in console
    const consoleId = consoleBoundInstances.indexOf(instance.__VUE_DEVTOOLS_UID__)
    ret.consoleId = consoleId > -1 ? '$vm' + consoleId : null
    // check router view
    const isRouterView2 = instance.$vnode && instance.$vnode.data.routerView
    if (instance._routerView || isRouterView2) {
      ret.isRouterView = true
      if (!instance._inactive && instance.$route) {
        const matched = instance.$route.matched
        const depth = isRouterView2
          ? instance.$vnode.data.routerViewDepth
          : instance._routerView.depth
        ret.matchedRouteSegment =
          matched &&
          matched[depth] &&
          (isRouterView2 ? matched[depth].path : matched[depth].handler.path)
      }
    }
    return ret
  }