Skip to content

Commit c9d64e5

Browse files
authored
add hasOwnProperty to devTools backend (#22437)
1 parent 3746eaf commit c9d64e5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

packages/react-devtools-shared/src/backend/renderer.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ import {format} from './utils';
8585
import {enableProfilerChangedHookIndices} from 'react-devtools-feature-flags';
8686
import is from 'shared/objectIs';
8787
import isArray from 'shared/isArray';
88+
import hasOwnProperty from 'shared/hasOwnProperty';
8889

8990
import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
9091
import type {
@@ -1380,13 +1381,13 @@ export function attach(
13801381
return false;
13811382
}
13821383
const {deps} = memoizedState;
1383-
const hasOwnProperty = Object.prototype.hasOwnProperty.bind(memoizedState);
1384+
const boundHasOwnProperty = hasOwnProperty.bind(memoizedState);
13841385
return (
1385-
hasOwnProperty('create') &&
1386-
hasOwnProperty('destroy') &&
1387-
hasOwnProperty('deps') &&
1388-
hasOwnProperty('next') &&
1389-
hasOwnProperty('tag') &&
1386+
boundHasOwnProperty('create') &&
1387+
boundHasOwnProperty('destroy') &&
1388+
boundHasOwnProperty('deps') &&
1389+
boundHasOwnProperty('next') &&
1390+
boundHasOwnProperty('tag') &&
13901391
(deps === null || isArray(deps))
13911392
);
13921393
}

0 commit comments

Comments
 (0)