NorthstarLauncher
NorthstarLauncher copied to clipboard
Warn about incorrect use of `=` on squirrel table
In squirrel, using assignment operator =
to set a key on a table will result in memory corruption if that key does not already exist.
We should see if its viable to warn against this and let the user know to use <-
operator instead.
Not just memory corruption, the script silently stops its current execution. No errors, no warnings, just stops. And then you get a nice crash a while later if you're unlucky.
We should see if its viable to warn against this and let the user know to use
<-
operator instead.
I think we should just raise full script error and let it crash with appropriate error message.
Do we have a mention of this in the wiki btw? As in people should check if table contains before writing to it?
I mean <-
does everything =
but better, =
should never be used with tables really
=
should be used for reassigning a value in a table
<-
also does it, if you want to avoid setting a new value in a table with <-
just check if it exists beforehand, which you would have to do with =
anyway to avoid this issue