comparison src/luan/interp/SetTableEntry.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
24 if( t instanceof LuaTable ) { 24 if( t instanceof LuaTable ) {
25 LuaTable table = (LuaTable)t; 25 LuaTable table = (LuaTable)t;
26 Object old = table.put(key,value); 26 Object old = table.put(key,value);
27 if( old != null ) 27 if( old != null )
28 return; 28 return;
29 h = Utils.getHandler("__newindex",t); 29 h = lua.getHandler("__newindex",t);
30 if( h==null ) 30 if( h==null )
31 return; 31 return;
32 table.put(key,old); 32 table.put(key,old);
33 } else { 33 } else {
34 h = Utils.getHandler("__newindex",t); 34 h = lua.getHandler("__newindex",t);
35 if( h==null ) 35 if( h==null )
36 throw new LuaException( "attempt to index a " + Lua.type(t) + " value" ); 36 throw new LuaException( "attempt to index a " + Lua.type(t) + " value" );
37 } 37 }
38 if( h instanceof LuaFunction ) { 38 if( h instanceof LuaFunction ) {
39 LuaFunction fn = (LuaFunction)h; 39 LuaFunction fn = (LuaFunction)h;