summaryrefslogtreecommitdiff
path: root/src/ldblib.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-12 11:18:20 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-13 13:29:35 +0200
commit5b6c4d32675e29b615e3bc92b090d2e1df4f9f39 (patch)
tree45877a0fc7ed7e13ed6a67e71b46d39ab279e954 /src/ldblib.js
parentd251efeb37778e2ab57a3d2c80b9df621a691796 (diff)
downloadfengari-5b6c4d32675e29b615e3bc92b090d2e1df4f9f39.tar.gz
fengari-5b6c4d32675e29b615e3bc92b090d2e1df4f9f39.tar.bz2
fengari-5b6c4d32675e29b615e3bc92b090d2e1df4f9f39.zip
debug.getregistry
Diffstat (limited to 'src/ldblib.js')
-rw-r--r--src/ldblib.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ldblib.js b/src/ldblib.js
index ea080c0..7dde1c4 100644
--- a/src/ldblib.js
+++ b/src/ldblib.js
@@ -18,6 +18,11 @@ const checkstack = function(L, L1, n) {
lauxlib.luaL_error(L, "stack overflow");
};
+const db_getregistry = function(L) {
+ lapi.lua_pushvalue(L, lua.LUA_REGISTRYINDEX);
+ return 1;
+};
+
/*
** Auxiliary function used by several library functions: check for
** an optional thread as function's first argument and set 'arg' with
@@ -189,10 +194,11 @@ const db_traceback = function(L) {
};
const dblib = {
- "getinfo": db_getinfo,
- "getlocal": db_getlocal,
- "traceback": db_traceback,
- "upvalueid": db_upvalueid
+ "getinfo": db_getinfo,
+ "getlocal": db_getlocal,
+ "getregistry": db_getregistry,
+ "traceback": db_traceback,
+ "upvalueid": db_upvalueid
};
// Only with Node