* Execution of a "direct" dispatch - there must be at most one dispatch * accumulated on the event or it is considered an error. It doesn't really make * sense for an event with multiple dispatches (bubbled) to keep track of the * return values at each dispatch execution, but it does tend to make
(event)
| 2939 | * @return {*} The return value of executing the single dispatch. |
| 2940 | */ |
| 2941 | function executeDirectDispatch(event) { |
| 2942 | if ("development" !== 'production') { |
| 2943 | validateEventDispatches(event); |
| 2944 | } |
| 2945 | var dispatchListener = event._dispatchListeners; |
| 2946 | var dispatchInstance = event._dispatchInstances; |
| 2947 | !!Array.isArray(dispatchListener) ? "development" !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : void 0; |
| 2948 | event.currentTarget = EventPluginUtils.getNodeFromInstance(dispatchInstance); |
| 2949 | var res = dispatchListener ? dispatchListener(event) : null; |
| 2950 | event.currentTarget = null; |
| 2951 | event._dispatchListeners = null; |
| 2952 | event._dispatchInstances = null; |
| 2953 | return res; |
| 2954 | } |
| 2955 | |
| 2956 | /** |
| 2957 | * @param {SyntheticEvent} event |
nothing calls this directly
no test coverage detected
searching dependent graphs…