mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
proc.c: infect inspect result
* proc.c (method_inspect): the result should be infected by the object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
452f46b751
commit
bacadbe9bf
2 changed files with 4 additions and 0 deletions
1
proc.c
1
proc.c
|
@ -2524,6 +2524,7 @@ method_inspect(VALUE method)
|
|||
|
||||
TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
|
||||
str = rb_str_buf_new2("#<");
|
||||
OBJ_INFECT_RAW(str, method);
|
||||
s = rb_obj_classname(method);
|
||||
rb_str_buf_cat2(str, s);
|
||||
rb_str_buf_cat2(str, ": ");
|
||||
|
|
|
@ -454,6 +454,9 @@ class TestMethod < Test::Unit::TestCase
|
|||
c3.class_eval { alias bar foo }
|
||||
m3 = c3.new.method(:bar)
|
||||
assert_equal("#<Method: #{c3.inspect}(#{c.inspect})#bar(foo)>", m3.inspect, bug7806)
|
||||
|
||||
m.taint
|
||||
assert_predicate(m.inspect, :tainted?, "inspect result should be infected")
|
||||
end
|
||||
|
||||
def test_callee_top_level
|
||||
|
|
Loading…
Reference in a new issue