Index: proc.c =================================================================== --- proc.c (revision 18724) +++ proc.c (working copy) @@ -1332,6 +1332,18 @@ return method; } +static VALUE +method_iseq(VALUE method) +{ + struct METHOD *data; + + Data_Get_Struct(method, struct METHOD, data); + + VALUE iseqval = (VALUE)data->body->nd_body; + + return iseqval; +} + int rb_node_arity(NODE* body) { @@ -1790,6 +1802,7 @@ rb_define_method(rb_cMethod, "name", method_name, 0); rb_define_method(rb_cMethod, "owner", method_owner, 0); rb_define_method(rb_cMethod, "unbind", method_unbind, 0); + rb_define_method(rb_cMethod, "iseq", method_iseq, 0); rb_define_method(rb_mKernel, "method", rb_obj_method, 1); rb_define_method(rb_mKernel, "public_method", rb_obj_public_method, 1); @@ -1807,6 +1820,7 @@ rb_define_method(rb_cUnboundMethod, "name", method_name, 0); rb_define_method(rb_cUnboundMethod, "owner", method_owner, 0); rb_define_method(rb_cUnboundMethod, "bind", umethod_bind, 1); + rb_define_method(rb_cUnboundMethod, "iseq", method_iseq, 0); /* Module#*_method */ rb_define_method(rb_cModule, "instance_method", rb_mod_instance_method, 1);