[libmoo-perl] 11/43: allow captures in clearer and predicate
gregor herrmann
gregoa at debian.org
Mon Dec 26 17:56:13 UTC 2016
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to branch master
in repository libmoo-perl.
commit 8ee6990afdad896ab61bfc793cc2c4c0a62a7d97
Author: Graham Knop <haarg at haarg.org>
Date: Sun Oct 30 20:08:15 2016 -0400
allow captures in clearer and predicate
---
lib/Method/Generate/Accessor.pm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/Method/Generate/Accessor.pm b/lib/Method/Generate/Accessor.pm
index 1d2c111..aec2585 100644
--- a/lib/Method/Generate/Accessor.pm
+++ b/lib/Method/Generate/Accessor.pm
@@ -185,10 +185,11 @@ sub generate_method {
exists_predicates => $into, $pred, $name, $spec
);
} else {
+ $self->{captures} = {};
$methods{$pred} =
quote_sub "${into}::${pred}"
=> $self->_generate_simple_has('$_[0]', $name, $spec)."\n"
- => {}
+ => delete $self->{captures}
=> $quote_opts
;
}
@@ -199,10 +200,11 @@ sub generate_method {
if (my $cl = $spec->{clearer}) {
_die_overwrite($into, $cl, 'a clearer')
if !$spec->{allow_overwrite} && defined &{"${into}::${cl}"};
+ $self->{captures} = {};
$methods{$cl} =
quote_sub "${into}::${cl}"
=> $self->_generate_simple_clear('$_[0]', $name, $spec)."\n"
- => {}
+ => delete $self->{captures}
=> $quote_opts
;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmoo-perl.git
More information about the Pkg-perl-cvs-commits
mailing list