(events, simulated)
| 2411 | } |
| 2412 | |
| 2413 | function runEventsInBatch(events, simulated) { |
| 2414 | if (events !== null) { |
| 2415 | eventQueue = accumulateInto(eventQueue, events); |
| 2416 | } |
| 2417 | |
| 2418 | // Set `eventQueue` to null before processing it so that we can tell if more |
| 2419 | // events get enqueued while processing. |
| 2420 | var processingEventQueue = eventQueue; |
| 2421 | eventQueue = null; |
| 2422 | |
| 2423 | if (!processingEventQueue) { |
| 2424 | return; |
| 2425 | } |
| 2426 | |
| 2427 | if (simulated) { |
| 2428 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); |
| 2429 | } else { |
| 2430 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); |
| 2431 | } |
| 2432 | !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0; |
| 2433 | // This would be a good time to rethrow if any of the event handlers threw. |
| 2434 | ReactErrorUtils.rethrowCaughtError(); |
| 2435 | } |
| 2436 | |
| 2437 | function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) { |
| 2438 | var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); |
no test coverage detected