summaryrefslogtreecommitdiff
path: root/src/ldo.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-13 11:35:50 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-13 11:35:50 +0100
commit4627bb4b5c3ccc8431fbba68a78efd50ebb13909 (patch)
tree5b9b0b8e344b3de27aeb5ac39db93225f58a6d61 /src/ldo.js
parent5895accf3297146d26a722e8ed6ac0658faa7f87 (diff)
downloadfengari-4627bb4b5c3ccc8431fbba68a78efd50ebb13909.tar.gz
fengari-4627bb4b5c3ccc8431fbba68a78efd50ebb13909.tar.bz2
fengari-4627bb4b5c3ccc8431fbba68a78efd50ebb13909.zip
JSHint
Diffstat (limited to 'src/ldo.js')
-rw-r--r--src/ldo.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/ldo.js b/src/ldo.js
index 85bd3d3..26a4a0f 100644
--- a/src/ldo.js
+++ b/src/ldo.js
@@ -21,10 +21,8 @@ const luaD_precall = function(L, off, nresults) {
switch(func.type) {
case CT.LUA_TCCL: // JS function ?
throw new Error("LUA_TCCL not implemeted yet");
- break;
case CT.LUA_TLCF: // still JS function ?
throw new Error("LUA_TLCF not implemeted yet");
- break;
case CT.LUA_TLCL: {
let p = func.p;
let n = L.top - off - 1;
@@ -63,7 +61,6 @@ const luaD_precall = function(L, off, nresults) {
ci.callstatus = lstate.CIST_LUA;
return false;
- break;
}
default:
tryfuncTM(L, off, func);
@@ -84,7 +81,7 @@ const moveresults = function(L, firstResult, res, nres, wanted) {
case 0:
break;
case 1: {
- if (nres == 0)
+ if (nres === 0)
firstResult = nil;
L.stack[res] = L.stack[firstResult];
break;
@@ -136,13 +133,13 @@ const adjust_varargs = function(L, p, actual) {
const tryfuncTM = function(L, off, func) {
let tm = ltm.luaT_gettmbyobj(L, func, TMS.TM_CALL);
if (!tm.ttisfunction(tm))
- throw new Error("__call metatable member is not a function") // TODO: luaG_typeerror
+ throw new Error("__call metatable member is not a function"); // TODO: luaG_typeerror
/* Open a hole inside the stack at 'func' */
- for (p = L.top; p > off; p--)
+ for (let p = L.top; p > off; p--)
L.stack[p] = L.stack[p-1];
L.top++; /* slot ensured by caller */
L.stack[off] = tm; /* tag method is the new function to be called */
-}
+};
module.exports = {
nil: nil,