Check before overriding global.performance

Reviewed By: gaearon

Differential Revision: D5218876

fbshipit-source-id: 7fbe9ca020774a0c53d8cbb64996680112828709
This commit is contained in:
Brian Vaughn 2017-06-09 13:14:58 -07:00 committed by Facebook Github Bot
parent 2984628357
commit 9d4cc7cce4
1 changed files with 3 additions and 1 deletions

View File

@ -100,7 +100,9 @@ if (!global.process.env.NODE_ENV) {
const Systrace = require('Systrace');
Systrace.setEnabled(global.__RCTProfileIsProfiling || false);
if (__DEV__) {
global.performance = Systrace.getUserTimingPolyfill();
if (global.performance === undefined) {
global.performance = Systrace.getUserTimingPolyfill();
}
}
// Set up console