mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-02 22:41:18 +08:00
RN: Change Time Drift Error into Warning
Summary: Changes the time drift error into a warning that will only get logged once per debugging session. Reviewed By: jingc Differential Revision: D3539067 fbshipit-source-id: 357db15750d867a91c39b5fc5fd6ed4ae2852bc7
This commit is contained in:
committed by
Facebook Github Bot 8
parent
6d3c7b8a4c
commit
ed4db631fa
@@ -16,6 +16,8 @@ var performanceNow = require('fbjs/lib/performanceNow');
|
||||
var warning = require('fbjs/lib/warning');
|
||||
var Systrace = require('Systrace');
|
||||
|
||||
let hasEmittedTimeDriftWarning = false;
|
||||
|
||||
/**
|
||||
* JS implementation of timer functions. Must be completely driven by an
|
||||
* external clock signal, all that's stored here is timerID, timer type, and
|
||||
@@ -147,6 +149,17 @@ var JSTimersExecution = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Called from native (in development) when environment times are out-of-sync.
|
||||
*/
|
||||
emitTimeDriftWarning: function(warningMessage) {
|
||||
if (hasEmittedTimeDriftWarning) {
|
||||
return;
|
||||
}
|
||||
hasEmittedTimeDriftWarning = true;
|
||||
console.warn(warningMessage);
|
||||
},
|
||||
|
||||
_clearIndex: function(i) {
|
||||
JSTimersExecution.timerIDs[i] = null;
|
||||
JSTimersExecution.callbacks[i] = null;
|
||||
|
||||
Reference in New Issue
Block a user