moonscript
moonscript copied to clipboard
MoonScript traceback rewriting does not properly handle non-string error values
ryan@buttstallion ~ 19:09:41 % moon test.moon
/usr/bin/lua5.1: ...e/ryan/.luarocks/share/lua/5.1/moonscript/errors.lua:81: attempt to call method 'match' (a nil value)
stack traceback:
...e/ryan/.luarocks/share/lua/5.1/moonscript/errors.lua:81: in function 'rewrite_single'
...e/ryan/.luarocks/share/lua/5.1/moonscript/errors.lua:98: in function 'rewrite_traceback'
...rocks/lib/luarocks/rocks/moonscript/0.5.0-1/bin/moon:105: in function <...rocks/lib/luarocks/rocks/moonscript/0.5.0-1/bin/moon:47>
(tail call): ?
[C]: ?
1 ryan@buttstallion ~ 19:09:44 % cat test.moon
error({})
ryan@buttstallion ~ 19:09:48 %
I am also hitting this. One workaround is to essentially xpcall the whole user-program and call tostring on all errors.