comparison src/luan/interp/FnCall.java @ 37:8a57ebfdfd78

add JavaLib git-svn-id: https://luan-java.googlecode.com/svn/trunk@38 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Thu, 20 Dec 2012 02:36:07 +0000
parents 2a35154aec14
children e3624b7cd603
comparison
equal deleted inserted replaced
36:2a35154aec14 37:8a57ebfdfd78
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.getHandler("__call",o); 26 Object h = lua.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 }