Revision history for Perl extension Class-MOP.
+0.75 Tue, December 31, 2008
+ * Class::MOP::Class
+ - A class that was made immutable and then mutable could end up
+ sharing an immutable transformer object
+ (Class::MOP::Immutable) with other classes, leading to all
+ sorts of odd bugs. Reported by t0m. (Dave Rolsky)
+
0.74 Tue, December 25, 2008
* MOP.xs
- Add an xs implementation of Class::MOP::is_class_loaded (closes
sub get_immutable_transformer {
my $self = shift;
if( $self->is_mutable ){
- my $class = ref $self || $self;
- return $IMMUTABLE_TRANSFORMERS{$class} ||= $self->create_immutable_transformer;
+ return $IMMUTABLE_TRANSFORMERS{$self->name} ||= $self->create_immutable_transformer;
}
confess "unable to find transformer for immutable class"
unless exists $IMMUTABLE_OPTIONS{$self->name};
use strict;
use warnings;
-use Test::More tests => 113;
+use Test::More tests => 114;
use Test::Exception;
use Scalar::Util;
for qw(get_meta_instance compute_all_applicable_attributes
class_precedence_list get_method_map );
}
+
+{
+ Foo->meta->make_immutable;
+ Bar->meta->make_immutable;
+ Bar->meta->make_mutable;
+
+ isnt( Foo->meta->get_immutable_transformer, Bar->meta->get_immutable_transformer,
+ 'Foo and Bar should have different immutable transformer objects' );
+}