summaryrefslogtreecommitdiff
path: root/src/lapi.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-08 15:41:19 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-08 16:07:38 +1000
commite67fb5f4cb51fbf4061ab647ef08ef4893b7f0e4 (patch)
treef42bc3854fe31ec86324dd55725d1d3ff963cf2e /src/lapi.js
parent41ad8917ca15b275c8aca20f6e3907a08ae7ad15 (diff)
downloadfengari-e67fb5f4cb51fbf4061ab647ef08ef4893b7f0e4.tar.gz
fengari-e67fb5f4cb51fbf4061ab647ef08ef4893b7f0e4.tar.bz2
fengari-e67fb5f4cb51fbf4061ab647ef08ef4893b7f0e4.zip
Add accessors to TValue for TString values
Diffstat (limited to 'src/lapi.js')
-rw-r--r--src/lapi.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lapi.js b/src/lapi.js
index fa6da20..64cb4e1 100644
--- a/src/lapi.js
+++ b/src/lapi.js
@@ -624,7 +624,7 @@ const lua_tolstring = function(L, idx) {
if ((!o.ttisstring() && !o.ttisnumber()))
return null;
- return o.ttisstring() ? o.value : defs.to_luastring(`${o.value}`);
+ return o.ttisstring() ? o.svalue() : defs.to_luastring(`${o.value}`);
};
const lua_tostring = lua_tolstring;
@@ -658,7 +658,7 @@ const lua_rawlen = function(L, idx) {
switch (o.ttype()) {
case CT.LUA_TSHRSTR:
case CT.LUA_TLNGSTR:
- return o.value.length;
+ return o.vslen();
case CT.LUA_TUSERDATA:
return o.len;
case CT.LUA_TTABLE: