From: gfx Date: Mon, 16 Nov 2009 11:11:05 +0000 (+0900) Subject: Name subroutines in add_method() X-Git-Tag: 0.40_06~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=855eff0e9edf07f4d7af3eb245a3139fa6c6bd05;p=gitmo%2FMouse.git Name subroutines in add_method() --- diff --git a/xs-src/Mouse.xs b/xs-src/Mouse.xs index 627eabd..075b806 100644 --- a/xs-src/Mouse.xs +++ b/xs-src/Mouse.xs @@ -419,14 +419,16 @@ CODE: set_slot(methods, name, code); /* $self->{methods}{$name} = $code */ - /* TODO: name the CODE ref if it's anonymous */ - //code_entity = (CV*)SvRV(code_ref); - //if(CvANON(code_entity) - // && CvGV(code_entity) /* a cv under construction has no gv */ ){ - - // CvGV(code_entity) = gv; - // CvANON_off(code_entity); - //} + /* name the CODE ref if it's anonymous */ + { + CV* const code_entity = (CV*)SvRV(code_ref); + if(CvANON(code_entity) + && CvGV(code_entity) /* a cv under construction has no gv */ ){ + + CvGV(code_entity) = gv; + CvANON_off(code_entity); + } + } } MODULE = Mouse PACKAGE = Mouse::Meta::Class