summaryrefslogtreecommitdiff
path: root/src/lbaselib.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-03-24 16:40:29 +0100
committerBenoit Giannangeli <giann008@gmail.com>2017-03-24 16:40:29 +0100
commit7af8347dbb7a8c3a09d2aebccd5f96384a7c55c3 (patch)
tree174de728b42de05b68f8ad10d1b0efddf6c188e0 /src/lbaselib.js
parent12944ea4d52a330b8b015af296dbbdee3fb4abbd (diff)
downloadfengari-7af8347dbb7a8c3a09d2aebccd5f96384a7c55c3.tar.gz
fengari-7af8347dbb7a8c3a09d2aebccd5f96384a7c55c3.tar.bz2
fengari-7af8347dbb7a8c3a09d2aebccd5f96384a7c55c3.zip
Proper use of luaO_nilobject
Diffstat (limited to 'src/lbaselib.js')
-rw-r--r--src/lbaselib.js15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/lbaselib.js b/src/lbaselib.js
index 762838c..11906db 100644
--- a/src/lbaselib.js
+++ b/src/lbaselib.js
@@ -341,21 +341,6 @@ if (typeof require === "function") {
} catch (e) {}
if (fs) {
- const load_aux = function(L, status, envidx) {
- if (status === TS.LUA_OK) {
- if (envidx !== 0) { /* 'env' parameter? */
- lapi.lua_pushvalue(L, envidx); /* environment for loaded function */
- if (!lapi.lua_setupvalue(L, -2, 1)) /* set it as 1st upvalue */
- lapi.lua_pop(L, 1); /* remove 'env' if not used by previous call */
- }
- return 1;
- } else { /* error (message is on top of the stack) */
- lapi.lua_pushnil(L);
- lapi.lua_insert(L, -2); /* put before error message */
- return 2; /* return nil plus error message */
- }
- };
-
const luaB_loadfile = function(L) {
let fname = lauxlib.luaL_optstring(L, 1, null);
let mode = lauxlib.luaL_optstring(L, 2, null);