immutable refacotring
[gitmo/Class-MOP.git] / lib / Class / MOP / Class.pm
index 425364b..96d1402 100644 (file)
@@ -4,18 +4,19 @@ package Class::MOP::Class;
 use strict;
 use warnings;
 
+use Class::MOP::Instance;
+use Class::MOP::Method::Wrapped;
+
 use Carp         'confess';
 use Scalar::Util 'blessed', 'reftype', 'weaken';
 use Sub::Name    'subname';
 use B            'svref_2object';
 
-our $VERSION   = '0.20';
+our $VERSION   = '0.21';
 our $AUTHORITY = 'cpan:STEVAN';
 
 use base 'Class::MOP::Module';
 
-use Class::MOP::Instance;
-
 # Self-introspection 
 
 sub meta { Class::MOP::Class->initialize(blessed($_[0]) || $_[0]) }
@@ -69,7 +70,6 @@ sub construct_class_instance {
                         : blessed($class))
                     : $class);
 
-    $class = blessed($class) || $class;
     # now create the metaclass
     my $meta;
     if ($class =~ /^Class::MOP::Class$/) {
@@ -173,6 +173,7 @@ sub check_metaclass_compatability {
 
     sub is_anon_class {
         my $self = shift;
+        no warnings 'uninitialized';
         $self->name =~ /^$ANON_CLASS_PREFIX/ ? 1 : 0;        
     }
 
@@ -190,6 +191,7 @@ sub check_metaclass_compatability {
     # really need to be handled explicitly
     sub DESTROY {
         my $self = shift;
+        no warnings 'uninitialized';        
         return unless $self->name =~ /^$ANON_CLASS_PREFIX/;
         my ($serial_id) = ($self->name =~ /^$ANON_CLASS_PREFIX(\d+)/);
         no strict 'refs';