From 4627bb4b5c3ccc8431fbba68a78efd50ebb13909 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Mon, 13 Feb 2017 11:35:50 +0100 Subject: JSHint --- src/ldo.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/ldo.js') 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, -- cgit v1.2.3-54-g00ecf