From d28bfe3d7e489f036ac3b336ecfd7b5d1bf7b0c9 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 22 Jan 2018 15:15:10 +1100 Subject: src/linit.js: Use destructuring requires --- src/linit.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/linit.js b/src/linit.js index 5656bae..f717767 100644 --- a/src/linit.js +++ b/src/linit.js @@ -1,8 +1,9 @@ "use strict"; -const lua = require('./lua.js'); -const lauxlib = require('./lauxlib.js'); -const {to_luastring} = require("./fengaricore.js"); +const { lua_pop } = require('./lua.js'); +const { luaL_requiref } = require('./lauxlib.js'); +const lualib = require('./lualib.js'); +const { to_luastring } = require("./fengaricore.js"); const lbaselib = require('./lbaselib.js'); const lcorolib = require('./lcorolib.js'); @@ -13,7 +14,6 @@ const lutf8lib = require('./lutf8lib.js'); const ldblib = require('./ldblib.js'); const loslib = require('./loslib.js'); const loadlib = require('./loadlib.js'); -const lualib = require('./lualib.js'); const luaL_openlibs = function(L) { const loadedlibs = { @@ -32,8 +32,8 @@ const luaL_openlibs = function(L) { /* "require" functions from 'loadedlibs' and set results to global table */ for (let lib in loadedlibs) { - lauxlib.luaL_requiref(L, to_luastring(lib), loadedlibs[lib], 1); - lua.lua_pop(L, 1); /* remove lib */ + luaL_requiref(L, to_luastring(lib), loadedlibs[lib], 1); + lua_pop(L, 1); /* remove lib */ } }; -- cgit v1.2.3-70-g09d2