Include stack traces in the deprecation warnings.
[gitmo/Class-MOP.git] / lib / Class / MOP.pm
index 7c94f53..7f68060 100644 (file)
@@ -20,12 +20,12 @@ use Class::MOP::Method;
 use Class::MOP::Immutable;
 
 BEGIN {
-    *IS_RUNNING_ON_5_10 = ($] < 5.009_005) 
+    *IS_RUNNING_ON_5_10 = ($] < 5.009_005)
         ? sub () { 0 }
-        : sub () { 1 };    
+        : sub () { 1 };
 
     sub HAVE_ISAREV () {
-        warn "Class::MOP::HAVE_ISAREV is deprecated and will be removed in a future release. It has always returned 1 anyway.";
+        Carp::cluck("Class::MOP::HAVE_ISAREV is deprecated and will be removed in a future release. It has always returned 1 anyway.");
         return 1;
     }
 
@@ -33,10 +33,10 @@ BEGIN {
     *check_package_cache_flag = \&mro::get_pkg_gen;
 }
 
-our $VERSION   = '0.79';
+our $VERSION   = '0.80_01';
 our $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
-our $AUTHORITY = 'cpan:STEVAN';    
+our $AUTHORITY = 'cpan:STEVAN';
 
 require XSLoader;
 XSLoader::load( __PACKAGE__, $XS_VERSION );
@@ -62,6 +62,7 @@ XSLoader::load( __PACKAGE__, $XS_VERSION );
 
     # This handles instances as well as class names
     sub class_of {
+        return unless defined $_[0];
         my $class = blessed($_[0]) || $_[0];
         return $METAS{$class};
     }
@@ -178,7 +179,7 @@ sub _is_valid_class_name {
 
 # We need to add in the meta-attributes here so that
 # any subclass of Class::MOP::* will be able to
-# inherit them using &construct_instance
+# inherit them using _construct_instance
 
 ## --------------------------------------------------------
 ## Class::MOP::Package
@@ -364,7 +365,7 @@ Class::MOP::Class->meta->add_attribute(
 # we don't actually need to tie the knot with
 # Class::MOP::Class here, it is actually handled
 # within Class::MOP::Class itself in the
-# construct_class_instance method.
+# _construct_class_instance method.
 
 ## --------------------------------------------------------
 ## Class::MOP::Attribute