fix #3020: lruQueue using the global hasOwnProperty which may be polluted

This commit is contained in:
Jos de Jong 2023-08-30 10:50:03 +02:00
parent c4926ce56f
commit df4ac5abf3

View File

@ -19,7 +19,7 @@ export function lruQueue (limit) {
base = 1
return
}
while (!hasOwnProperty.call(queue, ++base)) continue
while (!Object.prototype.hasOwnProperty.call(queue, ++base)) {}
}
limit = Math.abs(limit)
return {
@ -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)) {}
return undefined
},
delete: del,