From e67fb5f4cb51fbf4061ab647ef08ef4893b7f0e4 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 8 May 2017 15:41:19 +1000 Subject: Add accessors to TValue for TString values --- src/lapi.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lapi.js') 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: -- cgit v1.2.3-54-g00ecf