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

insns.def: method entry from method frame

* insns.def (defined): get method entry from the method top level
  frame, not block frame.  [ruby-core:54769] [Bug #8367]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-05-05 07:29:44 +00:00
parent 13bd7afc6e
commit 08fbd2cee2
3 changed files with 32 additions and 0 deletions

View file

@ -188,4 +188,20 @@ class TestDefined < Test::Unit::TestCase
end
assert_equal("super", c.new.m)
end
def test_super_in_block
bug8367 = '[ruby-core:54769] [Bug #8367]'
c = Class.new do
def x; end
end
m = Module.new do
def b; yield; end
def x; b {return defined?(super)}; end
end
o = c.new
o.extend(m)
assert_equal("super", o.x)
end
end