(events, simulated)
| 2376 | } |
| 2377 | |
| 2378 | function runEventsInBatch(events, simulated) { |
| 2379 | if (events !== null) { |
| 2380 | eventQueue = accumulateInto(eventQueue, events); |
| 2381 | } |
| 2382 | |
| 2383 | // Set `eventQueue` to null before processing it so that we can tell if more |
| 2384 | // events get enqueued while processing. |
| 2385 | var processingEventQueue = eventQueue; |
| 2386 | eventQueue = null; |
| 2387 | |
| 2388 | if (!processingEventQueue) { |
| 2389 | return; |
| 2390 | } |
| 2391 | |
| 2392 | if (simulated) { |
| 2393 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); |
| 2394 | } else { |
| 2395 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); |
| 2396 | } |
| 2397 | !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0; |
| 2398 | // This would be a good time to rethrow if any of the event handlers threw. |
| 2399 | ReactErrorUtils.rethrowCaughtError(); |
| 2400 | } |
| 2401 | |
| 2402 | function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) { |
| 2403 | var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); |
no test coverage detected