summaryrefslogtreecommitdiff
path: root/src/lcode.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-08 12:32:08 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-08 15:31:29 +1000
commit2977fe002407b6f86efa4ba5216f567082f33e45 (patch)
treeda7e0127cd26534d01655e7b6a5c8732fb4920a0 /src/lcode.js
parent8c8585a0bba0e05b6382f2f4f063515b5988639c (diff)
downloadfengari-2977fe002407b6f86efa4ba5216f567082f33e45.tar.gz
fengari-2977fe002407b6f86efa4ba5216f567082f33e45.tar.bz2
fengari-2977fe002407b6f86efa4ba5216f567082f33e45.zip
Move string functions to centralised lstring.js
Diffstat (limited to 'src/lcode.js')
-rw-r--r--src/lcode.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lcode.js b/src/lcode.js
index fac7d37..814498c 100644
--- a/src/lcode.js
+++ b/src/lcode.js
@@ -7,6 +7,7 @@ const llex = require('./llex.js');
const lobject = require('./lobject.js');
const lopcode = require('./lopcodes.js');
const lparser = require('./lparser.js');
+const lstring = require('./lstring.js');
const ltable = require('./ltable.js');
require('./lstate.js'); /* XXX: if this isn't here then things break on require("ltm") */
const ltm = require('./ltm.js');
@@ -514,7 +515,7 @@ const luaK_stringK = function(fs, s) {
*/
const luaK_intK = function(fs, n) {
/* FIXME: shouldn't use string as key. need to use pointer */
- let k = new TValue(CT.LUA_TLNGSTR, defs.to_luastring(`${n}`));
+ let k = new TValue(CT.LUA_TLNGSTR, lstring.luaS_bless(fs.L, defs.to_luastring(`${n}`)));
let o = new TValue(CT.LUA_TNUMINT, n);
return addk(fs, k, o);
};