From 5e71d352a6114afb6f43163838d9c326cce37972 Mon Sep 17 00:00:00 2001 From: Tadeu Zagallo Date: Thu, 25 Jun 2015 09:38:54 -0700 Subject: [PATCH] [ReactNative] Guard agains errors during reconciliation Summary: @public After refactoring the MessageQueue a guard was missing on around `batchedUpdates` call. Test Plan: Introduce an error on `getInitialState` of `AdsManagerTabsModalView.ios.js` --- Libraries/Utilities/MessageQueue.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Libraries/Utilities/MessageQueue.js b/Libraries/Utilities/MessageQueue.js index 589ee5e9ad..660d098765 100644 --- a/Libraries/Utilities/MessageQueue.js +++ b/Libraries/Utilities/MessageQueue.js @@ -76,15 +76,17 @@ class MessageQueue { * Public APIs */ processBatch(batch) { - ReactUpdates.batchedUpdates(() => { - batch.forEach((call) => { - let method = call.method === 'callFunctionReturnFlushedQueue' ? - '__callFunction' : '__invokeCallback'; - guard(() => this[method].apply(this, call.args)); + guard(() => { + ReactUpdates.batchedUpdates(() => { + batch.forEach((call) => { + let method = call.method === 'callFunctionReturnFlushedQueue' ? + '__callFunction' : '__invokeCallback'; + guard(() => this[method].apply(this, call.args)); + }); + BridgeProfiling.profile('ReactUpdates.batchedUpdates()'); }); - BridgeProfiling.profile('ReactUpdates.batchedUpdates()'); + BridgeProfiling.profileEnd(); }); - BridgeProfiling.profileEnd(); return this.flushedQueue(); }