Use debug.traceback for stack traces in Lua-based carts. (#2705)
Fennel carts have debug.traceback set to fennel.traceback during
initialization, which is a function that uses sourcemaps to convert
the traceback data which Lua knows about (with line numbers based on
the Lua output from the Fennel compiler) into traceback data based on
line numbers in the original source code.
Previously this had no effect because debug.traceback was never
actually run; luaapi.c contained a call to the underlying
luaL_traceback function instead, which did not know about
sourcemaps. Replacing it with a call to debug.traceback allows
us to see stack traces that use sourcemap data.
This change should have no effect on Lua carts; only Fennel carts and
perhaps Moonscript carts.
Also in this patch we set the filename field when compiling Fennel
carts; without this the custom fennel.traceback function can't use
sourcemaps as needed.
authored by