use of org.luaj.vm2.LuaClosure in project aerospike-client-java by aerospike.
the class LuaInstance method loadPackage.
public void loadPackage(Statement statement) {
if (loadedTable.get(statement.getPackageName()).toboolean()) {
return;
}
Prototype prototype;
if (statement.getResourceLoader() == null || statement.getResourcePath() == null) {
prototype = LuaCache.loadPackageFromFile(statement.getPackageName());
} else {
prototype = LuaCache.loadPackageFromResource(statement.getResourceLoader(), statement.getResourcePath(), statement.getPackageName());
}
LuaClosure function = new LuaClosure(prototype, globals);
function.invoke();
loadedTable.set(statement.getPackageName(), LuaValue.TRUE);
}
Aggregations