summaryrefslogtreecommitdiff
path: root/src/lua.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-24 12:01:42 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-24 12:09:49 +0200
commit656758c86ad929b07bb6422eb0f44cf9f2347aac (patch)
tree9463a52cfa7e49245054577804f1bd6dcaf22ff8 /src/lua.js
parentd15e00af0798783bdce5e27d2ab43de3ecb3fa4e (diff)
downloadfengari-656758c86ad929b07bb6422eb0f44cf9f2347aac.tar.gz
fengari-656758c86ad929b07bb6422eb0f44cf9f2347aac.tar.bz2
fengari-656758c86ad929b07bb6422eb0f44cf9f2347aac.zip
Use maximum 32bit number instead of Number.MAX_SAFE_INTEGER
Diffstat (limited to 'src/lua.js')
-rw-r--r--src/lua.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lua.js b/src/lua.js
index 5175bfb..e1366b0 100644
--- a/src/lua.js
+++ b/src/lua.js
@@ -3,6 +3,7 @@
const assert = require('assert');
const luaconf = require('./luaconf.js');
+const llimit = require('./llimit.js');
// To avoid charCodeAt everywhere
const char = [];
@@ -150,7 +151,7 @@ const to_luastring = function(str, cache, maxBytesToWrite) {
if (Array.isArray(cached)) return cached;
}
- maxBytesToWrite = maxBytesToWrite !== undefined ? maxBytesToWrite : Number.MAX_SAFE_INTEGER;
+ maxBytesToWrite = maxBytesToWrite !== undefined ? maxBytesToWrite : llimit.MAX_INT;
let outU8Array = [];
if (!(maxBytesToWrite > 0)) // Parameter maxBytesToWrite is not optional. Negative values, 0, null, undefined and false each don't write out any bytes.