News for hackers. Stuff that matters.
Re:A horrifying globalThis polyfill in JavaScript by codedokode on Monday May 13, 2019 @08:44AM (#19898673)
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?

Re:A horrifying globalThis polyfill in JavaScript by daurnimator on Monday May 13, 2019 @08:00PM (#19905344)
`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 ). The caller cannot pass more arguments.