Skip to content

Commit

Permalink
remove redundant initial of hasOwnProperty part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
behnammodi committed Apr 1, 2021
1 parent 00ee80d commit 3daf825
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/react-dom/src/client/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from '../events/EventRegistry';

import {canUseDOM} from 'shared/ExecutionEnvironment';
import hasOwnProperty from 'shared/hasOwnProperty';

import {
getValueForAttribute,
Expand Down Expand Up @@ -443,7 +444,7 @@ export function createElement(
!isCustomComponentTag &&
Object.prototype.toString.call(domElement) ===
'[object HTMLUnknownElement]' &&
!Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)
!hasOwnProperty.call(warnedUnknownTags, type)
) {
warnedUnknownTags[type] = true;
console.error(
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/server/ReactPartialRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ import warnValidStyle from '../shared/warnValidStyle';
import {validateProperties as validateARIAProperties} from '../shared/ReactDOMInvalidARIAHook';
import {validateProperties as validateInputProperties} from '../shared/ReactDOMNullInputValuePropHook';
import {validateProperties as validateUnknownProperties} from '../shared/ReactDOMUnknownPropertyHook';
import hasOwnProperty from '../../../shared/hasOwnProperty';
import hasOwnProperty from 'shared/hasOwnProperty';

export type ServerOptions = {
identifierPrefix?: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/shared/ReactDOMInvalidARIAHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import {ATTRIBUTE_NAME_CHAR} from './DOMProperty';
import isCustomComponent from './isCustomComponent';
import validAriaProperties from './validAriaProperties';
import hasOwnProperty from '../../../shared/hasOwnProperty';
import hasOwnProperty from 'shared/hasOwnProperty';

const warnedProperties = {};
const rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from './DOMProperty';
import isCustomComponent from './isCustomComponent';
import possibleStandardNames from './possibleStandardNames';
import hasOwnProperty from '../../../shared/hasOwnProperty';
import hasOwnProperty from 'shared/hasOwnProperty';

let validateProperty = () => {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {Request, ReactModel} from 'react-server/src/ReactFlightServer';

import JSResourceReference from 'JSResourceReference';

import hasOwnProperty from '../../shared/hasOwnProperty';
import hasOwnProperty from 'shared/hasOwnProperty';

export type ModuleReference<T> = JSResourceReference<T>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import type {RowEncoding, JSONValue} from './ReactFlightNativeRelayProtocol';

import type {Request, ReactModel} from 'react-server/src/ReactFlightServer';
import hasOwnProperty from '../../shared/hasOwnProperty';
import hasOwnProperty from 'shared/hasOwnProperty';
import JSResourceReferenceImpl from 'JSResourceReferenceImpl';

export type ModuleReference<T> = JSResourceReferenceImpl<T>;
Expand Down
3 changes: 2 additions & 1 deletion packages/shared/checkPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const loggedTypeFailures = {};
import {describeUnknownElementTypeFrameInDEV} from 'shared/ReactComponentStackFrame';

import ReactSharedInternals from 'shared/ReactSharedInternals';
import hasOwnProperty from 'shared/hasOwnProperty';

const ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;

Expand Down Expand Up @@ -40,7 +41,7 @@ export default function checkPropTypes(
): void {
if (__DEV__) {
// $FlowFixMe This is okay but Flow doesn't know it.
const has = Function.call.bind(Object.prototype.hasOwnProperty);
const has = Function.call.bind(hasOwnProperty);
for (const typeSpecName in typeSpecs) {
if (has(typeSpecs, typeSpecName)) {
let error;
Expand Down

0 comments on commit 3daf825

Please sign in to comment.