Let any 'v' in __mode create a weak table.
This commit is contained in:
@@ -275,7 +275,7 @@ public class LTable extends LValue {
|
|||||||
else if ( metatable.luaGetType() == Lua.LUA_TTABLE ) {
|
else if ( metatable.luaGetType() == Lua.LUA_TTABLE ) {
|
||||||
org.luaj.vm.LTable t = (org.luaj.vm.LTable) metatable;
|
org.luaj.vm.LTable t = (org.luaj.vm.LTable) metatable;
|
||||||
LValue m = t.get(TM_MODE);
|
LValue m = t.get(TM_MODE);
|
||||||
if ( "v".equals(m.toJavaString()) ) {
|
if ( m.isString() && m.toJavaString().indexOf('v')>=0 ) {
|
||||||
return new LWeakTable(this);
|
return new LWeakTable(this);
|
||||||
}
|
}
|
||||||
this.m_metatable = t;
|
this.m_metatable = t;
|
||||||
|
|||||||
Reference in New Issue
Block a user