aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-16 11:31:25 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-16 11:31:25 +0100
commite14d05a2c3994352c671d4d4af7194aa47967ca6 (patch)
treeb12a8d7d05e65e1ab54305d82bc9e0aba12af752 /src
parentebbcbf8484d74cfccd0b39abf661dbc14fd2dc5d (diff)
downloadfengari-e14d05a2c3994352c671d4d4af7194aa47967ca6.tar.gz
fengari-e14d05a2c3994352c671d4d4af7194aa47967ca6.tar.bz2
fengari-e14d05a2c3994352c671d4d4af7194aa47967ca6.zip
Fixed undefined nil constant
Diffstat (limited to 'src')
-rw-r--r--src/lvm.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lvm.js b/src/lvm.js
index f62e8f5..e2c78b3 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -18,7 +18,6 @@ const lstate = require('./lstate.js');
const CallInfo = lstate.CallInfo;
const llimit = require('./llimit.js');
const ldo = require('./ldo.js');
-const nil = ldo.nil;
const ltm = require('./ltm.js');
const ltable = require('./ltable.js');
const TMS = ltm.TMS;
@@ -94,7 +93,7 @@ const luaV_execute = function(L) {
}
case "OP_LOADNIL": {
for (let j = 0; j <= i.B; j++)
- L.stack[ra + j] = nil;
+ L.stack[ra + j] = ldo.nil;
break;
}
case "OP_GETUPVAL": {
@@ -634,7 +633,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] = nil;
+ L.stack[ra + j] = ldo.nil;
break;
}
case "OP_EXTRAARG": {
@@ -954,7 +953,7 @@ const luaV_finishget = function(L, t, key, val, slot, recur) {
assert(slot.ttisnil());
tm = ltm.luaT_gettmbyobj(L, t, TMS.TM_INDEX); // TODO: fasttm
if (tm.ttisnil()) {
- L.stack[val] = nil;
+ L.stack[val] = ldo.nil;
return;
}
}