Mercurial Hosting > luan
diff core/src/luan/impl/SetTableEntry.java @ 576:4723d22062ce
remove LuanBit
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 13 Jul 2015 20:38:26 -0600 |
parents | 7c3ad6db8ac3 |
children | 60c549d43988 |
line wrap: on
line diff
--- a/core/src/luan/impl/SetTableEntry.java Mon Jul 13 18:34:31 2015 -0600 +++ b/core/src/luan/impl/SetTableEntry.java Mon Jul 13 20:38:26 2015 -0600 @@ -6,7 +6,6 @@ import luan.LuanFunction; import luan.LuanElement; import luan.LuanMeta; -import luan.LuanBit; import luan.modules.JavaLuan; @@ -25,16 +24,20 @@ } private void newIndex(LuanStateImpl luan,Object t,Object key,Object value) throws LuanException { - LuanBit bit = luan.bit(el()); - if( t instanceof LuanTable ) { - LuanTable tbl = (LuanTable)t; - bit.put(tbl,key,value); - return; + luan.push(el,null); + try { + if( t instanceof LuanTable ) { + LuanTable tbl = (LuanTable)t; + tbl.put(luan,key,value); + return; + } + if( t != null && luan.hasJava() ) + JavaLuan.__new_index(luan,t,key,value); + else + throw luan.exception( "attempt to index a " + Luan.type(t) + " value in '"+el.text()+"'" ); + } finally { + luan.pop(); } - if( t != null && luan.hasJava() ) - JavaLuan.__new_index(bit,t,key,value); - else - throw bit.exception( "attempt to index a " + Luan.type(t) + " value in '"+bit.el.text()+"'" ); } }