summaryrefslogtreecommitdiffstats
path: root/eval_error.ci
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-17 23:01:50 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-17 23:01:50 +0000
commit8d81bcd71fc31b53fcc914f401394c22bbc2fac3 (patch)
tree0ef783f01acbc6a5b1412888bd974b826494f58f /eval_error.ci
parent8d1714e409b7a6744b9b8871e7789ae29c8e2eb8 (diff)
downloadruby-8d81bcd71fc31b53fcc914f401394c22bbc2fac3.tar.gz
ruby-8d81bcd71fc31b53fcc914f401394c22bbc2fac3.tar.xz
ruby-8d81bcd71fc31b53fcc914f401394c22bbc2fac3.zip
* proc.c (rb_obj_public_method): Object#public_method to retrieve
public method object. * proc.c (rb_mod_public_instance_method): Module#public_instance_method to retrieve public instance method from class / module. * proc.c (mnew): visibility check added. * eval_error.ci (rb_print_undef): add rb_ prefix. * eval_error.ci (rb_print_undef): add visibility in the error message. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_error.ci')
-rw-r--r--eval_error.ci12
1 files changed, 10 insertions, 2 deletions
diff --git a/eval_error.ci b/eval_error.ci
index 210dce073..94fb18029 100644
--- a/eval_error.ci
+++ b/eval_error.ci
@@ -207,9 +207,17 @@ ruby_error_print(void)
}
void
-print_undef(VALUE klass, ID id)
+rb_print_undef(VALUE klass, ID id, int scope)
{
- rb_name_error(id, "undefined method `%s' for %s `%s'",
+ char *v;
+
+ switch (scope) {
+ default:
+ case NOEX_PUBLIC: v = ""; break;
+ case NOEX_PRIVATE: v = " private"; break;
+ case NOEX_PROTECTED: v = " protected"; break;
+ }
+ rb_name_error(id, "undefined%s method `%s' for %s `%s'", v,
rb_id2name(id),
(TYPE(klass) == T_MODULE) ? "module" : "class",
rb_class2name(klass));