summaryrefslogtreecommitdiff
path: root/src/linit.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-11 14:02:23 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-11 15:19:18 +1000
commite7cf17565e26dc5c4a100688526b0dfed1220e44 (patch)
treeee4606b23f9c62ecf0e6da20dcbf0472d5339fd9 /src/linit.js
parentbe3f9810115cbaded69be37ebc3d088ee252a225 (diff)
downloadfengari-e7cf17565e26dc5c4a100688526b0dfed1220e44.tar.gz
fengari-e7cf17565e26dc5c4a100688526b0dfed1220e44.tar.bz2
fengari-e7cf17565e26dc5c4a100688526b0dfed1220e44.zip
Move luaL_openlibs from lauxlib to lualib
Diffstat (limited to 'src/linit.js')
-rw-r--r--src/linit.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/linit.js b/src/linit.js
index 4139f20..90ad978 100644
--- a/src/linit.js
+++ b/src/linit.js
@@ -13,21 +13,21 @@ const loslib = require('./loslib.js');
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,
- [lualib.LUA_OSLIBNAME]: loslib.luaopen_os,
- [lualib.LUA_STRLIBNAME]: lstrlib.luaopen_string,
- [lualib.LUA_TABLIBNAME]: ltablib.luaopen_table,
- [lualib.LUA_UTF8LIBNAME]: lutf8lib.luaopen_utf8,
- "_G": lbaselib.luaopen_base
-};
+const luaL_openlibs = function(L) {
+ 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,
+ [lualib.LUA_OSLIBNAME]: loslib.luaopen_os,
+ [lualib.LUA_STRLIBNAME]: lstrlib.luaopen_string,
+ [lualib.LUA_TABLIBNAME]: ltablib.luaopen_table,
+ [lualib.LUA_UTF8LIBNAME]: lutf8lib.luaopen_utf8,
+ "_G": lbaselib.luaopen_base
+ };
-if (!WEB) loadedlibs[lualib.LUA_IOLIBNAME] = require('./liolib.js').luaopen_io;
+ if (!WEB) loadedlibs[lualib.LUA_IOLIBNAME] = require('./liolib.js').luaopen_io;
-const luaL_openlibs = function(L) {
/* "require" functions from 'loadedlibs' and set results to global table */
for (let lib in loadedlibs) {
lauxlib.luaL_requiref(L, lua.to_luastring(lib), loadedlibs[lib], 1);