// Defines [methodValue] as a method on [classObj].
private static Value BindMethod(MethodType methodType, int symbol, ObjClass classObj, Value methodContainer)
{
ObjFn methodFn = methodContainer.Obj as ObjFn ?? ((ObjClosure)methodContainer.Obj).Function;
// Methods are always bound against the class, and not the metaclass, even
// for static methods, because static methods don't have instance fields
// anyway.
Compiler.BindMethodCode(classObj, methodFn);
Method method = new Method { mType = MethodType.Block, obj = methodContainer.Obj };
if (methodType == MethodType.Static)
classObj = classObj.ClassObj;
//classObj.Methods[symbol] = method;
classObj.BindMethod(symbol, method);
return new Value (ValueType.Null);
}