[NOTHING CHANGED] Assorted fixes #48

Closed
asiekierka wants to merge 61 commits from asiekierka/master into master
Showing only changes of commit 626664a0fe - Show all commits

View File

@@ -350,8 +350,11 @@ public class BaseLib extends TwoArgFunction implements ResourceFinder {
static final class tostring extends LibFunction { static final class tostring extends LibFunction {
public LuaValue call(LuaValue arg) { public LuaValue call(LuaValue arg) {
LuaValue h = arg.metatag(TOSTRING); LuaValue h = arg.metatag(TOSTRING);
if ( ! h.isnil() ) if ( ! h.isnil() ) {
return h.call(arg); LuaValue v = h.call(arg);
LuaValue vs = v.tostring();
return !vs.isnil() ? vs : v;
}
LuaValue v = arg.tostring(); LuaValue v = arg.tostring();
if ( ! v.isnil() ) if ( ! v.isnil() )
return v; return v;