comparison src/luan/interp/SetTableEntry.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
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.getHandlerObject("__newindex",t); 29 h = Utils.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.getHandlerObject("__newindex",t); 34 h = Utils.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;