diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ldebug.js | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/ldebug.js b/src/ldebug.js index 3b01263..aa57aef 100644 --- a/src/ldebug.js +++ b/src/ldebug.js @@ -388,7 +388,7 @@ const funcnamefromcode = function(L, ci) { return null; /* cannot find a reasonable name */ } - r.name = L.l_G.tmname[tm]; + r.name = L.l_G.tmname[tm].jsstring(); r.funcname = "metamethod"; return r; }; @@ -431,14 +431,7 @@ const varinfo = function(L, o) { kind = getobjname(ci.func.p, ci.pcOff, stkid - ci.u.l.base); } - if (kind) { - let funcname = kind.funcname instanceof TValue ? kind.funcname.jsstring() : kind.funcname; - let name = kind.name instanceof TValue ? kind.name.jsstring() : kind.name; - - return ` (${funcname} '${name}')`; - } - - return ``; + return kind ? ` (${kind.funcname} '${kind.name}')` : ``; }; const luaG_typeerror = function(L, o, op) { @@ -519,4 +512,4 @@ module.exports.luaG_typeerror = luaG_typeerror; module.exports.luaG_concaterror = luaG_concaterror; module.exports.luaG_opinterror = luaG_opinterror; module.exports.luaG_ordererror = luaG_ordererror; -module.exports.luaG_tointerror = luaG_tointerror;
\ No newline at end of file +module.exports.luaG_tointerror = luaG_tointerror; |