3 ms·
You use "global_env" only inside luaopen_js(). Why don't you just add it as an argument, for example: function luaopen_js(L, global) { ... } instead of writin
by codedokode 7y ago
You use "global_env" only inside luaopen_js(). Why don't you just add it as an argument, for example:
function luaopen_js(L, global) { ... }
instead of writing this ugly hack?
- daurnimator 7y ago`luaopen_js` is the entry point for the library with a set API. (that follows https://www.lua.org/manual/5.3/manual.html#lua_CFunction https://www.lua.org/manual/5.3/manual.html#lua_CFunction ). The caller cannot pass more arguments.