(events, simulated)
| 1609 | } |
| 1610 | |
| 1611 | function runEventsInBatch(events, simulated) { |
| 1612 | if (events !== null) { |
| 1613 | eventQueue = accumulateInto(eventQueue, events); |
| 1614 | } |
| 1615 | |
| 1616 | // Set `eventQueue` to null before processing it so that we can tell if more |
| 1617 | // events get enqueued while processing. |
| 1618 | var processingEventQueue = eventQueue; |
| 1619 | eventQueue = null; |
| 1620 | |
| 1621 | if (!processingEventQueue) { |
| 1622 | return; |
| 1623 | } |
| 1624 | |
| 1625 | if (simulated) { |
| 1626 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); |
| 1627 | } else { |
| 1628 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); |
| 1629 | } |
| 1630 | !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0; |
| 1631 | // This would be a good time to rethrow if any of the event handlers threw. |
| 1632 | ReactErrorUtils.rethrowCaughtError(); |
| 1633 | } |
| 1634 | |
| 1635 | function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) { |
| 1636 | var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); |
no test coverage detected