if (selector instanceof Symbol)
{
machine.setArg(0, nArgCount, this);
Function fun = machine.getGlobalEnvironment().findFunction(m_class, (Symbol)selector, nArgCount - 1);
if (fun != null)
{
return fun.invoke(nArgCount, machine);
}
fun = m_class.resolveFunction((Symbol)selector, nArgCount - 1);
if (fun != null)
{
return fun.invoke(nArgCount, machine);
}
throw new InvocationException("err.scripting.methodLookup",
new Object[]{selector.toString(), Primitive.createInteger(nArgCount - 1), m_class.getName()});
}
if (selector instanceof ClassObject && nArgCount >= 1)
{
ClassObject classObject = (ClassObject)selector;
selector = machine.getArg(1, nArgCount);
if (selector instanceof Symbol)
{
machine.shiftArgs(1, nArgCount--);
machine.setArg(0, nArgCount, this);
Function fun = machine.getGlobalEnvironment().findFunction(classObject, (Symbol)selector, -nArgCount);
if (fun != null)
{
return fun.invoke(nArgCount, machine);
}
fun = classObject.resolveBaseFunction((Symbol)selector, nArgCount - 1);
if (fun != null)
{
return fun.invoke(nArgCount, machine);
}
throw new InvocationException("err.scripting.baseMethodLookup",
new Object[]{selector.toString(), Primitive.createInteger(nArgCount - 1), classObject.getName()});
}