Mercurial Hosting > luan
comparison core/src/luan/LuanState.java @ 224:05eb2837ddbf
change LuanTable.put() to not return old value
git-svn-id: https://luan-java.googlecode.com/svn/trunk@225 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Mon, 21 Jul 2014 09:27:06 +0000 |
parents | ec016471c6eb |
children | 4dfa86dbca45 |
comparison
equal
deleted
inserted
replaced
223:a9fe265dbac3 | 224:05eb2837ddbf |
---|---|
97 public final Object getHandler(String op,Object obj) { | 97 public final Object getHandler(String op,Object obj) { |
98 LuanTable t = getMetatable(obj); | 98 LuanTable t = getMetatable(obj); |
99 return t==null ? null : t.get(op); | 99 return t==null ? null : t.get(op); |
100 } | 100 } |
101 | 101 |
102 public final Object getHandler(String op,LuanTable table) { | |
103 LuanTable t = table.getMetatable(); | |
104 return t==null ? null : t.get(op); | |
105 } | |
106 | |
102 private static LuanTableImpl newMetatable() { | 107 private static LuanTableImpl newMetatable() { |
103 LuanTableImpl metatable = new LuanTableImpl(); | 108 LuanTableImpl metatable = new LuanTableImpl(); |
104 try { | 109 try { |
105 metatable.put( "__index", new LuanJavaFunction( | 110 metatable.put( "__index", new LuanJavaFunction( |
106 LuanState.class.getMethod("__index",LuanState.class,Object.class,Object.class), null | 111 LuanState.class.getMethod("__index",LuanState.class,Object.class,Object.class), null |