lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 21. Jan 2022, at 10.53, Flyer31 Test <> wrote:

But then Lua will "sort of crash" in sandbox (of course with error
message, but anyway crash) ... and if this crash is not restricted to
sandbox but crashes also any further scripts which invoked this
sandbox, this typically sounds quite obstructive / dangerous.

... but generally I also somehow like this idea to have the possibilty
to set read access flag for any table...

In this example Luau which you cited, who is this done then if you
want to switch back a table later to "normal mode" / "write mode" (so
"unfreeze") - does this work on Luau user level or this this
impossible? (and does it work from Luau C interface, or impossible?)

There are numerous ways to “crash” in a sandbox with or without read only tables. For example, x() when x is nil. The app must take care of these situations somehow, e.g. with pcall.

Read only in Luau is a flag. You can turn it on/off.

More details: