Skip to content

Commit

Permalink
fix: replace Object.hasOwn with `Object.prototype.hasOwnProperty.ca…
Browse files Browse the repository at this point in the history
…ll` for greater browser support (#24907)
  • Loading branch information
adonesky1 authored May 31, 2024
1 parent 6994118 commit a96817b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/scripts/lib/WeakRefObjectMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class WeakRefObjectMap<RecordType extends Record<string, object>>
set(key: string, value: RecordType): this {
const weakRefValue: Partial<WeakRefObject<RecordType>> = {};
for (const keyValue in value) {
if (!Object.hasOwn(value, keyValue)) {
if (!Object.prototype.hasOwnProperty.call(value, keyValue)) {
continue;
}
const item: RecordType[typeof keyValue] = value[keyValue];
Expand Down Expand Up @@ -74,7 +74,7 @@ export class WeakRefObjectMap<RecordType extends Record<string, object>>

const deRefValue: Partial<RecordType> = {};
for (const keyValue in weakRefValue) {
if (!Object.hasOwn(weakRefValue, keyValue)) {
if (!Object.prototype.hasOwnProperty.call(weakRefValue, keyValue)) {
continue;
}
const deref = weakRefValue[keyValue].deref();
Expand Down

0 comments on commit a96817b

Please sign in to comment.