my %METAS;
-# XXX: work around a warning "useless use of a constant in void context" in 5.6.2
-if(&Mouse::Util::MOUSE_XS){
+if(Mouse::Util::MOUSE_XS){
# register meta storage for performance
Mouse::Util::__register_metaclass_storage(\%METAS, 0);
Mouse::Util->import({ into => 'Mouse::Meta::Method::Destructor::XS' }, ':meta');
Mouse::Util->import({ into => 'Mouse::Meta::Method::Accessor::XS' }, ':meta');
return 1;
- };
+ } || 0;
#warn $@ if $@;
}
is_deeply([splice @called], [], "no BUILD calls yet");
-with_immutable {
+with_immutable sub {
my $object = Class->new;
ok defined($object), $object->meta->is_immutable() ? 'mutable' : 'immutable';
$child->BUILDALL({});
is_deeply([splice @called], ["Class::BUILD", "Child::BUILD"], 'BUILDALL');
-} qw(Class Child);
+}, qw(Class Child);
is_deeply([splice @called], [], "no DEMOLISH calls yet");
-with_immutable {
+with_immutable sub {
ok(Class->meta, Class->meta->is_immutable ? 'mutable' : 'immutable');
{
}
is_deeply([splice @called], ['Child::DEMOLISH', 'Class::DEMOLISH'], 'DEMOLISHALL');
-} qw(Class Child);
+}, qw(Class Child);