diff options
Diffstat (limited to 'src/lbaselib.js')
-rw-r--r-- | src/lbaselib.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lbaselib.js b/src/lbaselib.js index 62d25df..a89cf9d 100644 --- a/src/lbaselib.js +++ b/src/lbaselib.js @@ -64,12 +64,31 @@ const luaB_rawequal = function(L) { return 1; }; +const luaB_rawget = function(L) { + lauxlib.luaL_checktype(L, 1, CT.LUA_TTABLE); + lauxlib.luaL_checkany(L, 2); + lapi.lua_settop(L, 2); + lapi.lua_rawget(L, 1); + return 1; +}; + +const luaB_rawset = function(L) { + lauxlib.luaL_checktype(L, 1, CT.LUA_TTABLE); + lauxlib.luaL_checkany(L, 2); + lauxlib.luaL_checkany(L, 3); + lapi.lua_settop(L, 3); + lapi.lua_rawset(L, 1); + return 1; +}; + const base_funcs = { "print": luaB_print, "tostring": luaB_tostring, "getmetatable": luaB_getmetatable, "setmetatable": luaB_setmetatable, "rawequal": luaB_rawequal, + "rawset": luaB_rawset, + "rawget": luaB_rawget, }; const luaopen_base = function(L) { |