comparison src/luan/interp/IndexExpr.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 if( t instanceof LuaTable ) { 21 if( t instanceof LuaTable ) {
22 LuaTable tbl = (LuaTable)t; 22 LuaTable tbl = (LuaTable)t;
23 Object value = tbl.get(key); 23 Object value = tbl.get(key);
24 if( value != null ) 24 if( value != null )
25 return value; 25 return value;
26 h = Utils.getHandler("__index",t); 26 h = lua.getHandler("__index",t);
27 if( h==null ) 27 if( h==null )
28 return null; 28 return null;
29 } else { 29 } else {
30 h = Utils.getHandler("__index",t); 30 h = lua.getHandler("__index",t);
31 if( h==null ) 31 if( h==null )
32 throw new LuaException( "attempt to index a " + Lua.type(t) + " value" ); 32 throw new LuaException( "attempt to index a " + Lua.type(t) + " value" );
33 } 33 }
34 if( h instanceof LuaFunction ) { 34 if( h instanceof LuaFunction ) {
35 LuaFunction fn = (LuaFunction)h; 35 LuaFunction fn = (LuaFunction)h;