diff options
author | Benoit Giannangeli <giann@users.noreply.github.com> | 2017-03-21 09:09:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-21 09:09:16 +0100 |
commit | 932875c87ab3f2ed2b676a98f273392661535f65 (patch) | |
tree | 505f463ecdd0b4be4f0ce3e6446183774d406783 /src/lauxlib.js | |
parent | 9ac1d380dd1da894c6317845ea3234124663714b (diff) | |
parent | 6bf508f234654b1b0c7afa04797601d14c150934 (diff) | |
download | fengari-932875c87ab3f2ed2b676a98f273392661535f65.tar.gz fengari-932875c87ab3f2ed2b676a98f273392661535f65.tar.bz2 fengari-932875c87ab3f2ed2b676a98f273392661535f65.zip |
Merge pull request #8 from giann/feature/match
Feature/match
Diffstat (limited to 'src/lauxlib.js')
-rw-r--r-- | src/lauxlib.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js index 3ee04a4..ac7ab00 100644 --- a/src/lauxlib.js +++ b/src/lauxlib.js @@ -215,8 +215,8 @@ const luaL_buffinitsize = function(L, B, sz) { return B; }; -const luaL_addlstring = function(B, s) { - B.b += s; +const luaL_addlstring = function(B, s, l) { + B.b += s.slice(0, l); }; const luaL_addstring = luaL_addlstring; @@ -299,10 +299,12 @@ const luaL_tolstring = function(L, idx) { } else { switch(lapi.lua_type(L, idx)) { case CT.LUA_TNUMBER: - case CT.LUA_TSTRING: case CT.LUA_TBOOLEAN: lapi.lua_pushstring(L, `${lapi.index2addr(L, idx).value}`); break; + case CT.LUA_TSTRING: + lapi.lua_pushstring(L, lapi.index2addr(L, idx).jsstring()); + break; case CT.LUA_TNIL: lapi.lua_pushstring(L, `nil`); break; |