summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-01-18 06:29:34 +1100
committerdaurnimator <quae@daurnimator.com>2018-01-18 07:08:05 +1100
commitf10d343878d3794deee5eb15db99094bfc9d98d6 (patch)
tree18f0c2707256915731474d1d79d5c008c7dfd396 /src
parent8b2e057418463d10a757ad151f5104301a4cd7e9 (diff)
downloadfengari-f10d343878d3794deee5eb15db99094bfc9d98d6.tar.gz
fengari-f10d343878d3794deee5eb15db99094bfc9d98d6.tar.bz2
fengari-f10d343878d3794deee5eb15db99094bfc9d98d6.zip
src/lobject.js: Use destructuring assignment for llimits.js
Diffstat (limited to 'src')
-rw-r--r--src/lobject.js11
1 files 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);
}
};