[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`
This commit is contained in:
Tadeu Zagallo 2015-06-25 09:38:54 -07:00
parent f383bf2b83
commit 5e71d352a6

View File

@ -76,15 +76,17 @@ class MessageQueue {
* Public APIs * Public APIs
*/ */
processBatch(batch) { processBatch(batch) {
ReactUpdates.batchedUpdates(() => { guard(() => {
batch.forEach((call) => { ReactUpdates.batchedUpdates(() => {
let method = call.method === 'callFunctionReturnFlushedQueue' ? batch.forEach((call) => {
'__callFunction' : '__invokeCallback'; let method = call.method === 'callFunctionReturnFlushedQueue' ?
guard(() => this[method].apply(this, call.args)); '__callFunction' : '__invokeCallback';
guard(() => this[method].apply(this, call.args));
});
BridgeProfiling.profile('ReactUpdates.batchedUpdates()');
}); });
BridgeProfiling.profile('ReactUpdates.batchedUpdates()'); BridgeProfiling.profileEnd();
}); });
BridgeProfiling.profileEnd();
return this.flushedQueue(); return this.flushedQueue();
} }