aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--src/ldblib.js14
2 files changed, 12 insertions, 6 deletions
diff --git a/README.md b/README.md
index 112e227..b23562c 100644
--- a/README.md
+++ b/README.md
@@ -86,12 +86,12 @@
- [ ] io
- [ ] Debug
- [x] debug.debug
+ - [x] debug.getinfo
- [x] debug.getlocal
+ - [x] debug.getregistry
- [x] debug.traceback
- [ ] debug.gethook
- - [ ] debug.getinfo
- [ ] debug.getmetatable
- - [ ] debug.getregistry
- [ ] debug.getupvalue
- [ ] debug.getuservalue
- [ ] debug.sethook
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