diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-30 05:06:52 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-30 05:06:52 +0000 |
commit | 6fc04282235d57ace32e5cd981737d4ede6f15aa (patch) | |
tree | a4acf2a0115716e677477b16022801eddf58cb0a /proc.c | |
parent | 2e2e0193b93ec4629f0704d719849e09a08e9429 (diff) | |
download | ruby-6fc04282235d57ace32e5cd981737d4ede6f15aa.tar.gz ruby-6fc04282235d57ace32e5cd981737d4ede6f15aa.tar.xz ruby-6fc04282235d57ace32e5cd981737d4ede6f15aa.zip |
* proc.c (rb_obj_define_method): reverted. [ruby-talk:266637]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -1,6 +1,6 @@ /********************************************************************** - proc.c - Proc, Bindng, Env + proc.c - Proc, Binding, Env $Author$ $Date$ @@ -148,7 +148,6 @@ binding_alloc(VALUE klass) rb_binding_t *bind; obj = Data_Make_Struct(klass, rb_binding_t, binding_mark, binding_free, bind); - MEMZERO(bind, rb_binding_t, 1); return obj; } @@ -972,6 +971,14 @@ rb_mod_define_method(int argc, VALUE *argv, VALUE mod) return body; } +static VALUE +rb_obj_define_method(int argc, VALUE *argv, VALUE obj) +{ + VALUE klass = rb_singleton_class(obj); + + return rb_mod_define_method(argc, argv, klass); +} + /* * MISSING: documentation @@ -1495,6 +1502,9 @@ Init_Proc(void) /* Module#*_method */ rb_define_method(rb_cModule, "instance_method", rb_mod_method, 1); rb_define_private_method(rb_cModule, "define_method", rb_mod_define_method, -1); + + /* Kernel */ + rb_define_method(rb_mKernel, "define_singleton_method", rb_obj_define_method, -1); } /* |