ruby-changes:40185
From: nobu <ko1@a...>
Date: Sat, 24 Oct 2015 16:36:06 +0900 (JST)
Subject: [ruby-changes:40185] nobu:r52266 (trunk): vm_method.c: remove common code
nobu 2015-10-24 16:35:57 +0900 (Sat, 24 Oct 2015) New Revision: 52266 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52266 Log: vm_method.c: remove common code * vm_method.c (rb_undef): remove code almost common to proc.c. Modified files: trunk/vm_method.c Index: vm_method.c =================================================================== --- vm_method.c (revision 52265) +++ vm_method.c (revision 52266) @@ -1118,22 +1118,7 @@ rb_undef(VALUE klass, ID id) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1118 if (UNDEFINED_METHOD_ENTRY_P(me) || UNDEFINED_REFINED_METHOD_P(me->def)) { - const char *s0 = " class"; - VALUE c = klass; - - if (FL_TEST(c, FL_SINGLETON)) { - VALUE obj = rb_ivar_get(klass, attached); - - if (RB_TYPE_P(obj, T_MODULE) || RB_TYPE_P(obj, T_CLASS)) { - c = obj; - s0 = ""; - } - } - else if (RB_TYPE_P(c, T_MODULE)) { - s0 = " module"; - } - rb_name_error(id, "undefined method `%"PRIsVALUE"' for%s `%"PRIsVALUE"'", - QUOTE_ID(id), s0, rb_class_name(c)); + rb_method_name_error(klass, rb_id2str(id)); } rb_add_method(klass, id, VM_METHOD_TYPE_UNDEF, 0, METHOD_VISI_PUBLIC); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/