diff options
author | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-16 07:35:26 +0100 |
---|---|---|
committer | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-16 07:37:18 +0100 |
commit | 3a77114269b53fc57ff00342af18e71f97dcf590 (patch) | |
tree | e33feba1afb32d02c1684294362ac74b9e27007f /src/ltm.js | |
parent | 9d6afeba223c22163928557c69a102877223d3bd (diff) | |
download | fengari-3a77114269b53fc57ff00342af18e71f97dcf590.tar.gz fengari-3a77114269b53fc57ff00342af18e71f97dcf590.tar.bz2 fengari-3a77114269b53fc57ff00342af18e71f97dcf590.zip |
luaL_newstate, lua_pushnil, lua_gettop, luaL_typename
Diffstat (limited to 'src/ltm.js')
-rw-r--r-- | src/ltm.js | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -40,6 +40,24 @@ const TMS = { TM_N: 26 }; +const luaT_typenames_ = [ + "no value", + "nil", + "boolean", + "userdata", + "number", + "string", + "table", + "function", + "userdata", + "thread", + "proto" /* this last case is used for tests only */ +]; + +const ttypename = function(t) { + return luaT_typenames_[t + 1]; +}; + const luaT_init = function(L) { L.l_G.tmname = []; for (let event in TMS) { @@ -112,4 +130,5 @@ module.exports.luaT_callbinTM = luaT_callbinTM; module.exports.luaT_trybinTM = luaT_trybinTM; module.exports.luaT_callorderTM = luaT_callorderTM; module.exports.luaT_gettmbyobj = luaT_gettmbyobj; -module.exports.luaT_init = luaT_init;
\ No newline at end of file +module.exports.luaT_init = luaT_init; +module.exports.ttypename = ttypename;
\ No newline at end of file |