зеркало из https://github.com/github/ruby.git
* vm.c (vm_define_method): remove type and frozen checking.
Checking is done in `rb_singleton_class()'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
492fcfda8b
Коммит
2731767b5d
|
@ -1,3 +1,8 @@
|
|||
Sun Oct 28 04:38:06 2012 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* 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@ruby-lang.org>
|
||||
|
||||
* parse.y (assign_in_cond): warn for static content object asignments
|
||||
|
|
9
vm.c
9
vm.c
|
@ -1872,14 +1872,7 @@ vm_define_method(rb_thread_t *th, VALUE obj, ID id, VALUE iseqval,
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче