From e438f10592077f8b5432f67ef72a8f1bfbbcdc49 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 12 Dec 2017 15:03:02 +1100 Subject: src/: Use to_luastring more often instead of manually creating arrays --- src/ldblib.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ldblib.js') diff --git a/src/ldblib.js b/src/ldblib.js index 96db3c7..746d3bf 100644 --- a/src/ldblib.js +++ b/src/ldblib.js @@ -281,7 +281,7 @@ const hookf = function(L, ar) { if (ar.currentline >= 0) lua.lua_pushinteger(L, ar.currentline); /* push current line */ else lua.lua_pushnil(L); - assert(lua.lua_getinfo(L, ["l".charCodeAt(0), "S".charCodeAt(0)], ar)); + assert(lua.lua_getinfo(L, lua.to_luastring("lS"), ar)); lua.lua_call(L, 2, 0); /* call hook function */ } }; @@ -328,7 +328,7 @@ const db_sethook = function(L) { lua.lua_createtable(L, 0, 2); /* create a hook table */ lua.lua_pushvalue(L, -1); lua.lua_rawsetp(L, lua.LUA_REGISTRYINDEX, HOOKKEY); /* set it in position */ - lua.lua_pushstring(L, ["k".charCodeAt(0)]); + lua.lua_pushstring(L, lua.to_luastring("k")); lua.lua_setfield(L, -2, lua.to_luastring("__mode", true)); /** hooktable.__mode = "k" */ lua.lua_pushvalue(L, -1); lua.lua_setmetatable(L, -2); /* setmetatable(hooktable) = hooktable */ -- cgit v1.2.3-54-g00ecf