Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'bugfix_backport' into merge

  • Loading branch information...
commit 056e102239199f2edcb1c4c0d7be42f7a8888d38 2 parents 485d04d + 50f137f
@FooBarWidget FooBarWidget authored
Showing with 22 additions and 2 deletions.
  1. +1 −2  eval.c
  2. +21 −0 test/ruby/test_super.rb
View
3  eval.c
@@ -9017,8 +9017,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()) {
View
21 test/ruby/test_super.rb
@@ -149,4 +149,25 @@ def test_define_method
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
Please sign in to comment.
Something went wrong with that request. Please try again.