diff options
Diffstat (limited to 'eval_error.ci')
-rw-r--r-- | eval_error.ci | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/eval_error.ci b/eval_error.ci index 210dce073d..94fb18029d 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)); |