comparison src/luan/interp/FnCall.java @ 36:2a35154aec14

implement more basic lib functions git-svn-id: https://luan-java.googlecode.com/svn/trunk@37 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Tue, 18 Dec 2012 09:53:42 +0000
parents e51906de0f11
children 8a57ebfdfd78
comparison
equal deleted inserted replaced
35:e51906de0f11 36:2a35154aec14
21 private Object[] call(LuaStateImpl lua,Object o) throws LuaException { 21 private Object[] call(LuaStateImpl lua,Object o) throws LuaException {
22 if( o instanceof LuaFunction ) { 22 if( o instanceof LuaFunction ) {
23 LuaFunction fn = (LuaFunction)o; 23 LuaFunction fn = (LuaFunction)o;
24 return fn.call( lua, args.eval(lua) ); 24 return fn.call( lua, args.eval(lua) );
25 } 25 }
26 Object h = Utils.getHandlerObject("__call",o); 26 Object h = Utils.getHandler("__call",o);
27 if( h != null ) 27 if( h != null )
28 return call(lua,h); 28 return call(lua,h);
29 throw new LuaException( "attempt to call a " + Lua.type(o) + " value" ); 29 throw new LuaException( "attempt to call a " + Lua.type(o) + " value" );
30 } 30 }
31 } 31 }