to avoid a segfault
- is_class_loaded check now uses code that
was improved in Moose's ClassName type
- check
+ check (Sartak)
+ - nonsensical (undef, empty, reference) class
+ names now throw a more direct error in
+ load_class (Sartak)
* Class::MOP
Class::MOP::Class
sub load_class {
my $class = shift;
+
+ if (ref($class) || !defined($class) || !length($class)) {
+ my $display = defined($class) ? $class : 'undef';
+ confess "Invalid class name ($display)";
+ }
+
# see if this is already
# loaded in the symbol table
return 1 if is_class_loaded($class);