mirror of
https://github.com/lune-org/lune.git
synced 2025-03-13 15:24:32 +00:00
Add back _G table
This commit is contained in:
parent
b69f824b57
commit
2762a43dbb
2 changed files with 7 additions and 0 deletions
5
src/lune/globals/g_table.rs
Normal file
5
src/lune/globals/g_table.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
use mlua::prelude::*;
|
||||
|
||||
pub fn create(lua: &'static Lua) -> LuaResult<impl IntoLua<'_>> {
|
||||
lua.create_table()
|
||||
}
|
|
@ -2,10 +2,12 @@ use mlua::prelude::*;
|
|||
|
||||
use super::util::TableBuilder;
|
||||
|
||||
mod g_table;
|
||||
mod require;
|
||||
|
||||
pub fn inject_all(lua: &'static Lua) -> LuaResult<()> {
|
||||
let all = TableBuilder::new(lua)?
|
||||
.with_value("_G", g_table::create(lua)?)?
|
||||
.with_value("require", require::create(lua)?)?
|
||||
.build_readonly()?;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue