*check_package_cache_flag = \&mro::get_pkg_gen;
}
-our $VERSION = '0.67';
+our $VERSION = '0.72';
our $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
}
sub load_first_existing_class {
- my @classes = @_;
+ my @classes = @_
+ or return;
foreach my $class (@classes) {
unless ( _is_valid_class_name($class) ) {
}
}
- if ($found) {
- return get_metaclass_by_name($found) || $found;
- }
+ return $found if $found;
confess join(
"\n",
$exceptions{$_}
)
} @classes
- ) if keys %exceptions;
+ );
}
sub _try_load_one_class {
}
sub load_class {
- load_first_existing_class($_[0]);
+ my $class = load_first_existing_class($_[0]);
+ return get_metaclass_by_name($class) || $class;
}
sub _is_valid_class_name {
sub is_class_loaded {
my $class = shift;
- return 0 if ref($class) || !defined($class) || !length($class);
+ return 0 unless _is_valid_class_name($class);
# walk the symbol table tree to avoid autovififying
# \*{${main::}{"Foo::"}} == \*main::Foo::
## --------------------------------------------------------
## Now close all the Class::MOP::* classes
-# NOTE:
-# we don't need to inline the
-# constructors or the accessors
-# this only lengthens the compile
-# time of the MOP, and gives us
-# no actual benefits.
+# NOTE: we don't need to inline the the accessors this only lengthens
+# the compile time of the MOP, and gives us no actual benefits.
$_->meta->make_immutable(
inline_constructor => 1,
Given a list of class names, this function will attempt to load each
one in turn.
-If it finds a class it can load, it will return that class's
-metaclass. If none of the classes can be loaded, it will throw an
-exception.
+If it finds a class it can load, it will return that class' name.
+If none of the classes can be loaded, it will throw an exception.
=back