summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-27 19:47:58 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-27 19:47:58 +0000
commit2731767b5dfefacf139ba4eedb25a9b550ad5454 (patch)
treed67e559219efd910b96cfd75798f6298c9bdd766 /vm.c
parent492fcfda8bf3fd127eb0a31721ab594b2a73a6e6 (diff)
* 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
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/vm.c b/vm.c
index c9a6866d6f..39efee27c9 100644
--- a/vm.c
+++ b/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;
}