mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (rb_String): Kernel#String should call to_str before to_s.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d084c4f43d
commit
a64103fbfe
2 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Tue Mar 29 21:51:31 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
|
||||||
|
|
||||||
|
* string.c (rb_String): Kernel#String should call to_str before to_s.
|
||||||
|
|
||||||
Tue Mar 29 10:28:08 2011 NAKAMURA Usaku <usa@ruby-lang.org>
|
Tue Mar 29 10:28:08 2011 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* test/webrick/test_filehandler.rb
|
* test/webrick/test_filehandler.rb
|
||||||
|
|
5
object.c
5
object.c
|
@ -2360,7 +2360,10 @@ rb_num2dbl(VALUE val)
|
||||||
VALUE
|
VALUE
|
||||||
rb_String(VALUE val)
|
rb_String(VALUE val)
|
||||||
{
|
{
|
||||||
return rb_convert_type(val, T_STRING, "String", "to_s");
|
VALUE tmp = rb_check_string_type(val);
|
||||||
|
if (NIL_P(tmp))
|
||||||
|
tmp = rb_convert_type(val, T_STRING, "String", "to_s");
|
||||||
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue