aboutsummaryrefslogtreecommitdiff
path: root/src/ldblib.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-12-12 15:03:02 +1100
committerdaurnimator <quae@daurnimator.com>2017-12-13 15:03:54 +1100
commite438f10592077f8b5432f67ef72a8f1bfbbcdc49 (patch)
tree7755e33334b592e78bc76a20a47fb5e504fe7c74 /src/ldblib.js
parentc5b39b9d292c1a2178aa41c6a95367a81614eb61 (diff)
downloadfengari-e438f10592077f8b5432f67ef72a8f1bfbbcdc49.tar.gz
fengari-e438f10592077f8b5432f67ef72a8f1bfbbcdc49.tar.bz2
fengari-e438f10592077f8b5432f67ef72a8f1bfbbcdc49.zip
src/: Use to_luastring more often instead of manually creating arrays
Diffstat (limited to 'src/ldblib.js')
-rw-r--r--src/ldblib.js4
1 files changed, 2 insertions, 2 deletions
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 */