text: /* @flow */
  
  import { isObject, isDef, hasSymbol } from 'core/util/index'
  
  /**
   * Runtime helper for rendering v-for lists.
   */
  export function renderList (
    val: any,
    render: (
      val: any,
      keyOrIndex: string | number,
      index?: number
    ) => VNode
  ): ?Array<VNode> {
    let ret: ?Array<VNode>, i, l, keys, key
    // 遍历数组
    if (Array.isArray(val) || typeof val === 'string') {
      ret = new Array(val.length)
      for (i = 0, l = val.length; i < l; i++) {
         // 生成vnode，保存到数组
        ret[i] = render(val[i], i)
      }
    } else if (typeof val === 'number') {
      // 遍历数字
      ret = new Array(val)
      for (i = 0; i < val; i++) {
        // 生成vnode，保存到数组
        ret[i] = render(i + 1, i)
      }
    } else if (isObject(val)) {
      // 遍历对象
      if (hasSymbol && val[Symbol.iterator]) {
        ret = []
        const iterator: Iterator<any> = val[Symbol.iterator]()
        let result = iterator.next()
        while (!result.done) {
          ret.push(render(result.value, ret.length))
          result = iterator.next()
        }
      } else {
        keys = Object.keys(val)
        ret = new Array(keys.length)
        for (i = 0, l = keys.length; i < l; i++) {
          key = keys[i]
          ret[i] = render(val[key], key, i)
        }
      }
    }
    if (!isDef(ret)) {
      ret = []
    }
    (ret: any)._isVList = true
    // 返回vnode数组
    return ret
  }
  