diff options
author | Jonas Schievink <jonasschievink@gmail.com> | 2017-09-16 14:05:26 +0200 |
---|---|---|
committer | Jonas Schievink <jonasschievink@gmail.com> | 2017-09-17 00:07:19 +0200 |
commit | a7a080b50a064d6abb0ddc4acac1b8341b346825 (patch) | |
tree | 312d69dc8d573323298eb5d34912c236b8b104e6 /src/lua.rs | |
parent | 121bac8394594cf7adb2179018ca85ce88ad9e79 (diff) | |
download | mlua-a7a080b50a064d6abb0ddc4acac1b8341b346825.zip |
Don't load the base library into the "base" global
The stock Lua interpreter doesn't do this either. AFAIK the "base" library is supposed to be loaded into "_G" only as it contains functions like `assert` and `error`.
Diffstat (limited to 'src/lua.rs')
-rw-r--r-- | src/lua.rs | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -1399,7 +1399,6 @@ impl Lua { stack_guard(state, 0, || { // Do not open the debug library, currently it can be used to cause unsafety. ffi::luaL_requiref(state, cstr!("_G"), ffi::luaopen_base, 1); - ffi::luaL_requiref(state, cstr!("base"), ffi::luaopen_base, 1); ffi::luaL_requiref(state, cstr!("coroutine"), ffi::luaopen_coroutine, 1); ffi::luaL_requiref(state, cstr!("table"), ffi::luaopen_table, 1); ffi::luaL_requiref(state, cstr!("io"), ffi::luaopen_io, 1); @@ -1408,7 +1407,7 @@ impl Lua { ffi::luaL_requiref(state, cstr!("utf8"), ffi::luaopen_utf8, 1); ffi::luaL_requiref(state, cstr!("math"), ffi::luaopen_math, 1); ffi::luaL_requiref(state, cstr!("package"), ffi::luaopen_package, 1); - ffi::lua_pop(state, 10); + ffi::lua_pop(state, 9); // Create the userdata registry table |