aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-11-12 16:04:41 +1100
committerdaurnimator <quae@daurnimator.com>2017-11-12 16:22:32 +1100
commit94a6480244bb874e802a61eb0acf6b87a3046494 (patch)
tree76bf1aaad54c4c341000c94e95f1cfefbe49d586
parent5812c42e7bb680592e60454b003f228dfe95869a (diff)
downloadfengari-94a6480244bb874e802a61eb0acf6b87a3046494.tar.gz
fengari-94a6480244bb874e802a61eb0acf6b87a3046494.tar.bz2
fengari-94a6480244bb874e802a61eb0acf6b87a3046494.zip
src/ldebug.js: Remove use of fallible defs.to_jsstring call
-rw-r--r--src/ldebug.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ldebug.js b/src/ldebug.js
index 59520c3..e5265e4 100644
--- a/src/ldebug.js
+++ b/src/ldebug.js
@@ -5,6 +5,7 @@ const assert = require('assert');
const defs = require('./defs.js');
const ldo = require('./ldo.js');
const lfunc = require('./lfunc.js');
+const llex = require('./llex.js');
const lobject = require('./lobject.js');
const lopcodes = require('./lopcodes.js');
const lstate = require('./lstate.js');
@@ -401,7 +402,7 @@ const getobjname = function(p, lastpc, reg) {
let t = i.B; /* table index */
let vn = i.opcode === OCi.OP_GETTABLE ? lfunc.luaF_getlocalname(p, t + 1, pc) : upvalname(p, t);
r.name = kname(p, pc, k).name;
- r.funcname = vn && defs.to_jsstring(vn) === "_ENV" ? defs.to_luastring("global", true) : defs.to_luastring("field", true);
+ r.funcname = (vn && defs.luastring_cmp(vn, llex.LUA_ENV)) ? defs.to_luastring("global", true) : defs.to_luastring("field", true);
return r;
}
case OCi.OP_GETUPVAL: {