Skip to content

Commit

Permalink
add hasOwnProperty to devTools backend (#22437)
Browse files Browse the repository at this point in the history
  • Loading branch information
behnammodi authored Sep 27, 2021
1 parent 3746eaf commit c9d64e5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/react-devtools-shared/src/backend/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ import {format} from './utils';
import {enableProfilerChangedHookIndices} from 'react-devtools-feature-flags';
import is from 'shared/objectIs';
import isArray from 'shared/isArray';
import hasOwnProperty from 'shared/hasOwnProperty';

import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
import type {
Expand Down Expand Up @@ -1380,13 +1381,13 @@ export function attach(
return false;
}
const {deps} = memoizedState;
const hasOwnProperty = Object.prototype.hasOwnProperty.bind(memoizedState);
const boundHasOwnProperty = hasOwnProperty.bind(memoizedState);
return (
hasOwnProperty('create') &&
hasOwnProperty('destroy') &&
hasOwnProperty('deps') &&
hasOwnProperty('next') &&
hasOwnProperty('tag') &&
boundHasOwnProperty('create') &&
boundHasOwnProperty('destroy') &&
boundHasOwnProperty('deps') &&
boundHasOwnProperty('next') &&
boundHasOwnProperty('tag') &&
(deps === null || isArray(deps))
);
}
Expand Down

0 comments on commit c9d64e5

Please sign in to comment.