[Catalyst-commits] r7911 -
Catalyst-Runtime/5.80/branches/moose/lib/Catalyst
groditi at dev.catalyst.perl.org
groditi at dev.catalyst.perl.org
Thu Jun 12 17:43:59 BST 2008
Author: groditi
Date: 2008-06-12 17:43:58 +0100 (Thu, 12 Jun 2008)
New Revision: 7911
Modified:
Catalyst-Runtime/5.80/branches/moose/lib/Catalyst/ClassData.pm
Log:
make class data unlock and relock classes if immutable
Modified: Catalyst-Runtime/5.80/branches/moose/lib/Catalyst/ClassData.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/moose/lib/Catalyst/ClassData.pm 2008-06-12 13:24:28 UTC (rev 7910)
+++ Catalyst-Runtime/5.80/branches/moose/lib/Catalyst/ClassData.pm 2008-06-12 16:43:58 UTC (rev 7911)
@@ -34,9 +34,17 @@
unless ref $accessor eq 'CODE';
my $meta = $class->meta;
+ my $immutable_options;
+ if( $meta->is_immutable ){
+ $immutable_options = $meta->get_immutable_options;
+ $meta->make_mutable;
+ }
my $alias = "_${attribute}_accessor";
$meta->add_method($alias, $accessor);
$meta->add_method($attribute, $accessor);
+ if(defined $immutable_options){
+ $meta->make_immutable($immutable_options);
+ }
$class->$attribute($_[2]) if(@_ > 2);
return $accessor;
}
More information about the Catalyst-commits
mailing list