Mercurial Hosting > luan
comparison core/src/luan/LuanPropertyMeta.java @ 574:6cc2f047019b
remove LuanState.call()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 13 Jul 2015 12:31:53 -0600 |
parents | d62c35a5cd6b |
children | 60c549d43988 |
comparison
equal
deleted
inserted
replaced
573:894f991baac5 | 574:6cc2f047019b |
---|---|
26 if( obj == null ) | 26 if( obj == null ) |
27 return null; | 27 return null; |
28 if( !(obj instanceof LuanFunction) ) | 28 if( !(obj instanceof LuanFunction) ) |
29 throw luan.exception("get for '"+key+"' isn't a function"); | 29 throw luan.exception("get for '"+key+"' isn't a function"); |
30 LuanFunction fn = (LuanFunction)obj; | 30 LuanFunction fn = (LuanFunction)obj; |
31 return luan.call(fn); | 31 return fn.call(luan); |
32 } | 32 } |
33 | 33 |
34 @Override protected Iterator keys(final LuanTable tbl) { | 34 @Override protected Iterator keys(final LuanTable tbl) { |
35 return new Iterator() { | 35 return new Iterator() { |
36 final Iterator<Map.Entry<Object,Object>> iter = getters(tbl).rawIterator(); | 36 final Iterator<Map.Entry<Object,Object>> iter = getters(tbl).rawIterator(); |
59 return; | 59 return; |
60 } | 60 } |
61 if( !(obj instanceof LuanFunction) ) | 61 if( !(obj instanceof LuanFunction) ) |
62 throw luan.exception("set for '"+key+"' isn't a function"); | 62 throw luan.exception("set for '"+key+"' isn't a function"); |
63 LuanFunction fn = (LuanFunction)obj; | 63 LuanFunction fn = (LuanFunction)obj; |
64 luan.call(fn,new Object[]{value}); | 64 fn.call(luan,new Object[]{value}); |
65 } | 65 } |
66 | 66 |
67 @Override public LuanTable newMetatable() { | 67 @Override public LuanTable newMetatable() { |
68 LuanTable mt = super.newMetatable(); | 68 LuanTable mt = super.newMetatable(); |
69 mt.rawPut( "get", new LuanTable() ); | 69 mt.rawPut( "get", new LuanTable() ); |