1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* proc.c (method_name): should return symbols instead of strings.

[ruby-dev:34531]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-04-28 02:12:21 +00:00
parent 59ba2bf0b6
commit 3d751cde0f
5 changed files with 13 additions and 8 deletions

View file

@ -1,3 +1,8 @@
Mon Apr 28 11:11:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* proc.c (method_name): should return symbols instead of strings.
[ruby-dev:34531]
Mon Apr 28 09:02:43 2008 Tanaka Akira <akr@fsij.org>
* include/ruby/intern.h (rb_exec_arg_init): declared.

4
proc.c
View file

@ -905,7 +905,7 @@ method_receiver(VALUE obj)
/*
* call-seq:
* meth.name => string
* meth.name => symbol
*
* Returns the name of the method.
*/
@ -916,7 +916,7 @@ method_name(VALUE obj)
struct METHOD *data;
Data_Get_Struct(obj, struct METHOD, data);
return rb_str_dup(rb_id2str(data->id));
return ID2SYM(data->id);
}
/*

View file

@ -1041,8 +1041,8 @@ class TestM17N < Test::Unit::TestCase
mu = method(u("\xc2\xa1"))
assert_not_equal(me.name, mu.name)
assert_not_equal(me.inspect, mu.inspect)
assert_equal(e("\xc2\xa1"), me.name)
assert_equal(u("\xc2\xa1"), mu.name)
assert_equal(e("\xc2\xa1"), me.name.to_s)
assert_equal(u("\xc2\xa1"), mu.name.to_s)
end
def test_symbol

View file

@ -107,7 +107,7 @@ class TestMethod < Test::Unit::TestCase
def o.foo; end
m = o.method(:foo)
assert_equal(o, m.receiver)
assert_equal("foo", m.name)
assert_equal(:foo, m.name)
assert_equal(class << o; self; end, m.owner)
end

View file

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
#define RUBY_RELEASE_DATE "2008-04-27"
#define RUBY_RELEASE_DATE "2008-04-28"
#define RUBY_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20080427
#define RUBY_RELEASE_CODE 20080428
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2008
#define RUBY_RELEASE_MONTH 4
#define RUBY_RELEASE_DAY 27
#define RUBY_RELEASE_DAY 28
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];