summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-10 09:40:13 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-10 09:40:13 +0000
commitab24be4e98660f4fbef44a03262f25988a260b9f (patch)
treecb5aa15714754619f0848fb2dacff076246cb74d /eval.c
parentb53549941d4d543191c91054e974598b0e29210b (diff)
* array.c (rb_ary_to_a): return value should be an Array if the
receiver is an instance of subclass of Array. * string.c (rb_str_to_s): return value should be a String if the receiver is an instance of subclass of String. * eval.c (rb_call): calls method_missing when superclass method does not exist. * eval.c (rb_f_missing): now handles "no super" case. * object.c (rb_obj_ivar_get): Object#instance_variable_get: new method to get instance variable value without eval(). [new] * object.c (rb_obj_ivar_set): Object#instance_variable_set: new method to set instance variable value without eval(). [new] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index a2cc8bb640..bd86870d8c 100644
--- a/eval.c
+++ b/eval.c
@@ -4352,6 +4352,7 @@ static int last_call_status;
#define CSTAT_PRIV 1
#define CSTAT_PROT 2
#define CSTAT_VCALL 4
+#define CSTAT_SUPER 8
static VALUE
rb_f_missing(argc, argv, obj)
@@ -4412,6 +4413,9 @@ rb_f_missing(argc, argv, obj)
exc = rb_eNameError;
}
}
+ else if (last_call_status & CSTAT_SUPER) {
+ format = "super: no superclass method `%s'";
+ }
if (!format) {
format = "undefined method `%s' for %s%s%s";
}
@@ -4807,8 +4811,7 @@ rb_call(klass, recv, mid, argc, argv, scope)
}
else if ((body = rb_get_method_body(&klass, &id, &noex)) == 0) {
if (scope == 3) {
- rb_name_error(mid, "super: no superclass method `%s'",
- rb_id2name(mid));
+ return rb_undefined(recv, mid, argc, argv, CSTAT_SUPER);
}
return rb_undefined(recv, mid, argc, argv, scope==2?CSTAT_VCALL:0);
}