From 735bc392056f7c55c981b68feb941bf1cc5a8ff3 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 3 May 2017 19:16:16 +1000 Subject: Pipe | has higher precedence than equals --- src/ldo.js | 2 +- src/ltable.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ldo.js b/src/ldo.js index 1e9d355..c762798 100644 --- a/src/ldo.js +++ b/src/ldo.js @@ -77,7 +77,7 @@ const luaD_precall = function(L, off, nresults) { luaD_hook(L, defs.LUA_HOOKCALL, -1); let n = f(L); /* do the actual call */ - assert(typeof n == "number" && n >= 0 && n==n|0, "invalid return value from JS function (expected integer)"); + assert(typeof n == "number" && n >= 0 && (n|0) === n, "invalid return value from JS function (expected integer)"); assert(n < L.top - L.ci.funcOff, "not enough elements in the stack"); luaD_poscall(L, ci, L.top - n, n); diff --git a/src/ltable.js b/src/ltable.js index 874a9f0..d6fffe9 100644 --- a/src/ltable.js +++ b/src/ltable.js @@ -79,7 +79,7 @@ const setgeneric = function(t, hash, key) { }; const luaH_setint = function(t, key, value) { - assert(typeof key == "number" && value instanceof lobject.TValue && key|0 === key); + assert(typeof key == "number" && value instanceof lobject.TValue && (key|0) === key); let hash = key; /* table_hash known result */ let v = t.strong.get(hash); if (v) { -- cgit v1.2.3-54-g00ecf