MessageQueue not initializing inCall

Reviewed By: yungsters

Differential Revision: D7898700

fbshipit-source-id: c2b4d6e75e7f5871cd40b00bd173e6f1a929b26a
This commit is contained in:
Riley Dulin 2018-05-10 10:45:36 -07:00 committed by Facebook Github Bot
parent c2c352024f
commit d4d515cdc3
1 changed files with 1 additions and 5 deletions

View File

@ -46,7 +46,6 @@ class MessageQueue {
_successCallbacks: {[key: number]: ?Function}; _successCallbacks: {[key: number]: ?Function};
_failureCallbacks: {[key: number]: ?Function}; _failureCallbacks: {[key: number]: ?Function};
_callID: number; _callID: number;
_inCall: number;
_lastFlush: number; _lastFlush: number;
_eventLoopStartTime: number; _eventLoopStartTime: number;
@ -248,8 +247,7 @@ class MessageQueue {
const now = new Date().getTime(); const now = new Date().getTime();
if ( if (
global.nativeFlushQueueImmediate && global.nativeFlushQueueImmediate &&
(now - this._lastFlush >= MIN_TIME_BETWEEN_FLUSHES_MS || now - this._lastFlush >= MIN_TIME_BETWEEN_FLUSHES_MS
this._inCall === 0)
) { ) {
var queue = this._queue; var queue = this._queue;
this._queue = [[], [], [], this._callID]; this._queue = [[], [], [], this._callID];
@ -286,7 +284,6 @@ class MessageQueue {
*/ */
__guard(fn: () => void) { __guard(fn: () => void) {
this._inCall++;
if (this.__shouldPauseOnThrow()) { if (this.__shouldPauseOnThrow()) {
fn(); fn();
} else { } else {
@ -296,7 +293,6 @@ class MessageQueue {
ErrorUtils.reportFatalError(error); ErrorUtils.reportFatalError(error);
} }
} }
this._inCall--;
} }
// MessageQueue installs a global handler to catch all exceptions where JS users can register their own behavior // MessageQueue installs a global handler to catch all exceptions where JS users can register their own behavior