internal void SetMethodNoMutateNoEventNoLock(RubyContext/*!*/ callerContext, string/*!*/ name, RubyMemberInfo/*!*/ method) {
Context.RequiresClassHierarchyLock();
Assert.NotNull(name, method);
if (callerContext != _context) {
throw RubyExceptions.CreateTypeError(String.Format("Cannot define a method on a {0} `{1}' defined in a foreign runtime #{2}",
IsClass ? "class" : "module", _name, _context.RuntimeId));
}
if (method.IsUndefined && name == Symbols.Initialize) {
throw RubyExceptions.CreateTypeError("Cannot undefine `initialize' method");
}
PrepareMethodUpdate(name, method);
InitializeMethodsNoLock();
_methods[name] = method;
}