Mercurial Hosting > luan
comparison core/src/luan/LuanMeta.java @ 427:dae264ad6a7b
fix LuanTable.put() to use metatables
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 01 May 2015 19:29:07 -0600 |
parents | 91af5337b9ae |
children | df95199ca4c0 |
comparison
equal
deleted
inserted
replaced
426:23a93c118042 | 427:dae264ad6a7b |
---|---|
51 return type(tbl) + "-" + tbl; | 51 return type(tbl) + "-" + tbl; |
52 } | 52 } |
53 | 53 |
54 public LuanTable newMetatable() { | 54 public LuanTable newMetatable() { |
55 LuanTable mt = new LuanTable(); | 55 LuanTable mt = new LuanTable(); |
56 mt.put( "__index", this ); | 56 mt.rawPut( "__index", this ); |
57 mt.put( "__pairs", this ); | 57 mt.rawPut( "__pairs", this ); |
58 mt.put( "__tostring", this ); | 58 mt.rawPut( "__tostring", this ); |
59 if( canNewindex() ) | 59 if( canNewindex() ) |
60 mt.put( "__newindex", this ); | 60 mt.rawPut( "__newindex", this ); |
61 return mt; | 61 return mt; |
62 } | 62 } |
63 | 63 |
64 public LuanTable newTable() { | 64 public LuanTable newTable() { |
65 LuanTable tbl = new LuanTable(); | 65 LuanTable tbl = new LuanTable(); |