mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
fix #3020: lruQueue using the global hasOwnProperty which may be polluted
This commit is contained in:
parent
c4926ce56f
commit
df4ac5abf3
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user