X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FClassData.pm;h=6174ffd7a6475a35299d852e1c13b4a238467152;hb=8be895a7aa1d89a8004cc0cd37962025bc5c3b3d;hp=424cb7730b63a430dffbe9ac7b46537e346669d2;hpb=8a440eba91ace539964b76901ad0e9274ece4ec6;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/ClassData.pm b/lib/Catalyst/ClassData.pm index 424cb77..6174ffd 100644 --- a/lib/Catalyst/ClassData.pm +++ b/lib/Catalyst/ClassData.pm @@ -14,7 +14,7 @@ sub mk_classdata { my $accessor = sub { my $pkg = ref $_[0] || $_[0]; my $meta = $pkg->Class::MOP::Object::meta(); - if (@_ > 1){ + if (@_ > 1) { $meta->namespace->{$attribute} = \$_[1]; return $_[1]; } @@ -29,13 +29,6 @@ sub mk_classdata { return ${$v}; } else { foreach my $super ( $meta->linearized_isa ) { - # If there is a code symbol for this attr in a parent class, - # then copy it into our package. Is this the correct - # fix for C::D::I back-compat? (t0m) - my $parent_symbol = *{"${super}::${attribute}"}{CODE} ? \&{"${super}::${attribute}"} : undef; - if (defined $parent_symbol) { - *{"${pkg}::${attribute}"} = $parent_symbol; - } # tighter version of same after # my $super_meta = Moose::Meta::Class->initialize($super); my $v = ${"${super}::"}{$attribute} ? *{"${super}::${attribute}"}{SCALAR} : undef; @@ -60,7 +53,7 @@ sub mk_classdata { $meta->add_method($alias, $accessor); $meta->add_method($attribute, $accessor); if(defined $immutable_options){ - $meta->make_immutable($immutable_options); + $meta->make_immutable(%{ $immutable_options }); } $class->$attribute($_[2]) if(@_ > 2); return $accessor;