mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (proc_invoke): reverted r25975. [ruby-dev:39931]
[ruby-dev:40059] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a7055a6b45
commit
4c97668455
2 changed files with 22 additions and 2 deletions
3
eval.c
3
eval.c
|
@ -8958,8 +8958,7 @@ proc_invoke(proc, args, self, klass)
|
|||
_block = *data;
|
||||
_block.block_obj = bvar;
|
||||
if (self != Qundef) _block.frame.self = self;
|
||||
_block.frame.last_class = klass;
|
||||
if (!klass) _block.frame.last_func = 0;
|
||||
if (klass) _block.frame.last_class = klass;
|
||||
_block.frame.argc = RARRAY(tmp)->len;
|
||||
_block.frame.flags = ruby_frame->flags;
|
||||
if (_block.frame.argc && DMETHOD_P()) {
|
||||
|
|
|
@ -149,4 +149,25 @@ class TestSuper < Test::Unit::TestCase
|
|||
c = C.new
|
||||
assert_equal([c, "#{c.to_s}::m"], c.m, bug2419)
|
||||
end
|
||||
|
||||
module Bug2537
|
||||
class Parent
|
||||
def run(a)
|
||||
a
|
||||
end
|
||||
end
|
||||
|
||||
class Child < Parent
|
||||
def run(*a)
|
||||
proc {super(*a)}.call
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_super_in_block_call
|
||||
bug2537 = '[ruby-dev:39931]'
|
||||
assert_nothing_raised(bug2537) do
|
||||
assert_equal(bug2537, Bug2537::Child.new.run(bug2537), bug2537)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue