2626
2727import org .squiddev .cobalt .LuaError ;
2828import org .squiddev .cobalt .LuaState ;
29- import org .squiddev .cobalt .LuaTable ;
3029
3130/**
3231 * Set up an environment with all core/safe globals installed.
@@ -39,33 +38,28 @@ private CoreLibraries() {
3938 * Create a standard set of globals and setup a thread
4039 *
4140 * @param state The current lua state
42- * @return Table of globals initialized with the standard JSE libraries
4341 * @see #debugGlobals(LuaState)
4442 * @see CoreLibraries
4543 */
46- public static LuaTable standardGlobals (LuaState state ) throws LuaError {
47- LuaTable globals = state .globals ();
48- BaseLib .add (globals );
49- TableLib .add (state , globals );
50- StringLib .add (state , globals );
51- CoroutineLib .add (state , globals );
52- MathLib .add (state , globals );
53- Utf8Lib .add (state , globals );
54- return globals ;
44+ public static void standardGlobals (LuaState state ) throws LuaError {
45+ BaseLib .add (state );
46+ TableLib .add (state );
47+ StringLib .add (state );
48+ CoroutineLib .add (state );
49+ MathLib .add (state );
50+ Utf8Lib .add (state );
5551 }
5652
5753 /**
5854 * Create standard globals including the {@link DebugLib} library.
5955 *
6056 * @param state The current lua state
61- * @return Table of globals initialized with the standard JSE and debug libraries
6257 * @see #standardGlobals(LuaState)
6358 * @see CoreLibraries
6459 * @see DebugLib
6560 */
66- public static LuaTable debugGlobals (LuaState state ) throws LuaError {
67- LuaTable _G = standardGlobals (state );
68- DebugLib .add (state , _G );
69- return _G ;
61+ public static void debugGlobals (LuaState state ) throws LuaError {
62+ standardGlobals (state );
63+ DebugLib .add (state );
7064 }
7165}
0 commit comments