diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-22 23:19:22 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-23 00:52:02 +1000 |
commit | 128ae8cc451126ee7201de7efb6cc0c39fb1a2b4 (patch) | |
tree | bcda9fa49eca0aeb2859d0daf252ed01a121d9ce /src/lapi.js | |
parent | b525c305b524f5b3ffaba3187ccc828d332aa835 (diff) | |
download | fengari-128ae8cc451126ee7201de7efb6cc0c39fb1a2b4.tar.gz fengari-128ae8cc451126ee7201de7efb6cc0c39fb1a2b4.tar.bz2 fengari-128ae8cc451126ee7201de7efb6cc0c39fb1a2b4.zip |
Introduce luaO_tostring
Diffstat (limited to 'src/lapi.js')
-rw-r--r-- | src/lapi.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lapi.js b/src/lapi.js index f7ef82e..efc59aa 100644 --- a/src/lapi.js +++ b/src/lapi.js @@ -671,9 +671,9 @@ const lua_tolstring = function(L, idx) { if (!lvm.cvt2str(o)) { /* not convertible? */ return null; } + o = lobject.luaO_tostring(L, o); } - - return o.ttisstring() ? o.svalue() : defs.to_luastring(`${o.value}`); + return o.svalue(); }; const lua_tostring = lua_tolstring; @@ -685,9 +685,9 @@ const lua_toljsstring = function(L, idx) { if (!lvm.cvt2str(o)) { /* not convertible? */ return null; } + o = lobject.luaO_tostring(L, o); } - - return o.ttisstring() ? o.jsstring() : `${o.value}`; + return o.jsstring(); }; const lua_tojsstring = lua_toljsstring; |