From: Matt S Trout Date: Tue, 9 Dec 2008 22:06:59 +0000 (+0000) Subject: unsupport passing meta-attr object to triggers because (a) it's not tested (b) it... X-Git-Tag: 0.65~20^2~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ec2e2ee5a0f010fe09d57e0176717b6b4f5671a2;p=gitmo%2FMoose.git unsupport passing meta-attr object to triggers because (a) it's not tested (b) it's not documented (c) it makes it impossible to not close over the meta-attr objects --- diff --git a/lib/Moose/Meta/Method/Accessor.pm b/lib/Moose/Meta/Method/Accessor.pm index 879c018..d93e080 100644 --- a/lib/Moose/Meta/Method/Accessor.pm +++ b/lib/Moose/Meta/Method/Accessor.pm @@ -228,7 +228,7 @@ sub _inline_trigger { my ($self, $instance, $value) = @_; my $attr = $self->associated_attribute; return '' unless $attr->has_trigger; - return sprintf('$attr->trigger->(%s, %s, $attr);', $instance, $value); + return sprintf('$attr->trigger->(%s, %s);', $instance, $value); } sub _inline_get { diff --git a/lib/Moose/Meta/Method/Constructor.pm b/lib/Moose/Meta/Method/Constructor.pm index 91da69e..a52937b 100644 --- a/lib/Moose/Meta/Method/Constructor.pm +++ b/lib/Moose/Meta/Method/Constructor.pm @@ -222,8 +222,6 @@ sub _generate_triggers { '$instance', ("'" . $attr->name . "'") ) - . ', ' - . '$attrs->[' . $i . ']' . ');' ."\n}" );