aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-03 19:06:36 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-03 19:06:36 +1000
commit4cf090d7ede6aa3153ad912c580cfb07b1e60a9d (patch)
treededecdebe2577103764331fe0367cfd1bfbb95df /src
parent4531d2c6485f1bda6243949adadbdec04fd2e22d (diff)
downloadfengari-4cf090d7ede6aa3153ad912c580cfb07b1e60a9d.tar.gz
fengari-4cf090d7ede6aa3153ad912c580cfb07b1e60a9d.tar.bz2
fengari-4cf090d7ede6aa3153ad912c580cfb07b1e60a9d.zip
luaL_Buffer constructor shouldn't take a lua state
It gets set in luaL_buffinit
Diffstat (limited to 'src')
-rw-r--r--src/lauxlib.js4
-rw-r--r--src/lstrlib.js2
-rw-r--r--src/ltablib.js2
-rw-r--r--src/lutf8lib.js2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js
index 0491de5..b020d04 100644
--- a/src/lauxlib.js
+++ b/src/lauxlib.js
@@ -10,8 +10,8 @@ const LUA_FILEHANDLE = lua.to_luastring("FILE*", true);
class luaL_Buffer {
- constructor(L) {
- this.L = L;
+ constructor() {
+ this.L = null;
this.b = "";
}
}
diff --git a/src/lstrlib.js b/src/lstrlib.js
index 6121804..b5f235f 100644
--- a/src/lstrlib.js
+++ b/src/lstrlib.js
@@ -1333,7 +1333,7 @@ const str_gsub = function(L) {
let anchor = p[0] === '^'.charCodeAt(0);
let n = 0; /* replacement count */
let ms = new MatchState(L);
- let b = new lauxlib.luaL_Buffer(L);
+ let b = new lauxlib.luaL_Buffer();
lauxlib.luaL_argcheck(L, tr === lua.LUA_TNUMBER || tr === lua.LUA_TSTRING || tr === lua.LUA_TFUNCTION || tr === lua.LUA_TTABLE, 3,
lua.to_luastring("string/function/table expected", true));
lauxlib.luaL_buffinit(L, b);
diff --git a/src/ltablib.js b/src/ltablib.js
index 57cff9d..56ba2cd 100644
--- a/src/ltablib.js
+++ b/src/ltablib.js
@@ -133,7 +133,7 @@ const tconcat = function(L) {
let i = lauxlib.luaL_optinteger(L, 3, 1);
last = lauxlib.luaL_optinteger(L, 4, last);
- let b = new lauxlib.luaL_Buffer(L);
+ let b = new lauxlib.luaL_Buffer();
lauxlib.luaL_buffinit(L, b);
for (; i < last; i++) {
diff --git a/src/lutf8lib.js b/src/lutf8lib.js
index e78b8e8..9e0302f 100644
--- a/src/lutf8lib.js
+++ b/src/lutf8lib.js
@@ -96,7 +96,7 @@ const utfchar = function(L) {
if (n === 1) /* optimize common case of single char */
pushutfchar(L, 1);
else {
- let b = new lauxlib.luaL_Buffer(L);
+ let b = new lauxlib.luaL_Buffer();
lauxlib.luaL_buffinit(L, b);
for (let i = 1; i <= n; i++) {
pushutfchar(L, i);