use MRO::Compat;
use Carp 'confess';
-use Scalar::Util 'weaken', 'reftype', 'blessed';
+use Scalar::Util 'weaken', 'isweak', 'reftype', 'blessed';
use Data::OptList;
use Try::Tiny;
? sub () { 0 }
: sub () { 1 };
- *DEBUG_NO_META = ($ENV{DEBUG_NO_META})
- ? sub () { 1 }
- : sub () { 0 };
-
# this is either part of core or set up appropriately by MRO::Compat
*check_package_cache_flag = \&mro::get_pkg_gen;
}
-our $VERSION = '1.08';
+our $VERSION = '1.11';
our $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
sub get_metaclass_by_name { $METAS{$_[0]} }
sub store_metaclass_by_name { $METAS{$_[0]} = $_[1] }
sub weaken_metaclass { weaken($METAS{$_[0]}) }
+ sub metaclass_is_weak { isweak($METAS{$_[0]}) }
sub does_metaclass_exist { exists $METAS{$_[0]} && defined $METAS{$_[0]} }
sub remove_metaclass_by_name { delete $METAS{$_[0]}; return }
# NOTE:
# we just alias the original method
# rather than re-produce it here
- '_full_method_map' => \&Class::MOP::Mixin::HasMethods::_full_method_map
+ '_method_map' => \&Class::MOP::Mixin::HasMethods::_method_map
},
default => sub { {} }
))
),
);
+## --------------------------------------------------------
+## Class::MOP::Object
+
+# need to replace the meta method there with a real meta method object
+Class::MOP::Object->meta->_add_meta_method('meta');
+
+## --------------------------------------------------------
+## Class::MOP::Mixin
+
+# need to replace the meta method there with a real meta method object
+Class::MOP::Mixin->meta->_add_meta_method('meta');
+
require Class::MOP::Deprecated unless our $no_deprecated;
# we need the meta instance of the meta instance to be created now, in order
Class::MOP::Method::Accessor
Class::MOP::Method::Constructor
Class::MOP::Method::Wrapped
+
+ Class::MOP::Method::Meta
/;
$_->meta->make_immutable(
function will weaken the reference to the metaclass stored
in C<$name>.
+=item B<Class::MOP::metaclass_is_weak($name)>
+
+Returns true if the metaclass for C<$name> has been weakened
+(via C<weaken_metaclass>).
+
=item B<Class::MOP::does_metaclass_exist($name)>
This will return true of there exists a metaclass stored in the