aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-01-07 19:43:29 +1100
committerdaurnimator <quae@daurnimator.com>2018-01-07 19:43:29 +1100
commitb0b0b21f4394fabf41d6e3556f455a0a740f3f08 (patch)
treed64a74372eb8f7ac0f40373d25bfaff6ab469864
parent2968965c7e531ec0121190d5a5d0e66e0774306b (diff)
downloadfengari-b0b0b21f4394fabf41d6e3556f455a0a740f3f08.tar.gz
fengari-b0b0b21f4394fabf41d6e3556f455a0a740f3f08.tar.bz2
fengari-b0b0b21f4394fabf41d6e3556f455a0a740f3f08.zip
src/lauxlib.js: Add missing LUA_ERRFILE
-rw-r--r--src/lauxlib.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js
index 1eac8d3..52ea3a2 100644
--- a/src/lauxlib.js
+++ b/src/lauxlib.js
@@ -2,6 +2,9 @@
const lua = require('./lua.js');
+/* extra error code for 'luaL_loadfilex' */
+const LUA_ERRFILE = lua.LUA_ERRERR+1;
+
/* key, in the registry, for table of loaded modules */
const LUA_LOADED_TABLE = lua.to_luastring("_LOADED");
@@ -681,7 +684,7 @@ const errfile = function(L, what, fnameindex, error) {
let filename = lua.lua_tostring(L, fnameindex).subarray(1);
lua.lua_pushfstring(L, lua.to_luastring("cannot %s %s: %s"), lua.to_luastring(what), filename, lua.to_luastring(serr));
lua.lua_remove(L, fnameindex);
- return lua.LUA_ERRFILE;
+ return LUA_ERRFILE;
};
let getc;
@@ -914,6 +917,7 @@ const luaL_checkversion = function(L) {
luaL_error(L, lua.to_luastring("version mismatch: app. needs %f, Lua core provides %f"), ver, v);
};
+module.exports.LUA_ERRFILE = LUA_ERRFILE;
module.exports.LUA_FILEHANDLE = LUA_FILEHANDLE;
module.exports.LUA_LOADED_TABLE = LUA_LOADED_TABLE;
module.exports.LUA_NOREF = LUA_NOREF;