diff options
author | Benoit Giannangeli <giann008@gmail.com> | 2017-03-24 16:40:29 +0100 |
---|---|---|
committer | Benoit Giannangeli <giann008@gmail.com> | 2017-03-24 16:40:29 +0100 |
commit | 7af8347dbb7a8c3a09d2aebccd5f96384a7c55c3 (patch) | |
tree | 174de728b42de05b68f8ad10d1b0efddf6c188e0 /src/lvm.js | |
parent | 12944ea4d52a330b8b015af296dbbdee3fb4abbd (diff) | |
download | fengari-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.js | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } } |