From f10d343878d3794deee5eb15db99094bfc9d98d6 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 18 Jan 2018 06:29:34 +1100 Subject: src/lobject.js: Use destructuring assignment for llimits.js --- src/lobject.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lobject.js b/src/lobject.js index ec4a9b3..6516d72 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -12,7 +12,10 @@ const lstring = require('./lstring.js'); const ltable = require('./ltable.js'); const luaconf = require('./luaconf.js'); const lvm = require('./lvm.js'); -const llimits = require('./llimits.js'); +const { + MAX_INT, + luai_nummod +} = require("./llimits.js"); const ltm = require('./ltm.js'); const CT = defs.constant_types; const char = defs.char; @@ -470,8 +473,8 @@ const l_str2d = function(s) { return end; }; -const MAXBY10 = Math.floor(llimits.MAX_INT / 10); -const MAXLASTD = llimits.MAX_INT % 10; +const MAXBY10 = Math.floor(MAX_INT / 10); +const MAXLASTD = MAX_INT % 10; const l_str2int = function(s) { let i = 0; @@ -691,7 +694,7 @@ const numarith = function(L, op, v1, v2) { case defs.LUA_OPPOW: return Math.pow(v1, v2); case defs.LUA_OPIDIV: return Math.floor(v1 / v2); case defs.LUA_OPUNM: return -v1; - case defs.LUA_OPMOD: return llimits.luai_nummod(L, v1, v2); + case defs.LUA_OPMOD: return luai_nummod(L, v1, v2); default: assert(0); } }; -- cgit v1.2.3-70-g09d2