2014-11-09 09:25:52 -05:00
|
|
|
#include "ruby.h"
|
|
|
|
|
|
|
|
static VALUE
|
2014-11-09 09:58:33 -05:00
|
|
|
bug_proc_call_super(RB_BLOCK_CALL_FUNC_ARGLIST(yieldarg, procarg))
|
2014-11-09 09:25:52 -05:00
|
|
|
{
|
|
|
|
VALUE args[2];
|
2014-11-09 09:58:33 -05:00
|
|
|
VALUE ret;
|
2014-11-09 09:25:52 -05:00
|
|
|
args[0] = yieldarg;
|
|
|
|
args[1] = procarg;
|
2014-11-09 09:58:33 -05:00
|
|
|
ret = rb_call_super(2, args);
|
|
|
|
if (!NIL_P(blockarg)) {
|
|
|
|
ret = rb_proc_call(blockarg, ret);
|
|
|
|
}
|
|
|
|
return ret;
|
2014-11-09 09:25:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
2014-11-16 05:11:28 -05:00
|
|
|
bug_proc_make_call_super(VALUE self, VALUE procarg)
|
2014-11-09 09:25:52 -05:00
|
|
|
{
|
|
|
|
return rb_proc_new(bug_proc_call_super, procarg);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2014-11-16 05:11:28 -05:00
|
|
|
Init_super(VALUE klass)
|
2014-11-09 09:25:52 -05:00
|
|
|
{
|
2014-11-16 05:11:28 -05:00
|
|
|
rb_define_singleton_method(klass, "make_call_super", bug_proc_make_call_super, 1);
|
2014-11-09 09:25:52 -05:00
|
|
|
}
|