(events, simulated)
| 2514 | } |
| 2515 | |
| 2516 | function runEventsInBatch(events, simulated) { |
| 2517 | if (events !== null) { |
| 2518 | eventQueue = accumulateInto(eventQueue, events); |
| 2519 | } |
| 2520 | |
| 2521 | // Set `eventQueue` to null before processing it so that we can tell if more |
| 2522 | // events get enqueued while processing. |
| 2523 | var processingEventQueue = eventQueue; |
| 2524 | eventQueue = null; |
| 2525 | |
| 2526 | if (!processingEventQueue) { |
| 2527 | return; |
| 2528 | } |
| 2529 | |
| 2530 | if (simulated) { |
| 2531 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); |
| 2532 | } else { |
| 2533 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); |
| 2534 | } |
| 2535 | !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0; |
| 2536 | // This would be a good time to rethrow if any of the event handlers threw. |
| 2537 | ReactErrorUtils.rethrowCaughtError(); |
| 2538 | } |
| 2539 | |
| 2540 | function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) { |
| 2541 | var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); |
no test coverage detected