Is it a bug report or security vulnerability? #3007
Unanswered
ikudrickiy
asked this question in
Q&A
Replies: 1 comment 1 reply
-
@ikudrickiy I think a readonly array is appropriate here. The intent is to cache the points of the bounding box to avoid unnecessary JS allocations in the hot path |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The question may seem stupid. But I'm not afraid of those 😉
This public function returns the same array referrence for multiple function calls. I can change the array in one place and it will be changed for all the calls. At the same time, if we assume cloning I don't understand the need for a caching mechanism. It looks like a burden in this case. And if there's no caching, cloning seems like a burden.
We can solve this problem on a typescript level turning the function return into readonly array (see this).
Beta Was this translation helpful? Give feedback.
All reactions