Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Fix false positive feature-detection check #1139

Merged
merged 1 commit into from
Aug 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plugins/Profiler/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ module.exports = (bridge: Bridge, agent: Agent, hook: Object) => {
let profilingIsSupported = false;

// Feature detection for profiling mode.
// The presence of an "actualDuration" field signifies:
// 1) This is a new enough version of React
// The presence of an "treeBaseDuration" field signifies:
// 1) This is a new enough version of React (e.g. > 16.4 which was the initial profiling release)
// 2) This is a profiling capable bundle (e.g. DEV or PROFILING)
agent.roots.forEach((rootId: string) => {
const root = agent.internalInstancesById.get(rootId);
if ((root: any).hasOwnProperty('actualDuration')) {
if ((root: any).hasOwnProperty('treeBaseDuration')) {
profilingIsSupported = true;
}
});
Expand Down