diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-08 15:41:19 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-08 16:07:38 +1000 |
commit | e67fb5f4cb51fbf4061ab647ef08ef4893b7f0e4 (patch) | |
tree | f42bc3854fe31ec86324dd55725d1d3ff963cf2e /src/lapi.js | |
parent | 41ad8917ca15b275c8aca20f6e3907a08ae7ad15 (diff) | |
download | fengari-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.js | 4 |
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: |