diff options
author | daurnimator <quae@daurnimator.com> | 2017-04-26 17:15:37 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-04-26 17:21:52 +1000 |
commit | 46049c9df73a446192957af1f50df19167c79f07 (patch) | |
tree | e055ff69c29a6faf8aec40cd2dc47bb5e245ce05 /src/ltablib.js | |
parent | ef7bc7c1f8684af04da5d9e91fecf6ce82ecf397 (diff) | |
download | fengari-46049c9df73a446192957af1f50df19167c79f07.tar.gz fengari-46049c9df73a446192957af1f50df19167c79f07.tar.bz2 fengari-46049c9df73a446192957af1f50df19167c79f07.zip |
Remove lua.CT and lua.constant_types (still available from defs)
Diffstat (limited to 'src/ltablib.js')
-rw-r--r-- | src/ltablib.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/ltablib.js b/src/ltablib.js index bc51836..60b1554 100644 --- a/src/ltablib.js +++ b/src/ltablib.js @@ -10,7 +10,6 @@ const ldo = require('./ldo.js'); const ldebug = require('./ldebug.js'); const llimit = require('./llimit.js'); const lobject = require('./lobject.js'); -const CT = lua.constant_types; const TS = lua.thread_status; @@ -25,7 +24,7 @@ const TAB_RW = (TAB_R | TAB_W); /* read/write */ const checkfield = function(L, key, n) { lapi.lua_pushstring(L, key); - return lapi.lua_rawget(L, -n) !== CT.LUA_TNIL; + return lapi.lua_rawget(L, -n) !== lua.LUA_TNIL; }; /* @@ -33,7 +32,7 @@ const checkfield = function(L, key, n) { ** has a metatable with the required metamethods) */ const checktab = function(L, arg, what) { - if (lapi.lua_type(L, arg) !== CT.LUA_TTABLE) { /* is it not a table? */ + if (lapi.lua_type(L, arg) !== lua.LUA_TTABLE) { /* is it not a table? */ let n = 1; if (lapi.lua_getmetatable(L, arg) && /* must have metatable */ (!(what & TAB_R) || checkfield(L, lua.to_luastring("__index", true), ++n)) && @@ -42,7 +41,7 @@ const checktab = function(L, arg, what) { lapi.lua_pop(L, n); /* pop metatable and tested metamethods */ } else - lauxlib.luaL_checktype(L, arg, CT.LUA_TTABLE); /* force an error */ + lauxlib.luaL_checktype(L, arg, lua.LUA_TTABLE); /* force an error */ } }; @@ -185,7 +184,7 @@ const unpack = function(L) { const auxsort = function(L) { let t = lapi.index2addr(L, 1); - if (lapi.lua_type(L, 2) !== CT.LUA_TFUNCTION) { /* no function? */ + if (lapi.lua_type(L, 2) !== lua.LUA_TFUNCTION) { /* no function? */ [...t.value.entries()] .sort(function (a, b) { if (typeof a[0] !== 'number') return 1; @@ -216,7 +215,7 @@ const sort = function(L) { if (n > 1) { /* non-trivial interval? */ lauxlib.luaL_argcheck(L, n < llimit.MAX_INT, 1, lua.to_luastring("array too big", true)); if (!lapi.lua_isnoneornil(L, 2)) /* is there a 2nd argument? */ - lauxlib.luaL_checktype(L, 2, CT.LUA_TFUNCTION); /* must be a function */ + lauxlib.luaL_checktype(L, 2, lua.LUA_TFUNCTION); /* must be a function */ lapi.lua_settop(L, 2); /* make sure there are two arguments */ auxsort(L); } |