From 7af8347dbb7a8c3a09d2aebccd5f96384a7c55c3 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Fri, 24 Mar 2017 16:40:29 +0100 Subject: Proper use of luaO_nilobject --- src/lvm.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lvm.js') 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; } } -- cgit v1.2.3-54-g00ecf