From 60822ab541cecf4a4507b9b195e9eb587d56c209 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 29 Jan 2018 22:11:27 +1100 Subject: src/lfunc.js: style --- src/lfunc.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/lfunc.js') 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; -- cgit v1.2.3-54-g00ecf