ruby-changes:25294
From: ko1 <ko1@a...>
Date: Sun, 28 Oct 2012 04:48:14 +0900 (JST)
Subject: [ruby-changes:25294] ko1:r37346 (trunk): * vm.c (vm_define_method): remove type and frozen checking.
ko1 2012-10-28 04:47:58 +0900 (Sun, 28 Oct 2012) New Revision: 37346 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37346 Log: * vm.c (vm_define_method): remove type and frozen checking. Checking is done in `rb_singleton_class()'. Modified files: trunk/ChangeLog trunk/vm.c Index: ChangeLog =================================================================== --- ChangeLog (revision 37345) +++ ChangeLog (revision 37346) @@ -1,3 +1,8 @@ +Sun Oct 28 04:38:06 2012 Koichi Sasada <ko1@a...> + + * vm.c (vm_define_method): remove type and frozen checking. + Checking is done in `rb_singleton_class()'. + Sun Oct 28 00:49:06 2012 Nobuyoshi Nakada <nobu@r...> * parse.y (assign_in_cond): warn for static content object asignments Index: vm.c =================================================================== --- vm.c (revision 37345) +++ vm.c (revision 37346) @@ -1872,14 +1872,7 @@ } if (is_singleton) { - if (FIXNUM_P(obj) || SYMBOL_P(obj) || CLASS_OF(obj) == rb_cFloat) { - rb_raise(rb_eTypeError, - "can't define singleton method \"%s\" for %s", - rb_id2name(id), rb_obj_classname(obj)); - } - - rb_check_frozen(obj); - klass = rb_singleton_class(obj); + klass = rb_singleton_class(obj); /* class and frozen checked in this API */ noex = NOEX_PUBLIC; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/