* 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 no
(node)
| 10703 | * @return {string} ID of the supplied `domNode`. |
| 10704 | */ |
| 10705 | function getID(node) { |
| 10706 | var id = internalGetID(node); |
| 10707 | if (id) { |
| 10708 | if (nodeCache.hasOwnProperty(id)) { |
| 10709 | var cached = nodeCache[id]; |
| 10710 | if (cached !== node) { |
| 10711 | !!isValid(cached, id) ? "development" !== 'production' ? invariant(false, 'ReactMount: Two valid but unequal nodes with the same `%s`: %s', ATTR_NAME, id) : invariant(false) : undefined; |
| 10712 | |
| 10713 | nodeCache[id] = node; |
| 10714 | } |
| 10715 | } else { |
| 10716 | nodeCache[id] = node; |
| 10717 | } |
| 10718 | } |
| 10719 | |
| 10720 | return id; |
| 10721 | } |
| 10722 | |
| 10723 | function internalGetID(node) { |
| 10724 | // If node is something like a window, document, or text node, none of |
nothing calls this directly
no test coverage detected