3 ms·
Lua makes it relatively easy to do this to a table, by assigning a __newindex metamethod which throws an error any time code attempts to assign to a field of a
by samatman 5y ago
Lua makes it relatively easy to do this to a table, by assigning a __newindex metamethod which throws an error any time code attempts to assign to a field of a given table.
Which you can get around with rawset, that's what it's there for, but it will catch any idiomatic attempt to mutate the data.