(bookKeeping)
| 5708 | } |
| 5709 | |
| 5710 | function handleTopLevel(bookKeeping) { |
| 5711 | var targetInst = bookKeeping.targetInst; |
| 5712 | |
| 5713 | // Loop through the hierarchy, in case there's any nested components. |
| 5714 | // It's important that we build the array of ancestors before calling any |
| 5715 | // event handlers, because event handlers can modify the DOM, leading to |
| 5716 | // inconsistencies with ReactMount's node cache. See #1105. |
| 5717 | var ancestor = targetInst; |
| 5718 | do { |
| 5719 | if (!ancestor) { |
| 5720 | bookKeeping.ancestors.push(ancestor); |
| 5721 | break; |
| 5722 | } |
| 5723 | var root = findRootContainerNode(ancestor); |
| 5724 | if (!root) { |
| 5725 | break; |
| 5726 | } |
| 5727 | bookKeeping.ancestors.push(ancestor); |
| 5728 | ancestor = getClosestInstanceFromNode(root); |
| 5729 | } while (ancestor); |
| 5730 | |
| 5731 | for (var i = 0; i < bookKeeping.ancestors.length; i++) { |
| 5732 | targetInst = bookKeeping.ancestors[i]; |
| 5733 | runExtractedEventsInBatch(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent)); |
| 5734 | } |
| 5735 | } |
| 5736 | |
| 5737 | // TODO: can we stop exporting these? |
| 5738 | var _enabled = true; |
nothing calls this directly
no test coverage detected