(events, simulated)
| 2627 | } |
| 2628 | |
| 2629 | function runEventsInBatch(events, simulated) { |
| 2630 | if (events !== null) { |
| 2631 | eventQueue = accumulateInto(eventQueue, events); |
| 2632 | } |
| 2633 | |
| 2634 | // Set `eventQueue` to null before processing it so that we can tell if more |
| 2635 | // events get enqueued while processing. |
| 2636 | var processingEventQueue = eventQueue; |
| 2637 | eventQueue = null; |
| 2638 | |
| 2639 | if (!processingEventQueue) { |
| 2640 | return; |
| 2641 | } |
| 2642 | |
| 2643 | if (simulated) { |
| 2644 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); |
| 2645 | } else { |
| 2646 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); |
| 2647 | } |
| 2648 | !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0; |
| 2649 | // This would be a good time to rethrow if any of the event handlers threw. |
| 2650 | ReactErrorUtils.rethrowCaughtError(); |
| 2651 | } |
| 2652 | |
| 2653 | function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) { |
| 2654 | var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); |
no test coverage detected