From: Chris Prather Date: Tue, 12 Jun 2007 19:28:15 +0000 (+0000) Subject: fix handles generated methods to use goto() so caller() comes out properly on the... X-Git-Tag: 0_23~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cbe25729715bb0eade9c41b7f609dbdb5b4c01a3;p=gitmo%2FMoose.git fix handles generated methods to use goto() so caller() comes out properly on the other side. --- diff --git a/Changes b/Changes index a0b9508..47b769d 100644 --- a/Changes +++ b/Changes @@ -6,6 +6,9 @@ Revision history for Perl extension Moose * Moose::Meta::Class - Modify make_immutable to work with the new Class::MOP immutable mechanism + POD + very basic test (groditi) + * Moose::Meta::Attribute + - Fix handles to use goto() so that caller() comes out properly on + the other side (perigrin) 0.22 Thurs. May 31, 2007 * Moose::Util::TypeConstraints diff --git a/lib/Moose.pm b/lib/Moose.pm index 1046b84..504e511 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -801,6 +801,8 @@ Scott (konobi) McWhirter Yuval (nothingmuch) Kogman +Chris (perigrin) Prather + ... and many other #moose folks =head1 COPYRIGHT AND LICENSE diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index 47587a6..74ba8bf 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -362,7 +362,9 @@ sub install_accessors { # we should check for lack of # a callable return value from # the accessor here - ((shift)->$accessor_name())->$method_to_call(@_); + my $proxy = (shift)->$accessor_name(); + @_ = ($proxy, @_); + goto &{ $proxy->can($method_to_call)}; }); } }