aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-02-04 19:27:56 -0800
committerdaurnimator <quae@daurnimator.com>2018-02-04 19:37:12 -0800
commit662e326db5e44859bb92242d6dc27e386fb621ec (patch)
tree6902da0dba2b3fe8522d1ff3228007474a2c1106 /src
parent6cbf92d30fe7eb24fa5e2a93bfe432c081a7e51f (diff)
downloadfengari-662e326db5e44859bb92242d6dc27e386fb621ec.tar.gz
fengari-662e326db5e44859bb92242d6dc27e386fb621ec.tar.bz2
fengari-662e326db5e44859bb92242d6dc27e386fb621ec.zip
src/{luaconf,lauxlib}.js: LUAL_BUFFERSIZE should be defined in luaconf
Diffstat (limited to 'src')
-rw-r--r--src/lauxlib.js5
-rw-r--r--src/luaconf.js6
2 files changed, 9 insertions, 2 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js
index 15d8dab..3dfc072 100644
--- a/src/lauxlib.js
+++ b/src/lauxlib.js
@@ -1,6 +1,9 @@
"use strict";
const {
+ LUAL_BUFFERSIZE
+} = require('./luaconf.js');
+const {
LUA_ERRERR,
LUA_MULTRET,
LUA_REGISTRYINDEX,
@@ -471,8 +474,6 @@ const luaL_buffinitsize = function(L, B, sz) {
return luaL_prepbuffsize(B, sz);
};
-const LUAL_BUFFERSIZE = 8192;
-
const luaL_prepbuffer = function(B) {
return luaL_prepbuffsize(B, LUAL_BUFFERSIZE);
};
diff --git a/src/luaconf.js b/src/luaconf.js
index 533e316..9e0d571 100644
--- a/src/luaconf.js
+++ b/src/luaconf.js
@@ -45,6 +45,11 @@ const luai_apicheck = function(l, e) {
if (!e) throw Error(e);
};
+/*
+@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
+*/
+const LUAL_BUFFERSIZE = 8192;
+
// See: http://croquetweak.blogspot.fr/2014/08/deconstructing-floats-frexp-and-ldexp.html
const frexp = function(value) {
if (value === 0) return [value, 0];
@@ -76,6 +81,7 @@ module.exports.LUA_MAXINTEGER = LUA_MAXINTEGER;
module.exports.LUA_MININTEGER = LUA_MININTEGER;
module.exports.LUA_NUMBER_FMT = LUA_NUMBER_FMT;
module.exports.LUA_NUMBER_FRMLEN = LUA_NUMBER_FRMLEN;
+module.exports.LUAL_BUFFERSIZE = LUAL_BUFFERSIZE;
module.exports.frexp = frexp;
module.exports.ldexp = ldexp;
module.exports.lua_getlocaledecpoint = lua_getlocaledecpoint;