summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-10 05:34:50 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-10 05:34:50 +0000
commit5ee029f62cbb728453f6db3ae54127a376696447 (patch)
tree67f23f01c6c105121d461d0b1ca84725688f58b0 /eval.c
parent7ded13f54b4963f9e535d4909c9957d33f68f1ed (diff)
* eval.c (rb_f_public_send): rename invoke_method to public_send.
it now invokes public method only no matter how it's called. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/eval.c b/eval.c
index 6cfd503e60..e7d144e83a 100644
--- a/eval.c
+++ b/eval.c
@@ -1509,27 +1509,19 @@ rb_f_send(int argc, VALUE *argv, VALUE recv)
/*
* call-seq:
- * obj.invoke_method(symbol [, args...]) => obj
+ * obj.public_send(symbol [, args...]) => obj
*
* Invokes the method identified by _symbol_, passing it any
- * arguments specified. Unlike send, invoke_method calls public
- * methods only, unless it's invoked in a function call style.
+ * arguments specified. Unlike send, public_send calls public
+ * methods only.
*
- * 1.invoke_method(:puts, "hello") # causes NoMethodError
+ * 1.public_send(:puts, "hello") # causes NoMethodError
*/
VALUE
-rb_invoke_method(int argc, VALUE *argv, VALUE recv)
+rb_f_public_send(int argc, VALUE *argv, VALUE recv)
{
- int rb_vm_cfunc_funcall_p(rb_control_frame_t *);
- int scope = NOEX_PUBLIC;
- rb_thread_t *th = GET_THREAD();
-
- if (rb_vm_cfunc_funcall_p(th->cfp)) {
- scope = NOEX_NOSUPER | NOEX_PRIVATE;
- }
-
- return send_internal(argc, argv, recv, scope);
+ return send_internal(argc, argv, recv, NOEX_PUBLIC);
}
VALUE
@@ -2760,7 +2752,7 @@ Init_eval(void)
rb_define_method(rb_cBasicObject, "__send__", rb_f_send, -1);
rb_define_method(rb_mKernel, "send", rb_f_send, -1);
- rb_define_method(rb_mKernel, "invoke_method", rb_invoke_method, -1);
+ rb_define_method(rb_mKernel, "public_send", rb_f_public_send, -1);
rb_define_method(rb_mKernel, "instance_eval", rb_obj_instance_eval, -1);
rb_define_method(rb_mKernel, "instance_exec", rb_obj_instance_exec, -1);