(events, simulated)
| 2249 | } |
| 2250 | |
| 2251 | function runEventsInBatch(events, simulated) { |
| 2252 | if (events !== null) { |
| 2253 | eventQueue = accumulateInto(eventQueue, events); |
| 2254 | } |
| 2255 | |
| 2256 | // Set `eventQueue` to null before processing it so that we can tell if more |
| 2257 | // events get enqueued while processing. |
| 2258 | var processingEventQueue = eventQueue; |
| 2259 | eventQueue = null; |
| 2260 | |
| 2261 | if (!processingEventQueue) { |
| 2262 | return; |
| 2263 | } |
| 2264 | |
| 2265 | if (simulated) { |
| 2266 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); |
| 2267 | } else { |
| 2268 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); |
| 2269 | } |
| 2270 | !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0; |
| 2271 | // This would be a good time to rethrow if any of the event handlers threw. |
| 2272 | ReactErrorUtils.rethrowCaughtError(); |
| 2273 | } |
| 2274 | |
| 2275 | function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) { |
| 2276 | var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); |
no test coverage detected