summaryrefslogtreecommitdiff
path: root/src/lapi.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-24 15:00:52 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-24 15:00:52 +0200
commitb9f9cde1c18ace3930be4cb7f6d9527178544d8b (patch)
tree366aff341c05bcc8115b97bec042f51776d4a138 /src/lapi.js
parent656758c86ad929b07bb6422eb0f44cf9f2347aac (diff)
downloadfengari-b9f9cde1c18ace3930be4cb7f6d9527178544d8b.tar.gz
fengari-b9f9cde1c18ace3930be4cb7f6d9527178544d8b.tar.bz2
fengari-b9f9cde1c18ace3930be4cb7f6d9527178544d8b.zip
Force 32bit integer with |0
Diffstat (limited to 'src/lapi.js')
-rw-r--r--src/lapi.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lapi.js b/src/lapi.js
index 0231597..51b869f 100644
--- a/src/lapi.js
+++ b/src/lapi.js
@@ -213,7 +213,7 @@ const lua_pushnumber = function(L, n) {
const lua_pushinteger = function(L, n) {
assert(typeof n === "number");
- L.stack[L.top++] = new TValue(CT.LUA_TNUMINT, n);
+ L.stack[L.top++] = new TValue(CT.LUA_TNUMINT, n|0);
assert(L.top <= L.ci.top, "stack overflow");
};
@@ -726,7 +726,6 @@ const lua_stringtonumber = function(L, s) {
return s.length;
};
-// TODO: pisnum
const lua_tointegerx = function(L, idx) {
return lvm.tointeger(index2addr(L, idx));
};