Remove non-top-level export from JSTimers

Reviewed By: davidaurelio

Differential Revision: D7705416

fbshipit-source-id: 1252789c2cd59b8666b57edcf17948c102e63888
This commit is contained in:
Nat Mote 2018-04-20 10:40:28 -07:00 committed by Facebook Github Bot
parent bc8e42a5e6
commit 931930ae63

View File

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