From 89800697e5d28d123be00de047c85b4c44ce4c61 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 10 Feb 2003 09:40:13 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/trunk@3473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'string.c') diff --git a/string.c b/string.c index 99813c969..44f78a6b3 100644 --- a/string.c +++ b/string.c @@ -1849,6 +1849,11 @@ static VALUE rb_str_to_s(str) VALUE str; { + if (rb_obj_class(str) != rb_cString) { + VALUE dup = str_alloc(rb_cString); + rb_str_replace(dup, str); + return dup; + } return str; } -- cgit