@samitouri / QOS-React-2 / commits / 08baa114cc

Make EventPluginUtils clear dispatchIDs and dispatchListeners

The other dispatch utils clear these out and I found a bug where they weren't being cleared out. I'm thinking this should probably be done in the `SyntheticEvent` constructor but at least this way it's consistent. Also, I know no one else uses `executeDispatchesInOrderStopAtTrue` except the `ResponderEventPlugin`.

Jordan W committed Mar 29, 2014 at 01:17 UTC 08baa114cced054fdd4717947319dfbe14a7c371
1 file changed +11 -1
src/event/EventPluginUtils.js
+11 -1
@@ -135,7 +135,7 @@ function executeDispatchesInOrder(event, executeDispatch) {
135 * @return id of the first dispatch execution who's listener returns true, or
136 * null if no listener returned true.
137 */
138 -function executeDispatchesInOrderStopAtTrue(event) {
138 +function executeDispatchesInOrderStopAtTrueImpl(event) {
139 var dispatchListeners = event._dispatchListeners;
140 var dispatchIDs = event._dispatchIDs;
141 if (__DEV__) {
@@ -159,6 +159,16 @@ function executeDispatchesInOrderStopAtTrue(event) {
159 return null;
160 }
161
162 +/**
163 + * @see executeDispatchesInOrderStopAtTrueImpl
164 + */
165 +function executeDispatchesInOrderStopAtTrue(event) {
166 + var ret = executeDispatchesInOrderStopAtTrueImpl(event);
167 + event._dispatchIDs = null;
168 + event._dispatchListeners = null;
169 + return ret;
170 +}
171 +
172 /**
173 * Execution of a "direct" dispatch - there must be at most one dispatch
174 * accumulated on the event or it is considered an error. It doesn't really make