From 0447737eaa41565c8ffddbe3ec5650ce148c4be8 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 4 May 2017 11:21:40 +1000 Subject: package library doesn't need to be for just node --- src/linit.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/linit.js') diff --git a/src/linit.js b/src/linit.js index 13e60e3..6cc48b1 100644 --- a/src/linit.js +++ b/src/linit.js @@ -15,6 +15,7 @@ const loadlib = require('./loadlib.js'); const lualib = require('./lualib.js'); const loadedlibs = { + [lualib.LUA_LOADLIBNAME]: loadlib.luaopen_package, [lualib.LUA_COLIBNAME]: lcorolib.luaopen_coroutine, [lualib.LUA_DBLIBNAME]: ldblib.luaopen_debug, [lualib.LUA_MATHLIBNAME]: lmathlib.luaopen_math, @@ -26,19 +27,6 @@ const loadedlibs = { "_G": lbaselib.luaopen_base }; -// Only with Node -if (typeof require === "function") { - - let fs = false; - try { - fs = require('fs'); - } catch (e) {} - - if (fs) { - loadedlibs[lualib.LUA_LOADLIBNAME] = loadlib.luaopen_package; - } -} - const luaL_openlibs = function(L) { /* "require" functions from 'loadedlibs' and set results to global table */ for (let lib in loadedlibs) { -- cgit v1.2.3-54-g00ecf