summaryrefslogtreecommitdiff
path: root/src/ldblib.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-14 08:18:27 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-14 08:18:27 +0200
commitfd613ef1da5e3eeb10d13351ccf217e33b30b1dd (patch)
tree6e6621056f7fb61c68450c7e12e751857cb54d05 /src/ldblib.js
parentb711f32eee2e0c696cb0e621f54e38c398c7090a (diff)
downloadfengari-fd613ef1da5e3eeb10d13351ccf217e33b30b1dd.tar.gz
fengari-fd613ef1da5e3eeb10d13351ccf217e33b30b1dd.tar.bz2
fengari-fd613ef1da5e3eeb10d13351ccf217e33b30b1dd.zip
debug.upvaluejoin
Diffstat (limited to 'src/ldblib.js')
-rw-r--r--src/ldblib.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/ldblib.js b/src/ldblib.js
index 9fc6ce6..27aca96 100644
--- a/src/ldblib.js
+++ b/src/ldblib.js
@@ -248,13 +248,21 @@ const checkupval = function(L, argf, argnup) {
return nup;
};
-
const db_upvalueid = function(L) {
let n = checkupval(L, 1, 2);
lapi.lua_pushlightuserdata(L, lapi.lua_upvalueid(L, 1, n));
return 1;
};
+const db_upvaluejoin = function(L) {
+ let n1 = checkupval(L, 1, 2);
+ let n2 = checkupval(L, 3, 4);
+ lauxlib.luaL_argcheck(L, !lapi.lua_iscfunction(L, 1), 1, lua.to_luastring("Lua function expected"));
+ lauxlib.luaL_argcheck(L, !lapi.lua_iscfunction(L, 3), 3, lua.to_luastring("Lua function expected"));
+ lapi.lua_upvaluejoin(L, 1, n1, 3, n2);
+ return 0;
+};
+
const db_traceback = function(L) {
let thread = getthread(L);
let L1 = thread.thread;
@@ -281,7 +289,8 @@ const dblib = {
"setupvalue": db_setupvalue,
"setuservalue": db_setuservalue,
"traceback": db_traceback,
- "upvalueid": db_upvalueid
+ "upvalueid": db_upvalueid,
+ "upvaluejoin": db_upvaluejoin
};
// Only with Node