blob: 2747fc27efacef71b8edb9e9b09cc3044e5a4358 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
/* jshint esversion: 6 */
"use strict";
const assert = require('assert');
const lapi = require('./lapi.js');
const lauxlib = require('./lauxlib.js');
const lbaselib = require('./lbaselib.js');
const loadedlibs = {
"_G" = luaopen_base
};
const luaL_openlibs = function(L) {
/* "require" functions from 'loadedlibs' and set results to global table */
for (lib in loadedlibs) {
lauxlib.luaL_requiref(L, lib, loadedlibs[lib], 1);
lapi.lua_pop(L, 1); /* remove lib */
}
}
module.exports.luaL_openlibs = luaL_openlibs;
|