Mercurial Hosting > luan
diff src/luan/interp/ConcatExpr.java @ 40:e3624b7cd603
implement stack trace
git-svn-id: https://luan-java.googlecode.com/svn/trunk@41 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 21 Dec 2012 10:45:54 +0000 |
parents | 8a57ebfdfd78 |
children | 64ecb7a3aad7 |
line wrap: on
line diff
--- a/src/luan/interp/ConcatExpr.java Thu Dec 20 02:54:06 2012 +0000 +++ b/src/luan/interp/ConcatExpr.java Fri Dec 21 10:45:54 2012 +0000 @@ -3,12 +3,13 @@ import luan.Lua; import luan.LuaFunction; import luan.LuaException; +import luan.LuaSource; final class ConcatExpr extends BinaryOpExpr { - ConcatExpr(Expr op1,Expr op2) { - super(op1,op2); + ConcatExpr(LuaSource.Element se,Expr op1,Expr op2) { + super(se,op1,op2); } @Override public Object eval(LuaStateImpl lua) throws LuaException { @@ -18,10 +19,10 @@ String s2 = Lua.asString(o2); if( s1 != null && s2 != null ) return s1 + s2; - LuaFunction fn = lua.getBinHandler("__concat",o1,o2); + LuaFunction fn = lua.getBinHandler(se,"__concat",o1,o2); if( fn != null ) - return Utils.first(fn.call(lua,o1,o2)); + return Lua.first(lua.call(fn,se,"__concat",o1,o2)); String type = s1==null ? Lua.type(o1) : Lua.type(o2); - throw new LuaException( "attempt to concatenate a " + type + " value" ); + throw new LuaException( lua, se, "attempt to concatenate a " + type + " value" ); } }