summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-23 11:17:29 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-23 11:17:29 +0100
commit971263ef6285eaa26884ec81b4285431f379a0e7 (patch)
treebfa2ec07673fefe2eebe862dddaeb164d830d18b
parent79a630503c8f609094f6fca8a489fd965f424d17 (diff)
downloadfengari-971263ef6285eaa26884ec81b4285431f379a0e7.tar.gz
fengari-971263ef6285eaa26884ec81b4285431f379a0e7.tar.bz2
fengari-971263ef6285eaa26884ec81b4285431f379a0e7.zip
Removed unnecessary TValue test in varinfo
-rw-r--r--src/ldebug.js13
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;