diff options
author | daurnimator <quae@daurnimator.com> | 2018-01-29 22:11:27 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2018-01-29 22:11:27 +1100 |
commit | 60822ab541cecf4a4507b9b195e9eb587d56c209 (patch) | |
tree | d1d7ef72a1af4c478ced0736280f888622c7d859 /src/lfunc.js | |
parent | 00a65a21e391c715b5571347231c1d0ec24c08d7 (diff) | |
download | fengari-60822ab541cecf4a4507b9b195e9eb587d56c209.tar.gz fengari-60822ab541cecf4a4507b9b195e9eb587d56c209.tar.bz2 fengari-60822ab541cecf4a4507b9b195e9eb587d56c209.zip |
src/lfunc.js: style
Diffstat (limited to 'src/lfunc.js')
-rw-r--r-- | src/lfunc.js | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/lfunc.js b/src/lfunc.js index 198c4b9..9290f4b 100644 --- a/src/lfunc.js +++ b/src/lfunc.js @@ -4,7 +4,6 @@ const { constant_types: { LUA_TNIL } } = require('./defs.js'); const lobject = require('./lobject.js'); class Proto { - constructor(L) { this.id = L.l_G.id_counter++; this.k = []; // constants used by the function @@ -21,12 +20,10 @@ class Proto { this.lastlinedefined = 0; // debug information this.source = null; // used for debug information } - } const luaF_newLclosure = function(L, n) { - let c = new lobject.LClosure(L, n); - return c; + return new lobject.LClosure(L, n); }; @@ -47,9 +44,8 @@ const luaF_close = function(L, level) { ** fill a closure with new upvalues */ const luaF_initupvals = function(L, cl) { - for (let i = 0; i < cl.nupvalues; i++) { + for (let i = 0; i < cl.nupvalues; i++) cl.upvals[i] = new lobject.TValue(LUA_TNIL, null); - } }; /* @@ -67,7 +63,6 @@ const luaF_getlocalname = function(f, local_number, pc) { return null; /* not found */ }; - module.exports.MAXUPVAL = 255; module.exports.Proto = Proto; module.exports.luaF_findupval = luaF_findupval; |