(events, simulated)
| 1700 | } |
| 1701 | |
| 1702 | function runEventsInBatch(events, simulated) { |
| 1703 | if (events !== null) { |
| 1704 | eventQueue = accumulateInto(eventQueue, events); |
| 1705 | } |
| 1706 | |
| 1707 | // Set `eventQueue` to null before processing it so that we can tell if more |
| 1708 | // events get enqueued while processing. |
| 1709 | var processingEventQueue = eventQueue; |
| 1710 | eventQueue = null; |
| 1711 | |
| 1712 | if (!processingEventQueue) { |
| 1713 | return; |
| 1714 | } |
| 1715 | |
| 1716 | if (simulated) { |
| 1717 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); |
| 1718 | } else { |
| 1719 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); |
| 1720 | } |
| 1721 | !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0; |
| 1722 | // This would be a good time to rethrow if any of the event handlers threw. |
| 1723 | ReactErrorUtils.rethrowCaughtError(); |
| 1724 | } |
| 1725 | |
| 1726 | function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) { |
| 1727 | var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); |
no test coverage detected