summaryrefslogtreecommitdiff
path: root/src/ldebug.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-05 12:50:18 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-05 13:32:04 +1000
commit1cab03b0f0675a86617a7de1749ef3d519a4c334 (patch)
treed490c3a10fd18d793467497da954d74998781158 /src/ldebug.js
parent0299958592ed34cbd6e8cf01891fc5bbaee71750 (diff)
downloadfengari-1cab03b0f0675a86617a7de1749ef3d519a4c334.tar.gz
fengari-1cab03b0f0675a86617a7de1749ef3d519a4c334.tar.bz2
fengari-1cab03b0f0675a86617a7de1749ef3d519a4c334.zip
Don't wrap lexer/parser strings in a TValue
Fixes issue where internal TValues get exposed via lua_Debug structure
Diffstat (limited to 'src/ldebug.js')
-rw-r--r--src/ldebug.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/ldebug.js b/src/ldebug.js
index ef0f719..b411e0a 100644
--- a/src/ldebug.js
+++ b/src/ldebug.js
@@ -78,7 +78,6 @@ const lua_getstack = function(L, level, ar) {
return status;
};
-// TODO: returns TValue or String array ?
const upvalname = function(p, uv) {
assert(uv < p.upvalues.length);
let s = p.upvalues[uv].name;
@@ -396,7 +395,6 @@ const getobjname = function(p, lastpc, reg) {
let k = i.C; /* key index */
let t = i.B; /* table index */
let vn = op === 'OP_GETTABLE' ? lfunc.luaF_getlocalname(p, t + 1, pc) : upvalname(p, t);
- vn = vn ? vn.jsstring() : null;
r.name = kname(p, pc, k).name;
r.funcname = vn && vn === "_ENV" ? defs.to_luastring("global", true) : defs.to_luastring("field", true);
return r;
@@ -536,7 +534,7 @@ const varinfo = function(L, o) {
kind = getobjname(ci.func.value.p, ci.pcOff, stkid - ci.u.l.base);
}
- return defs.to_luastring(kind ? ` (${defs.to_jsstring(kind.funcname)} '${defs.to_jsstring(kind.name.value ? kind.name.value : kind.name)}')` : ``);
+ return kind ? lobject.luaO_pushfstring(L, defs.to_luastring(" (%s '%s')", true), kind.funcname, kind.name) : defs.to_luastring("", true);
};
const luaG_typeerror = function(L, o, op) {