(events, simulated)
| 2469 | } |
| 2470 | |
| 2471 | function runEventsInBatch(events, simulated) { |
| 2472 | if (events !== null) { |
| 2473 | eventQueue = accumulateInto(eventQueue, events); |
| 2474 | } |
| 2475 | |
| 2476 | // Set `eventQueue` to null before processing it so that we can tell if more |
| 2477 | // events get enqueued while processing. |
| 2478 | var processingEventQueue = eventQueue; |
| 2479 | eventQueue = null; |
| 2480 | |
| 2481 | if (!processingEventQueue) { |
| 2482 | return; |
| 2483 | } |
| 2484 | |
| 2485 | if (simulated) { |
| 2486 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); |
| 2487 | } else { |
| 2488 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); |
| 2489 | } |
| 2490 | !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0; |
| 2491 | // This would be a good time to rethrow if any of the event handlers threw. |
| 2492 | ReactErrorUtils.rethrowCaughtError(); |
| 2493 | } |
| 2494 | |
| 2495 | function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) { |
| 2496 | var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); |
no test coverage detected