use Class::MOP::Immutable;
-our $VERSION = '0.43';
-our $AUTHORITY = 'cpan:STEVAN';
+BEGIN {
+ our $VERSION = '0.50';
+ our $AUTHORITY = 'cpan:STEVAN';
+
+ use XSLoader;
+ XSLoader::load( 'Class::MOP', $VERSION );
+
+ unless ($] < 5.009_005) {
+ no warnings 'redefine', 'prototype';
+ *check_package_cache_flag = \&mro::get_pkg_gen;
+ }
+}
{
# Metaclasses are singletons, so we cache them here.
if ref $options{builder} || !(defined $options{builder});
confess("Setting both default and builder is not allowed.")
if exists $options{default};
+ } else {
+ (Class::MOP::Attribute::is_default_a_coderef(\%options))
+ || confess("References are not allowed as default values, you must ".
+ "wrap then in a CODE reference (ex: sub { [] } and not [])")
+ if exists $options{default} && ref $options{default};
}
- (Class::MOP::Attribute::is_default_a_coderef(\%options))
- || confess("References are not allowed as default values, you must ".
- "wrap then in a CODE reference (ex: sub { [] } and not [])")
- if exists $options{default} && ref $options{default};
-
# return the new object
$class->meta->new_object(name => $name, %options);
});
determine as best it can if the C<$class_name> is loaded, it
is probably correct about 99% of the time.
+=item B<check_package_cache_flag ($pkg)>
+
+=item B<get_code_info ($code)>
+
=back
=head2 Metaclass cache functions
Yuval (nothingmuch) Kogman
+Scott (konobi) McWhirter
+
=head1 COPYRIGHT AND LICENSE
Copyright 2006, 2007 by Infinity Interactive, Inc.