(bookKeeping)
| 5196 | } |
| 5197 | |
| 5198 | function handleTopLevel(bookKeeping) { |
| 5199 | var targetInst = bookKeeping.targetInst; |
| 5200 | |
| 5201 | // Loop through the hierarchy, in case there's any nested components. |
| 5202 | // It's important that we build the array of ancestors before calling any |
| 5203 | // event handlers, because event handlers can modify the DOM, leading to |
| 5204 | // inconsistencies with ReactMount's node cache. See #1105. |
| 5205 | var ancestor = targetInst; |
| 5206 | do { |
| 5207 | if (!ancestor) { |
| 5208 | bookKeeping.ancestors.push(ancestor); |
| 5209 | break; |
| 5210 | } |
| 5211 | var root = findRootContainerNode(ancestor); |
| 5212 | if (!root) { |
| 5213 | break; |
| 5214 | } |
| 5215 | bookKeeping.ancestors.push(ancestor); |
| 5216 | ancestor = getClosestInstanceFromNode(root); |
| 5217 | } while (ancestor); |
| 5218 | |
| 5219 | for (var i = 0; i < bookKeeping.ancestors.length; i++) { |
| 5220 | targetInst = bookKeeping.ancestors[i]; |
| 5221 | runExtractedEventsInBatch(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent)); |
| 5222 | } |
| 5223 | } |
| 5224 | |
| 5225 | // TODO: can we stop exporting these? |
| 5226 | var _enabled = true; |
nothing calls this directly
no test coverage detected