Conditionally export JSTimers

Reviewed By: fkgozali

Differential Revision: D5446953

fbshipit-source-id: c08bd873024d591f5186a3a6767f319de3b6b6d8
This commit is contained in:
Pieter De Baets 2017-07-19 05:36:25 -07:00 committed by Facebook Github Bot
parent 7e29b1fc77
commit a68f6fab0f
2 changed files with 8 additions and 1 deletions

View File

@ -12,6 +12,7 @@
var remoteModulesConfig = [
['RemoteModule1',null,['remoteMethod','promiseMethod'],[]],
['RemoteModule2',null,['remoteMethod','promiseMethod'],[]],
['Timing',null,['callImmediates']],
];
var MessageQueueTestConfig = {

View File

@ -478,4 +478,10 @@ const JSTimers = {
},
};
module.exports = JSTimers;
if (!Timing) {
console.warn("Timing native module is not available, can't set timers.");
// $FlowFixMe: we can assume timers are generally available
module.exports = ({}: typeof JSTimers);
} else {
module.exports = JSTimers;
}