Project

General

Profile

Feature #2740 » const_missing_nesting.diff

Patch that provides the nesting to const_missing if arity != 1 - wycats (Yehuda Katz), 02/13/2010 08:53 AM

View differences:

variable.c
static VALUE
const_missing(VALUE klass, ID id)
{
return rb_funcall(klass, rb_intern("const_missing"), 1, ID2SYM(id));
ID const_missing_id = rb_intern("const_missing");
int arity = rb_obj_method_arity(klass, const_missing_id);
if(arity == 1)
return rb_funcall(klass, const_missing_id, 1, ID2SYM(id));
else
return rb_funcall(klass, const_missing_id, 2, ID2SYM(id), rb_funcall(rb_cModule, rb_intern("nesting"), 0));
}
(1-1/2)