diff options
author | Benoit Giannangeli <giann008@gmail.com> | 2017-03-29 14:39:57 +0200 |
---|---|---|
committer | Benoit Giannangeli <giann008@gmail.com> | 2017-03-30 09:57:53 +0200 |
commit | 456ab7b69f88859683c60cc2261e70d6dbadd8e8 (patch) | |
tree | 12baf4ae489e7afd4819ec94bc413c1c2a1db05d /src/lbaselib.js | |
parent | 2e5b595a2e04fe72555a565af4aae43560946473 (diff) | |
download | fengari-456ab7b69f88859683c60cc2261e70d6dbadd8e8.tar.gz fengari-456ab7b69f88859683c60cc2261e70d6dbadd8e8.tar.bz2 fengari-456ab7b69f88859683c60cc2261e70d6dbadd8e8.zip |
8-bit string internally tests
Lexing/Parsing is done on byte rather than js strings
Diffstat (limited to 'src/lbaselib.js')
-rw-r--r-- | src/lbaselib.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lbaselib.js b/src/lbaselib.js index 8420672..4d0fb9c 100644 --- a/src/lbaselib.js +++ b/src/lbaselib.js @@ -11,7 +11,7 @@ const TS = lua.thread_status; const luaB_print = function(L) { let n = lapi.lua_gettop(L); /* number of arguments */ - let str = ""; + let str = []; lapi.lua_getglobal(L, lua.to_luastring("tostring")); for (let i = 1; i <= n; i++) { @@ -201,7 +201,7 @@ const luaB_assert = function(L) { const luaB_select = function(L) { let n = lapi.lua_gettop(L); - if (lapi.lua_type(L, 1) === CT.LUA_TSTRING && lapi.lua_tostring(L, 1) === "#") { + if (lapi.lua_type(L, 1) === CT.LUA_TSTRING && lapi.lua_tostring(L, 1)[0] === "#".charCodeAt(0)) { lapi.lua_pushinteger(L, n - 1); return 1; } else { |