Don't set global.performance to undefined if it was initialized already

Reviewed By: gaearon

Differential Revision: D6448731

fbshipit-source-id: 8c8c6ff393e452c863f54c83c2e4394fd535dfc5
This commit is contained in:
Alexey Lang 2017-12-01 02:37:06 -08:00 committed by Facebook Github Bot
parent 4fdaf2de98
commit dfebcb70a5
1 changed files with 3 additions and 1 deletions

View File

@ -161,7 +161,9 @@ const Systrace = {
}
if (_canInstallReactHook) {
if (_useFiber) {
global.performance = enabled ? userTimingPolyfill : undefined;
if (enabled && global.performance === undefined) {
global.performance = userTimingPolyfill;
}
} else {
const ReactDebugTool = require('ReactDebugTool');
if (enabled) {