Skip to content

patch.js文件的一行代码疑惑 #14

@jypblue

Description

@jypblue

阅读patch.js源代码的时候发现这句代码:

      if (staticNodeList[index] === node.childNodes[index]) { // maybe have been removed for inserting
        node.removeChild(node.childNodes[index])
      }

不是很理解,
因为此代码上面做了数组转化赋值:

var staticNodeList = _.toArray(node.childNodes)

不太明白这个条件判断是为啥?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions