summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-12-20 18:19:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-12-20 18:19:42 +0000
commitc29a112e14749cb9fb21bc21139c1b390bf2952d (patch)
tree0732262d45b83088b7828a70c0624c9dabbaf702 /eval.c
parentb7a58b06502d4ddceff9b1cfc0f9e62381442b6b (diff)
* eval.c (rb_mod_define_method): must not convert Method to Proc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/eval.c b/eval.c
index f19998ead9..c70b24384d 100644
--- a/eval.c
+++ b/eval.c
@@ -6952,11 +6952,8 @@ rb_mod_define_method(argc, argv, mod)
else if (argc == 2) {
id = rb_to_id(argv[0]);
body = argv[1];
- if (rb_obj_is_kind_of(body, rb_cMethod)) {
- body = method_proc(body);
- }
- else if (!rb_obj_is_proc(body)) {
- rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc)",
+ if (!rb_obj_is_kind_of(body, rb_cMethod) && !rb_obj_is_proc(body)) {
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc/Method)",
rb_class2name(CLASS_OF(body)));
}
}
@@ -6971,7 +6968,7 @@ rb_mod_define_method(argc, argv, mod)
}
else {
/* type error */
- rb_raise(rb_eTypeError, "wrong argument type (expected Proc)");
+ rb_raise(rb_eTypeError, "wrong argument type (expected Proc/Method)");
}
if (SCOPE_TEST(SCOPE_PRIVATE)) {