Repository navigation
v0.5.4 - security: limit overruns cannot be hidden, budgeted lookups and close; lua2js keeps Lua truth
Security (execution limits) - do not use 0.4.x to 0.5.3 for untrusted scripts with limits:
- A limit overrun could be hidden by the script: a coroutine created by Lua that exceeded the budget made
coroutine.resume/pcallreturn normally andvm.run()returned its value. Every host entry point (run,call,callRef,Coroutine#resume,protect) now fails with aLimitErrorwhenever a limit was hit during the call, even if Lua caught it. Coroutine#close()ran its__closehandlers without a budget; it now gets a fresh one.- Global path lookups (
call,callMulti,compile,coroutine) ran before the budget, so an__indexmetamethod on_Gcould loop forever. They now run in a protected call under the limits. sandbox: trueno longer leaves the__randomhelper readable as a global.
lua2js: a or b was translated to a ?? b, which returns false where Lua returns b. It now keeps Lua's meaning; the old form is the nullishOr option (--nullish-or).
New: print option ('buffer' | 'native' | false) so a host no longer re-opens libraries to get Lua's own print (which restored string.dump after the sandbox removed it); LuaRef.type is typed 'function' | 'thread' | 'userdata'; vm.resolvePath, vm.failIfLimitHit declared.
Docs: compile is intentionally disabled while limits are active (see the README).
See CHANGES.md for details.