Checking in changes prior to tagging of version 0.91.
[gitmo/Mouse.git] / lib / Mouse / Meta / Class.pm
index be95702..dc638df 100644 (file)
@@ -78,9 +78,7 @@ sub verify_superclass {
         # The metaclass of $super is not initialized.
         # i.e. it might be Mouse::Object, a mixin package (e.g. Exporter),
         # or a foreign class including Moose classes.
-
-        # checks if $super is a foreign class (i.e. non-Mouse class)
-        # see also Mouse::Foreign::Meta::Role::Class
+        # See also Mouse::Foreign::Meta::Role::Class.
         my $mm = $super->can('meta');
         if(!($mm && $mm == \&Mouse::Util::meta)) {
             if($super->can('new') or $super->can('DESTROY')) {
@@ -95,9 +93,11 @@ sub verify_superclass {
 
 sub inherit_from_foreign_class {
     my($class, $super) = @_;
-    Carp::carp("You inherit from non-Mouse class ($super),"
-        . " but it is unlikely to work correctly."
-        . " Please consider using MouseX::Foreign");
+    if($ENV{PERL_MOUSE_STRICT}) {
+        Carp::carp("You inherit from non-Mouse class ($super),"
+            . " but it is unlikely to work correctly."
+            . " Please consider using MouseX::Foreign");
+    }
     return;
 }
 
@@ -243,7 +243,7 @@ sub add_attribute {
     # then register the attribute to the metaclass
     $attr->{insertion_order}   = keys %{ $self->{attributes} };
     $self->{attributes}{$name} = $attr;
-    delete $self->{_mouse_cache}; # clears internal cache
+    $self->_invalidate_metaclass_cache();
 
     if(!$attr->{associated_methods} && ($attr->{is} || '') ne 'bare'){
         Carp::carp(qq{Attribute ($name) of class }.$self->name
@@ -415,8 +415,7 @@ sub add_override_method_modifier {
         local $Mouse::SUPER_PACKAGE = $package;
         local $Mouse::SUPER_BODY    = $super_body;
         local @Mouse::SUPER_ARGS    = @_;
-
-        $code->(@_);
+        &{$code};
     });
     return;
 }
@@ -433,10 +432,10 @@ sub add_augment_method_modifier {
     my $super_package = $super->package_name;
     my $super_body    = $super->body;
 
-    $self->add_method($name => sub{
+    $self->add_method($name => sub {
         local $Mouse::INNER_BODY{$super_package} = $code;
         local $Mouse::INNER_ARGS{$super_package} = [@_];
-        $super_body->(@_);
+        &{$super_body};
     });
     return;
 }
@@ -471,7 +470,7 @@ Mouse::Meta::Class - The Mouse class metaclass
 
 =head1 VERSION
 
-This document describes Mouse version 0.76
+This document describes Mouse version 0.91
 
 =head1 DESCRIPTION