code: function indexTree(node) {
              if (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE) {
                  var curChild = node.firstChild;
                  while (curChild) {
                      var key = getNodeKey(curChild);
                      if (key) {
                          fromNodesLookup[key] = curChild;
                      }
  
                      // Walk recursively
                      indexTree(curChild);
  
                      curChild = curChild.nextSibling;
                  }
              }
          }
docs: // NodeIterator implementation is no faster, but keeping this around in case this changes in the future  function indexTree(node) { var nodeIterator = document.createNodeIterator(node, NodeFilter.SHOW_ELEMENT); var el; while((el = nodeIterator.nextNode())) { var key = getNodeKey(el); if (key) { fromNodesLookup[key] = el; } } }