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/lapi.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/lapi.js')
-rw-r--r-- | src/lapi.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lapi.js b/src/lapi.js index 6e1471d..e7fbf4f 100644 --- a/src/lapi.js +++ b/src/lapi.js @@ -678,7 +678,7 @@ const lua_compare_ = function(L, o1, o2, op) { }; const lua_stringtonumber = function(L, s) { - let number = parseFloat(s); + let number = parseFloat(lobject.jsstring(s)); L.stack[L.top++] = new TValue(number % 1 !== 0 ? CT.LUA_TNUMFLT : CT.LUA_TNUMINT, number); assert(L.top <= L.ci.top, "stack overflow"); return s.length; @@ -980,6 +980,8 @@ module.exports.lua_toboolean = lua_toboolean; module.exports.lua_todataview = lua_todataview; module.exports.lua_tointeger = lua_tointeger; module.exports.lua_tointegerx = lua_tointegerx; +module.exports.lua_tojsstring = lua_tojsstring; +module.exports.lua_toljsstring = lua_toljsstring; module.exports.lua_tolstring = lua_tolstring; module.exports.lua_tonumber = lua_tonumber; module.exports.lua_topointer = lua_topointer; |