From 6fdfa3b88c043b124eca4f91c4d1e7e3cc7046b2 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 26 Apr 2017 21:47:54 +1000 Subject: Export luaL_openlibs from lauxlib.js --- src/lauxlib.js | 2 ++ src/linit.js | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lauxlib.js b/src/lauxlib.js index 8bf9a37..7d48e11 100644 --- a/src/lauxlib.js +++ b/src/lauxlib.js @@ -4,6 +4,7 @@ const lapi = require('./lapi.js'); const lua = require('./lua.js'); const lobject = require('./lobject.js'); +const linit = require('./linit.js'); const LUA_LOADED_TABLE = "_LOADED"; @@ -725,6 +726,7 @@ module.exports.luaL_loadstring = luaL_loadstring; module.exports.luaL_newlib = luaL_newlib; module.exports.luaL_newmetatable = luaL_newmetatable; module.exports.luaL_newstate = luaL_newstate; +module.exports.luaL_openlibs = linit.luaL_openlibs; module.exports.luaL_opt = luaL_opt; module.exports.luaL_optinteger = luaL_optinteger; module.exports.luaL_optlstring = luaL_optlstring; diff --git a/src/linit.js b/src/linit.js index 925b55a..325dfa1 100644 --- a/src/linit.js +++ b/src/linit.js @@ -1,7 +1,6 @@ "use strict"; const lua = require('./lua.js'); -const lapi = require('./lapi.js'); const lauxlib = require('./lauxlib.js'); const lbaselib = require('./lbaselib.js'); const lcorolib = require('./lcorolib.js'); @@ -30,7 +29,7 @@ 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); - lapi.lua_pop(L, 1); /* remove lib */ + lua.lua_pop(L, 1); /* remove lib */ } }; -- cgit v1.2.3-70-g09d2