internal override void ResolveCall(ASTList args, IReflect[] argIRs, bool constructor, bool brackets){
if (constructor || !brackets){
if (this.isSuper)
this.context.HandleError(JSError.IllegalUseOfSuper);
else
this.context.HandleError(JSError.IllegalUseOfThis);
return;
}
IReflect ir = this.InferType(null);
Type t = ir is Type ? (Type)ir : null;
if (ir is ClassScope) t = ((ClassScope)ir).GetBakedSuperType();
MemberInfo[] defaultMembers = JSBinder.GetDefaultMembers(t);
if (defaultMembers != null && defaultMembers.Length > 0){
try{
this.method = JSBinder.SelectMethod(defaultMembers, argIRs); //Returns property getters as well
if (this.method != null){
if (!Binding.CheckParameters(this.method.GetParameters(), argIRs, args, this.context, 0, false, true))
this.method = null;
return;
}
}catch(AmbiguousMatchException){
this.context.HandleError(JSError.AmbiguousMatch);
return;
}
}
String tname = ir is ClassScope ? ((ClassScope)ir).GetName() : ((Type)ir).Name;
this.context.HandleError(JSError.NotIndexable, tname);
}