Permalink
Browse files

Merge JSTimers and JSTimersExecution

Reviewed By: mmmulani

Differential Revision: D5292923

fbshipit-source-id: d8331cbac28ba3bbf47c9746238a755b707903ea
  • Loading branch information...
javache authored and facebook-github-bot committed Jun 22, 2017
1 parent e9f657f commit 0ae11f12f3a6e1d526287f2ec3c4e900bda498ae
@@ -15,7 +15,6 @@
'use strict';
const ErrorUtils = require('ErrorUtils');
const JSTimersExecution = require('JSTimersExecution');
const Systrace = require('Systrace');
const deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev');
@@ -41,6 +40,9 @@ const TRACE_TAG_REACT_APPS = 1 << 17;
const DEBUG_INFO_LIMIT = 32;
// Work around an initialization order issue
let JSTimers = null;
class MessageQueue {
_lazyCallableModules: {[key: string]: void => Object};
_queue: [Array<number>, Array<number>, Array<any>, number];
@@ -235,8 +237,11 @@ class MessageQueue {
}
__callImmediates() {
Systrace.beginEvent('JSTimersExecution.callImmediates()');
JSTimersExecution.callImmediates();
Systrace.beginEvent('JSTimers.callImmediates()');
if (!JSTimers) {
JSTimers = require('JSTimers');
}
JSTimers.callImmediates();
Systrace.endEvent();
}
@@ -112,7 +112,7 @@ ExceptionsManager.installConsoleErrorReporter();
// TODO: Move these around to solve the cycle in a cleaner way
const BatchedBridge = require('BatchedBridge');
BatchedBridge.registerLazyCallableModule('Systrace', () => require('Systrace'));
BatchedBridge.registerLazyCallableModule('JSTimersExecution', () => require('JSTimersExecution'));
BatchedBridge.registerLazyCallableModule('JSTimersExecution', () => require('JSTimers'));
BatchedBridge.registerLazyCallableModule('HeapCapture', () => require('HeapCapture'));
BatchedBridge.registerLazyCallableModule('SamplingProfiler', () => require('SamplingProfiler'));
BatchedBridge.registerLazyCallableModule('RCTLog', () => require('RCTLog'));
Oops, something went wrong.

0 comments on commit 0ae11f1

Please sign in to comment.