예제 #1
0
 Object eval(Globals g, Bindings b) throws ScriptException {
   g.setmetatable(new BindingsMetatable(b));
   LuaFunction f = function;
   if (f.isclosure()) f = new LuaClosure(f.checkclosure().p, g);
   else {
     try {
       f = f.getClass().newInstance();
     } catch (Exception e) {
       throw new ScriptException(e);
     }
     f.initupvalue1(g);
   }
   return toJava(f.invoke(LuaValue.NONE));
 }