add hasOwnProperty to devTools backend (#22437)
Behnam Mohammadi committed
Sep 27, 2021 at 16:26 UTC
c9d64e5f4c2b7cc70a618eec78900dbfd6d201e8
1 file changed
+7
-6
packages/react-devtools-shared/src/backend/renderer.js
+7
-6
@@ -85,6 +85,7 @@ import {format} from './utils';
85
import {enableProfilerChangedHookIndices} from 'react-devtools-feature-flags';
86
import is from 'shared/objectIs';
87
import isArray from 'shared/isArray';
88
+import hasOwnProperty from 'shared/hasOwnProperty';
89
90
import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
91
import type {
@@ -1380,13 +1381,13 @@ export function attach(
1381
return false;
1382
}
1383
const {deps} = memoizedState;
1383
- const hasOwnProperty = Object.prototype.hasOwnProperty.bind(memoizedState);
1384
+ const boundHasOwnProperty = hasOwnProperty.bind(memoizedState);
1385
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') &&
1391
(deps === null || isArray(deps))
1392
);
1393
}