From 08baa114cced054fdd4717947319dfbe14a7c371 Mon Sep 17 00:00:00 2001 From: Jordan W Date: Sat, 29 Mar 2014 01:17:20 -0700 Subject: [PATCH] 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`. --- src/event/EventPluginUtils.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/event/EventPluginUtils.js b/src/event/EventPluginUtils.js index 5f2715ab9a..bd7608034b 100644 --- a/src/event/EventPluginUtils.js +++ b/src/event/EventPluginUtils.js @@ -135,7 +135,7 @@ function executeDispatchesInOrder(event, executeDispatch) { * @return id of the first dispatch execution who's listener returns true, or * null if no listener returned true. */ -function executeDispatchesInOrderStopAtTrue(event) { +function executeDispatchesInOrderStopAtTrueImpl(event) { var dispatchListeners = event._dispatchListeners; var dispatchIDs = event._dispatchIDs; if (__DEV__) { @@ -159,6 +159,16 @@ function executeDispatchesInOrderStopAtTrue(event) { return null; } +/** + * @see executeDispatchesInOrderStopAtTrueImpl + */ +function executeDispatchesInOrderStopAtTrue(event) { + var ret = executeDispatchesInOrderStopAtTrueImpl(event); + event._dispatchIDs = null; + event._dispatchListeners = null; + return ret; +} + /** * 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