public void exportMethod(String name, Visibility visibility) {
if (this == getRuntime().getObject()) {
getRuntime().secure(4);
}
DynamicMethod method = searchMethod(name);
if (method.isUndefined()) {
throw getRuntime().newNameError("undefined method '" + name + "' for " +
(isModule() ? "module" : "class") + " '" + getName() + "'", name);
}
if (method.getVisibility() != visibility) {
if (this == method.getImplementationClass()) {
method.setVisibility(visibility);
} else {
// FIXME: Why was this using a FullFunctionCallbackMethod before that did callSuper?
addMethod(name, new WrapperMethod(this, method, visibility));
}
}