public override object callOn(object target, List args)
{
int argsSize = args == null ? 0 : args.sz();
bool dotnetStatic = _isStatic();
bool fanStatic = ((m.m_flags & (FConst.Static | FConst.Ctor)) != 0);
if (dotnetStatic && !fanStatic)
{
// if Java static doesn't match Fantom static, then this is
// a FanXXX method which we need to call as Java static
int p = checkArgs(argsSize, false, true);
object[] a = new object[p + 1];
a[0] = target;
if (args != null && a.Length > 0)
{
args.copyInto(a, 1, a.Length - 1);
}
return(m.invoke(null, a));
}
else
{
// we don't include target as part of arguments
int p = checkArgs(argsSize, dotnetStatic, true);
object[] a = new object[p];
if (args != null && a.Length > 0)
{
args.toArray(a, 0, a.Length);
}
return(m.invoke(target, a));
}
}