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 коммит произвёл Facebook Github Bot
Родитель 2984628357
Коммит 9d4cc7cce4
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -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