-
-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tag BoudingBox.getPoints() as a readonly array return #3020
Comments
there are plenty of places in the codebase that do this, no? would we want to do this everywhere...? i feel like that's going to be difficult to stay consistent on. (i personally don't see this as much of a problem... adding |
@mattjennings there is nothing wrong with gradually adding a readonly tag in all the necessary places. While we don't have such a functionality in javascript, it is present in typescript. |
Discussed in #3007
Originally posted by ikudrickiy April 6, 2024
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).
The text was updated successfully, but these errors were encountered: