aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lauxlib.js3
-rw-r--r--src/lcorolib.js3
-rw-r--r--src/lua.js7
3 files changed, 7 insertions, 6 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js
index 7b5f958..055abcd 100644
--- a/src/lauxlib.js
+++ b/src/lauxlib.js
@@ -3,7 +3,6 @@
const assert = require('assert');
-const lstate = require('./lstate.js');
const lapi = require('./lapi.js');
const lua = require('./lua.js');
const ldebug = require('./ldebug.js');
@@ -202,7 +201,7 @@ const tag_error = function(L, arg, tag) {
};
const luaL_newstate = function() {
- let L = lstate.lua_newstate();
+ let L = lua.lua_newstate();
if (L) lua.lua_atpanic(L, panic);
return L;
};
diff --git a/src/lcorolib.js b/src/lcorolib.js
index 9c05e40..baf7254 100644
--- a/src/lcorolib.js
+++ b/src/lcorolib.js
@@ -4,7 +4,6 @@ const assert = require('assert');
const lua = require('./lua.js');
const lauxlib = require('./lauxlib.js');
-const lstate = require('./lstate.js');
const ldo = require('./ldo.js');
const ldebug = require('./ldebug.js');
const lobject = require('./lobject.js');
@@ -76,7 +75,7 @@ const luaB_auxwrap = function(L) {
const luaB_cocreate = function(L) {
lauxlib.luaL_checktype(L, 1, lua.LUA_TFUNCTION);
- let NL = lstate.lua_newthread(L);
+ let NL = lua.lua_newthread(L);
lua.lua_pushvalue(L, 1); /* move function to top */
lua.lua_xmove(L, NL, 1); /* move function from L to NL */
return 1;
diff --git a/src/lua.js b/src/lua.js
index e15654e..13eef9a 100644
--- a/src/lua.js
+++ b/src/lua.js
@@ -1,8 +1,9 @@
/*jshint esversion: 6 */
"use strict";
-const defs = require("./defs.js");
-const lapi = require("./lapi.js");
+const defs = require("./defs.js");
+const lapi = require("./lapi.js");
+const lstate = require("./lstate.js");
module.exports.FENGARI_AUTHORS = defs.FENGARI_AUTHORS;
module.exports.FENGARI_COPYRIGHT = defs.FENGARI_COPYRIGHT;
@@ -115,6 +116,8 @@ module.exports.lua_isuserdata = lapi.lua_isuserdata;
module.exports.lua_len = lapi.lua_len;
module.exports.lua_load = lapi.lua_load;
module.exports.lua_newtable = lapi.lua_newtable;
+module.exports.lua_newstate = lstate.lua_newstate;
+module.exports.lua_newthread = lstate.lua_newthread;
module.exports.lua_newuserdata = lapi.lua_newuserdata;
module.exports.lua_next = lapi.lua_next;
module.exports.lua_pcall = lapi.lua_pcall;