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