summaryrefslogtreecommitdiff
path: root/src/lauxlib.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-21 08:38:41 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-21 09:03:37 +0100
commit66292a6a85cf22cae31520ea4d08c76f544e338a (patch)
tree3a0c53434a4008359d8d7c9f4bffc93f32b7a9c4 /src/lauxlib.js
parent2cc93b924a21030fcd6f5dc96f287bbf13f987f4 (diff)
downloadfengari-66292a6a85cf22cae31520ea4d08c76f544e338a.tar.gz
fengari-66292a6a85cf22cae31520ea4d08c76f544e338a.tar.bz2
fengari-66292a6a85cf22cae31520ea4d08c76f544e338a.zip
string.gsub tests
Diffstat (limited to 'src/lauxlib.js')
-rw-r--r--src/lauxlib.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js
index 879d081..ac7ab00 100644
--- a/src/lauxlib.js
+++ b/src/lauxlib.js
@@ -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;