summaryrefslogtreecommitdiff
path: root/src/lvm.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/lvm.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/lvm.js')
-rw-r--r--src/lvm.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lvm.js b/src/lvm.js
index ef5d370..8bfef40 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -9,6 +9,7 @@ const luaconf = require('./luaconf.js');
const lobject = require('./lobject.js');
const lfunc = require('./lfunc.js');
const lstate = require('./lstate.js');
+const lstring = require('./lstring.js');
const llimit = require('./llimit.js');
const ldo = require('./ldo.js');
const ltm = require('./ltm.js');
@@ -991,7 +992,7 @@ const tostring = function(L, i) {
if (o.ttisstring()) return true;
if (o.ttisnumber() && !isNaN(o.value)) {
- L.stack[i] = L.l_G.intern(defs.to_luastring(`${o.value}`));
+ L.stack[i] = new lobject.TValue(CT.LUA_TLNGSTR, lstring.luaS_bless(L, defs.to_luastring(`${o.value}`)));
return true;
}
@@ -1029,7 +1030,7 @@ const luaV_concat = function(L, total) {
ts = ts.concat(L.stack[top - i].value);
}
- L.stack[top - n] = L.l_G.intern(ts);
+ L.stack[top - n] = new lobject.TValue(CT.LUA_TLNGSTR, lstring.luaS_bless(L, ts));
}
total -= n - 1; /* got 'n' strings to create 1 new */
L.top -= n - 1; /* popped 'n' strings and pushed one */