Search in sources :

Example 1 with CoroutineLib

use of org.luaj.vm2.lib.CoroutineLib in project LuaViewSDK by alibaba.

the class JsePlatform method standardGlobals.

/**
     * Create a standard set of globals for JSE including all the libraries.
     *
     * @return Table of globals initialized with the standard JSE libraries
     * @see #debugGlobals()
     * @see JsePlatform
     * @see JmePlatform
     */
public static Globals standardGlobals(Globals globals) {
    globals.load(new JseBaseLib());
    globals.load(new PackageLib());
    globals.load(new Bit32Lib());
    globals.load(new TableLib());
    globals.load(new StringLib());
    globals.load(new CoroutineLib());
    globals.load(new JseMathLib());
    globals.load(new JseOsLib());
    //		globals.load(new JseIoLib());//安全考虑,删除for LuaView
    //		globals.load(new LuajavaLib());//安全考虑,删除for LuaView
    LoadState.install(globals);
    LuaC.install(globals);
    return globals;
}
Also used : CoroutineLib(org.luaj.vm2.lib.CoroutineLib) TableLib(org.luaj.vm2.lib.TableLib) Bit32Lib(org.luaj.vm2.lib.Bit32Lib) StringLib(org.luaj.vm2.lib.StringLib) PackageLib(org.luaj.vm2.lib.PackageLib)

Example 2 with CoroutineLib

use of org.luaj.vm2.lib.CoroutineLib in project LuaViewSDK by alibaba.

the class JsePlatform method standardGlobals.

/**
     * Create a standard set of globals for JSE including all the libraries.
     *
     * @return Table of globals initialized with the standard JSE libraries
     * @see #debugGlobals()
     * @see JsePlatform
     * @see JmePlatform
     */
public static Globals standardGlobals() {
    Globals globals = new Globals();
    globals.load(new JseBaseLib());
    globals.load(new PackageLib());
    globals.load(new Bit32Lib());
    globals.load(new TableLib());
    globals.load(new StringLib());
    globals.load(new CoroutineLib());
    globals.load(new JseMathLib());
    globals.load(new JseOsLib());
    //		globals.load(new JseIoLib());//安全考虑,删除for LuaView
    //		globals.load(new LuajavaLib());//安全考虑,删除for LuaView
    LoadState.install(globals);
    LuaC.install(globals);
    return globals;
}
Also used : Globals(org.luaj.vm2.Globals) CoroutineLib(org.luaj.vm2.lib.CoroutineLib) TableLib(org.luaj.vm2.lib.TableLib) Bit32Lib(org.luaj.vm2.lib.Bit32Lib) StringLib(org.luaj.vm2.lib.StringLib) PackageLib(org.luaj.vm2.lib.PackageLib)

Aggregations

Bit32Lib (org.luaj.vm2.lib.Bit32Lib)2 CoroutineLib (org.luaj.vm2.lib.CoroutineLib)2 PackageLib (org.luaj.vm2.lib.PackageLib)2 StringLib (org.luaj.vm2.lib.StringLib)2 TableLib (org.luaj.vm2.lib.TableLib)2 Globals (org.luaj.vm2.Globals)1