Let any 'v' in __mode create a weak table.

This commit is contained in:
James Roseborough
2008-08-08 19:09:34 +00:00
parent 32e700aabd
commit bdcd0e7e38

View File

@@ -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;