GeezerVison is showing github.com — Remove redundant initial of hasOwnProperty (#21134) · react/react@2c9fef3
File treeExpand file treeCollapse file tree Open diff view settings react-server-dom-relay/src react-server-native-relay/src
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/react-dom/src/client/ReactDOMComponent.js +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -13,6 +13,7 @@ import { | 13 | 13 | } from '../events/EventRegistry'; | 14 | 14 |
| 15 | 15 | import {canUseDOM} from 'shared/ExecutionEnvironment'; | | 16 | +import hasOwnProperty from 'shared/hasOwnProperty'; | 16 | 17 |
| 17 | 18 | import { | 18 | 19 | getValueForAttribute, | @@ -443,7 +444,7 @@ export function createElement( | 443 | 444 | !isCustomComponentTag && | 444 | 445 | Object.prototype.toString.call(domElement) === | 445 | 446 | '[object HTMLUnknownElement]' && | 446 | | - !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type) | | 447 | + !hasOwnProperty.call(warnedUnknownTags, type) | 447 | 448 | ) { | 448 | 449 | warnedUnknownTags[type] = true; | 449 | 450 | console.error( | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-dom/src/server/ReactDOMServerFormatConfig.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -44,9 +44,9 @@ import warnValidStyle from '../shared/warnValidStyle'; | 44 | 44 | import escapeTextForBrowser from './escapeTextForBrowser'; | 45 | 45 | import hyphenateStyleName from '../shared/hyphenateStyleName'; | 46 | 46 | import invariant from 'shared/invariant'; | | 47 | +import hasOwnProperty from 'shared/hasOwnProperty'; | 47 | 48 | import sanitizeURL from '../shared/sanitizeURL'; | 48 | 49 |
| 49 | | -const hasOwnProperty = Object.prototype.hasOwnProperty; | 50 | 50 | const isArray = Array.isArray; | 51 | 51 |
| 52 | 52 | // Per response, global state that is not contextual to the rendering subtree. | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-dom/src/server/ReactPartialRenderer.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -77,6 +77,7 @@ import warnValidStyle from '../shared/warnValidStyle'; | 77 | 77 | import {validateProperties as validateARIAProperties} from '../shared/ReactDOMInvalidARIAHook'; | 78 | 78 | import {validateProperties as validateInputProperties} from '../shared/ReactDOMNullInputValuePropHook'; | 79 | 79 | import {validateProperties as validateUnknownProperties} from '../shared/ReactDOMUnknownPropertyHook'; | | 80 | +import hasOwnProperty from 'shared/hasOwnProperty'; | 80 | 81 |
| 81 | 82 | export type ServerOptions = { | 82 | 83 | identifierPrefix?: string, | @@ -340,7 +341,6 @@ function flattenOptionChildren(children: mixed): ?string { | 340 | 341 | return content; | 341 | 342 | } | 342 | 343 |
| 343 | | -const hasOwnProperty = Object.prototype.hasOwnProperty; | 344 | 344 | const STYLE = 'style'; | 345 | 345 | const RESERVED_PROPS = { | 346 | 346 | children: null, | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-dom/src/shared/DOMProperty.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 | */ | 9 | 9 |
| 10 | 10 | import {enableFilterEmptyStringAttributesDOM} from 'shared/ReactFeatureFlags'; | | 11 | +import hasOwnProperty from 'shared/hasOwnProperty'; | 11 | 12 |
| 12 | 13 | type PropertyType = 0 | 1 | 2 | 3 | 4 | 5 | 6; | 13 | 14 |
| @@ -67,7 +68,6 @@ export const VALID_ATTRIBUTE_NAME_REGEX = new RegExp( | 67 | 68 | '^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$', | 68 | 69 | ); | 69 | 70 |
| 70 | | -const hasOwnProperty = Object.prototype.hasOwnProperty; | 71 | 71 | const illegalAttributeNameCache = {}; | 72 | 72 | const validatedAttributeNameCache = {}; | 73 | 73 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/react-dom/src/shared/ReactDOMInvalidARIAHook.js +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 | import {ATTRIBUTE_NAME_CHAR} from './DOMProperty'; | 9 | 9 | import isCustomComponent from './isCustomComponent'; | 10 | 10 | import validAriaProperties from './validAriaProperties'; | | 11 | +import hasOwnProperty from 'shared/hasOwnProperty'; | 11 | 12 |
| 12 | 13 | const warnedProperties = {}; | 13 | 14 | const rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'); | 14 | 15 | const rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$'); | 15 | 16 |
| 16 | | -const hasOwnProperty = Object.prototype.hasOwnProperty; | 17 | | - | 18 | 17 | function validateProperty(tagName, name) { | 19 | 18 | if (__DEV__) { | 20 | 19 | if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) { | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -14,12 +14,12 @@ import { | 14 | 14 | } from './DOMProperty'; | 15 | 15 | import isCustomComponent from './isCustomComponent'; | 16 | 16 | import possibleStandardNames from './possibleStandardNames'; | | 17 | +import hasOwnProperty from 'shared/hasOwnProperty'; | 17 | 18 |
| 18 | 19 | let validateProperty = () => {}; | 19 | 20 |
| 20 | 21 | if (__DEV__) { | 21 | 22 | const warnedProperties = {}; | 22 | | - const hasOwnProperty = Object.prototype.hasOwnProperty; | 23 | 23 | const EVENT_NAME_REGEX = /^on./; | 24 | 24 | const INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/; | 25 | 25 | const rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'); | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-server-dom-relay/src/ReactFlightDOMRelayServerHostConfig.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -13,6 +13,8 @@ import type {Request, ReactModel} from 'react-server/src/ReactFlightServer'; | 13 | 13 |
| 14 | 14 | import JSResourceReference from 'JSResourceReference'; | 15 | 15 |
| | 16 | +import hasOwnProperty from 'shared/hasOwnProperty'; | | 17 | + | 16 | 18 | export type ModuleReference<T> = JSResourceReference<T>; | 17 | 19 |
| 18 | 20 | import type { | @@ -72,8 +74,6 @@ export function processErrorChunk( | 72 | 74 | ]; | 73 | 75 | } | 74 | 76 |
| 75 | | -const hasOwnProperty = Object.prototype.hasOwnProperty; | 76 | | - | 77 | 77 | function convertModelToJSON( | 78 | 78 | request: Request, | 79 | 79 | parent: {+[key: string]: ReactModel} | $ReadOnlyArray<ReactModel>, | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-server-native-relay/src/ReactFlightNativeRelayServerHostConfig.js +1-3Lines changed: 1 addition & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 10 | 10 | import type {RowEncoding, JSONValue} from './ReactFlightNativeRelayProtocol'; | 11 | 11 |
| 12 | 12 | import type {Request, ReactModel} from 'react-server/src/ReactFlightServer'; | 13 | | - | | 13 | +import hasOwnProperty from 'shared/hasOwnProperty'; | 14 | 14 | import JSResourceReferenceImpl from 'JSResourceReferenceImpl'; | 15 | 15 |
| 16 | 16 | export type ModuleReference<T> = JSResourceReferenceImpl<T>; | @@ -72,8 +72,6 @@ export function processErrorChunk( | 72 | 72 | ]; | 73 | 73 | } | 74 | 74 |
| 75 | | -const hasOwnProperty = Object.prototype.hasOwnProperty; | 76 | | - | 77 | 75 | function convertModelToJSON( | 78 | 76 | request: Request, | 79 | 77 | parent: {+[key: string]: ReactModel} | $ReadOnlyArray<ReactModel>, | |
Collapse file Copy file name to clipboardExpand all lines: packages/react/src/ReactElement.js +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 | import getComponentNameFromType from 'shared/getComponentNameFromType'; | 9 | 9 | import invariant from 'shared/invariant'; | 10 | 10 | import {REACT_ELEMENT_TYPE} from 'shared/ReactSymbols'; | | 11 | +import hasOwnProperty from 'shared/hasOwnProperty'; | 11 | 12 |
| 12 | 13 | import ReactCurrentOwner from './ReactCurrentOwner'; | 13 | 14 |
| 14 | | -const hasOwnProperty = Object.prototype.hasOwnProperty; | 15 | | - | 16 | 15 | const RESERVED_PROPS = { | 17 | 16 | key: true, | 18 | 17 | ref: true, | |
Collapse file Copy file name to clipboardExpand all lines: packages/react/src/ReactElementValidator.js +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -33,6 +33,7 @@ import { | 33 | 33 | } from './ReactElement'; | 34 | 34 | import {setExtraStackFrame} from './ReactDebugCurrentFrame'; | 35 | 35 | import {describeUnknownElementTypeFrameInDEV} from 'shared/ReactComponentStackFrame'; | | 36 | +import hasOwnProperty from 'shared/hasOwnProperty'; | 36 | 37 |
| 37 | 38 | function setCurrentlyValidatingElement(element) { | 38 | 39 | if (__DEV__) { | @@ -56,8 +57,6 @@ if (__DEV__) { | 56 | 57 | propTypesMisspellWarningShown = false; | 57 | 58 | } | 58 | 59 |
| 59 | | -const hasOwnProperty = Object.prototype.hasOwnProperty; | 60 | | - | 61 | 60 | function getDeclarationErrorAddendum() { | 62 | 61 | if (ReactCurrentOwner.current) { | 63 | 62 | const name = getComponentNameFromType(ReactCurrentOwner.current.type); | |
|