[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
1 changed files with 9 additions and 7 deletions

View File

@ -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();
}