function getID(node) {
  var id = internalGetID(node);
  if (id) {
    if (nodeCache.hasOwnProperty(id)) {
      var cached = nodeCache[id];
      if (cached !== node) {
        !!isValid(cached, id) ? "development" !== 'production' ? invariant(false, 'ReactMount: Two valid but unequal nodes with the same `%s`: %s', ATTR_NAME, id) : invariant(false) : undefined;

        nodeCache[id] = node;
      }
    } else {
      nodeCache[id] = node;
    }
  }

  return id;
}
Accessing node[ATTR_NAME] or calling getAttribute(ATTR_NAME) on a form
element can return its control whose name or ID equals ATTR_NAME. All
DOM nodes support `getAttributeNode` but this can also get called on
other objects so just return '' if we're given something other than a
DOM node (such as window).

@param {?DOMElement|DOMWindow|DOMDocument|DOMTextNode} node DOM node.
@return {string} ID of the supplied `domNode`.