Mercurial Hosting > luan
diff core/src/luan/impl/LenExpr.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/LenExpr.java Mon Jul 13 18:34:31 2015 -0600 +++ b/core/src/luan/impl/LenExpr.java Mon Jul 13 20:38:26 2015 -0600 @@ -5,7 +5,6 @@ import luan.LuanFunction; import luan.LuanException; import luan.LuanElement; -import luan.LuanBit; final class LenExpr extends UnaryOpExpr { @@ -24,10 +23,14 @@ byte[] a = (byte[])o; return a.length; } - LuanBit bit = luan.bit(el); - if( !(o instanceof LuanTable) ) - throw bit.exception( "attempt to get length of a " + Luan.type(o) + " value" ); - LuanTable t = (LuanTable)o; - return bit.length(t); + luan.push(el,null); + try { + if( !(o instanceof LuanTable) ) + throw luan.exception( "attempt to get length of a " + Luan.type(o) + " value" ); + LuanTable t = (LuanTable)o; + return t.length(luan); + } finally { + luan.pop(); + } } }