summaryrefslogtreecommitdiff
path: root/src/lauxlib.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-03-24 11:58:00 +0100
committerBenoit Giannangeli <giann008@gmail.com>2017-03-24 11:58:00 +0100
commit16cdb860e9e8e5550c1178a41eabb52e461ffa46 (patch)
tree87b2aa1ad671927134696c0cd1e61f2edd7e0abd /src/lauxlib.js
parent58c57c57354fce407b11c0d63f8926edf5f469c0 (diff)
downloadfengari-16cdb860e9e8e5550c1178a41eabb52e461ffa46.tar.gz
fengari-16cdb860e9e8e5550c1178a41eabb52e461ffa46.tar.bz2
fengari-16cdb860e9e8e5550c1178a41eabb52e461ffa46.zip
TValue.id to print something when tostring({})
Diffstat (limited to 'src/lauxlib.js')
-rw-r--r--src/lauxlib.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js
index 1b306a3..e3974cb 100644
--- a/src/lauxlib.js
+++ b/src/lauxlib.js
@@ -312,7 +312,7 @@ const luaL_tolstring = function(L, idx) {
default:
let tt = luaL_getmetafield(L, idx, "__name");
let kind = tt === CT.LUA_TSTRING ? lapi.lua_tostring(L, -1) : luaL_typename(L, idx);
- lapi.lua_pushstring(L, `${kind}`); // We can't print memory address in JS
+ lapi.lua_pushstring(L, `${kind}: 0x${lapi.index2addr(L, -1).id.toString(16)}`);
if (tt !== CT.LUA_TNIL)
lapi.lua_remove(L, -2);
break;