aboutsummaryrefslogtreecommitdiff
path: root/src/ldebug.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-12-12 15:03:02 +1100
committerdaurnimator <quae@daurnimator.com>2017-12-13 15:03:54 +1100
commite438f10592077f8b5432f67ef72a8f1bfbbcdc49 (patch)
tree7755e33334b592e78bc76a20a47fb5e504fe7c74 /src/ldebug.js
parentc5b39b9d292c1a2178aa41c6a95367a81614eb61 (diff)
downloadfengari-e438f10592077f8b5432f67ef72a8f1bfbbcdc49.tar.gz
fengari-e438f10592077f8b5432f67ef72a8f1bfbbcdc49.tar.bz2
fengari-e438f10592077f8b5432f67ef72a8f1bfbbcdc49.zip
src/: Use to_luastring more often instead of manually creating arrays
Diffstat (limited to 'src/ldebug.js')
-rw-r--r--src/ldebug.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ldebug.js b/src/ldebug.js
index e5265e4..58bccc9 100644
--- a/src/ldebug.js
+++ b/src/ldebug.js
@@ -86,7 +86,7 @@ const lua_getstack = function(L, level, ar) {
const upvalname = function(p, uv) {
assert(uv < p.upvalues.length);
let s = p.upvalues[uv].name;
- if (s === null) return ["?".charCodeAt(0)];
+ if (s === null) return defs.to_luastring("?", true);
return s.getstr();
};
@@ -170,7 +170,7 @@ const funcinfo = function(ar, cl) {
ar.source = defs.to_luastring("=[JS]", true);
ar.linedefined = -1;
ar.lastlinedefined = -1;
- ar.what = ["J".charCodeAt(0)];
+ ar.what = defs.to_luastring("J", true);
} else {
let p = cl.p;
ar.source = p.source ? p.source.getstr() : defs.to_luastring("=?", true);
@@ -247,7 +247,7 @@ const auxgetinfo = function(L, what, ar, f, ci) {
case 'n': {
let r = getfuncname(L, ci);
if (r === null) {
- ar.namewhat = [];
+ ar.namewhat = defs.to_luastring("");
ar.name = null;
} else {
ar.namewhat = r.funcname;
@@ -314,7 +314,7 @@ const kname = function(p, pc, c) {
}
/* else no reasonable name found */
}
- r.name = [defs.char["?"]];
+ r.name = defs.to_luastring("?", true);
return r; /* no reasonable name found */
};
@@ -452,7 +452,7 @@ const funcnamefromcode = function(L, ci) {
let OCi = lopcodes.OpCodesI;
if (ci.callstatus & lstate.CIST_HOOKED) {
- r.name = [defs.char["?"]];
+ r.name = defs.to_luastring("?", true);
r.funcname = defs.to_luastring("hook", true);
return r;
}
@@ -578,7 +578,7 @@ const luaG_addinfo = function(L, msg, src, line) {
if (src)
buff = lobject.luaO_chunkid(src.getstr(), luaconf.LUA_IDSIZE);
else
- buff = ['?'.charCodeAt(0)];
+ buff = defs.to_luastring("?", true);
return lobject.luaO_pushfstring(L, defs.to_luastring("%s:%d: %s", true), buff, line, msg);
};