Mercurial Hosting > luan
comparison core/src/luan/impl/SetTableEntry.java @ 419:8fbb961aabd5
improve repr() to check metamethod recursively
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 30 Apr 2015 23:15:40 -0600 |
parents | 3e68917a0dc6 |
children | b31d614343e8 |
comparison
equal
deleted
inserted
replaced
418:455784e2227d | 419:8fbb961aabd5 |
---|---|
24 } | 24 } |
25 | 25 |
26 private void newindex(LuanStateImpl luan,Object t,Object key,Object value) throws LuanException { | 26 private void newindex(LuanStateImpl luan,Object t,Object key,Object value) throws LuanException { |
27 if( t instanceof LuanTable ) { | 27 if( t instanceof LuanTable ) { |
28 LuanTable table = (LuanTable)t; | 28 LuanTable table = (LuanTable)t; |
29 Object h = luan.getHandler("__newindex",table); | 29 Object h = table.getHandler("__newindex"); |
30 if( h==null || table.get(key)!=null ) { | 30 if( h==null || table.get(key)!=null ) { |
31 try { | 31 try { |
32 table.put(key,value); | 32 table.put(key,value); |
33 } catch(IllegalArgumentException e) { | 33 } catch(IllegalArgumentException e) { |
34 throw luan.bit(se).exception(e); | 34 throw luan.bit(se).exception(e); |