From 5b6c4d32675e29b615e3bc92b090d2e1df4f9f39 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Wed, 12 Apr 2017 11:18:20 +0200 Subject: debug.getregistry --- src/ldblib.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') 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 -- cgit v1.2.3-70-g09d2