summaryrefslogtreecommitdiff
path: root/src/lvm.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-03-24 16:40:29 +0100
committerBenoit Giannangeli <giann008@gmail.com>2017-03-24 16:40:29 +0100
commit7af8347dbb7a8c3a09d2aebccd5f96384a7c55c3 (patch)
tree174de728b42de05b68f8ad10d1b0efddf6c188e0 /src/lvm.js
parent12944ea4d52a330b8b015af296dbbdee3fb4abbd (diff)
downloadfengari-7af8347dbb7a8c3a09d2aebccd5f96384a7c55c3.tar.gz
fengari-7af8347dbb7a8c3a09d2aebccd5f96384a7c55c3.tar.bz2
fengari-7af8347dbb7a8c3a09d2aebccd5f96384a7c55c3.zip
Proper use of luaO_nilobject
Diffstat (limited to 'src/lvm.js')
-rw-r--r--src/lvm.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lvm.js b/src/lvm.js
index c5628cf..53e1584 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -154,7 +154,7 @@ const luaV_execute = function(L) {
}
case "OP_LOADNIL": {
for (let j = 0; j <= i.B; j++)
- L.stack[ra + j] = ldo.nil;
+ L.stack[ra + j] = new TValue(CT.LUA_TNIL, null);
break;
}
case "OP_GETUPVAL": {
@@ -694,7 +694,7 @@ const luaV_execute = function(L) {
L.stack[ra + j] = L.stack[base - n + j];
for (; j < b; j++) /* complete required results with nil */
- L.stack[ra + j] = ldo.nil;
+ L.stack[ra + j] = new TValue(CT.LUA_TNIL, null);
break;
}
case "OP_EXTRAARG": {
@@ -1068,7 +1068,7 @@ const luaV_finishget = function(L, t, key, val, slot, recur) {
assert(slot.ttisnil());
tm = ltm.luaT_gettmbyobj(L, t, ltm.TMS.TM_INDEX); // TODO: fasttm
if (tm.ttisnil()) {
- L.stack[val] = ldo.nil;
+ L.stack[val] = new TValue(CT.LUA_TNIL, null);
return;
}
}