From: Guillermo Roditi Date: Sun, 3 Jun 2007 00:18:47 +0000 (+0000) Subject: use $self->name instead of refaddr. It would be totally impossible to debug otherwise. X-Git-Tag: 0_39~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7f63694d3a5c6ce66c62bd0dfa96dcbd6d26d2be;p=gitmo%2FClass-MOP.git use $self->name instead of refaddr. It would be totally impossible to debug otherwise. --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index 7950997..b8a80b0 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -9,7 +9,7 @@ use Class::MOP::Instance; use Class::MOP::Method::Wrapped; use Carp 'confess'; -use Scalar::Util 'blessed', 'reftype', 'weaken', 'refaddr'; +use Scalar::Util 'blessed', 'reftype', 'weaken'; use Sub::Name 'subname'; use B 'svref_2object'; @@ -770,7 +770,7 @@ sub is_immutable { 0 } my $transformer = $IMMUTABLE_TRANSFORMERS{$class}; $transformer->make_metaclass_immutable($self, %options); - $IMMUTABLE_OPTIONS{refaddr $self} = + $IMMUTABLE_OPTIONS{$self->name} = { %options, IMMUTABLE_TRANSFORMER => $transformer }; if( exists $options{debug} && $options{debug} ){ @@ -782,7 +782,7 @@ sub is_immutable { 0 } sub make_mutable{ my $self = shift; return if $self->is_mutable; - my $options = delete $IMMUTABLE_OPTIONS{refaddr $self}; + my $options = delete $IMMUTABLE_OPTIONS{$self->name}; confess "unable to find immutabilizing options" unless $options; my $transformer = delete $options->{IMMUTABLE_TRANSFORMER}; $transformer->make_metaclass_mutable($self, %$options);