Skip to content

Commit

Permalink
fix #3020: lruQueue using the global hasOwnProperty which may be …
Browse files Browse the repository at this point in the history
…polluted
  • Loading branch information
josdejong committed Aug 30, 2023
1 parent c4926ce commit df4ac5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/lruQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function lruQueue (limit) {
base = 1
return
}
while (!hasOwnProperty.call(queue, ++base)) continue
while (!Object.prototype.hasOwnProperty.call(queue, ++base)) {}

Check failure on line 22 in src/utils/lruQueue.js

View workflow job for this annotation

GitHub Actions / build-and-test

Empty block statement

Check failure on line 22 in src/utils/lruQueue.js

View workflow job for this annotation

GitHub Actions / lint

Empty block statement
}
limit = Math.abs(limit)
return {
Expand All @@ -36,7 +36,7 @@ export function lruQueue (limit) {
}
delete queue[oldIndex]
if (base !== oldIndex) return undefined
while (!hasOwnProperty.call(queue, ++base)) continue
while (!Object.prototype.hasOwnProperty.call(queue, ++base)) {}

Check failure on line 39 in src/utils/lruQueue.js

View workflow job for this annotation

GitHub Actions / build-and-test

Empty block statement

Check failure on line 39 in src/utils/lruQueue.js

View workflow job for this annotation

GitHub Actions / lint

Empty block statement
return undefined
},
delete: del,
Expand Down

0 comments on commit df4ac5a

Please sign in to comment.