Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import * as t from '@babel/types';
import {hasOwnProperty} from './utils';

export type ComponentDeclaration = t.FunctionDeclaration & {
__componentDeclaration: boolean;
Expand All @@ -14,7 +15,7 @@ export type ComponentDeclaration = t.FunctionDeclaration & {
export function isComponentDeclaration(
node: t.FunctionDeclaration,
): node is ComponentDeclaration {
return Object.prototype.hasOwnProperty.call(node, '__componentDeclaration');
return hasOwnProperty(node, '__componentDeclaration');
}

export function parseComponentDeclaration(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import * as t from '@babel/types';
import {hasOwnProperty} from './utils';

export type HookDeclaration = t.FunctionDeclaration & {
__hookDeclaration: boolean;
Expand All @@ -14,7 +15,7 @@ export type HookDeclaration = t.FunctionDeclaration & {
export function isHookDeclaration(
node: t.FunctionDeclaration,
): node is HookDeclaration {
return Object.prototype.hasOwnProperty.call(node, '__hookDeclaration');
return hasOwnProperty(node, '__hookDeclaration');
}

export function parseHookDeclaration(
Expand Down
4 changes: 1 addition & 3 deletions packages/react-devtools-shared/src/devtools/views/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ import escapeStringRegExp from 'escape-string-regexp';
import {meta} from '../../hydration';
import {formatDataForPreview} from '../../utils';
import isArray from 'react-devtools-shared/src/isArray';
import hasOwnProperty from 'shared/hasOwnProperty';

import type {HooksTree} from 'react-debug-tools/src/ReactDebugHooks';

// $FlowFixMe[method-unbinding]
const hasOwnProperty = Object.prototype.hasOwnProperty;

export function alphaSortEntries(
entryA: [string, mixed],
entryB: [string, mixed],
Expand Down
Loading