summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lparser.js4
-rw-r--r--src/lundump.js2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/lparser.js b/src/lparser.js
index f0f1d87..566576a 100644
--- a/src/lparser.js
+++ b/src/lparser.js
@@ -504,8 +504,8 @@ const undefgoto = function(ls, gt) {
** adds a new prototype into list of prototypes
*/
const addprototype = function(ls) {
- let clp = new Proto();
let L = ls.L;
+ let clp = new Proto(L);
let fs = ls.fs;
let f = fs.f; /* prototype of current function */
f.p[fs.np++] = clp;
@@ -536,7 +536,7 @@ const open_func = function(ls, fs, bl) {
fs.nactvar = 0;
fs.firstlocal = ls.dyd.actvar.n;
fs.bl = null;
- let f = new Proto();
+ let f = new Proto(ls.L);
f = fs.f;
f.source = ls.source;
f.maxstacksize = 2; /* registers 0/1 are always valid */
diff --git a/src/lundump.js b/src/lundump.js
index 5d158bd..541adbb 100644
--- a/src/lundump.js
+++ b/src/lundump.js
@@ -285,7 +285,7 @@ class BytecodeParser {
this.L.stack[this.L.top] = new lobject.TValue(defs.CT.LUA_TLCL, cl);
this.L.top++;
- cl.p = new lfunc.Proto();
+ cl.p = new lfunc.Proto(this.L);
this.readFunction(cl.p);