mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (frame_func_id): return proper method ID.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2c5463fe99
commit
69dd06ae68
4 changed files with 28 additions and 8 deletions
|
@ -43,4 +43,13 @@ class TestMethod < Test::Unit::TestCase
|
|||
um.bind(Base.new)
|
||||
end
|
||||
end
|
||||
|
||||
def test_callee
|
||||
assert_equal(:test_callee, __method__)
|
||||
assert_equal(:m, Class.new {def m; __method__; end}.new.m)
|
||||
assert_equal(:m, Class.new {def m; tap{return __method__}; end}.new.m)
|
||||
assert_equal(:m, Class.new {define_method(:m) {__method__}}.new.m)
|
||||
assert_equal(:m, Class.new {define_method(:m) {tap{return __method__}}}.new.m)
|
||||
assert_nil(eval("class TestCallee; __method__; end"))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue