+ - provide 'no Moo::sification' to forcibly disable metaclass inflation
+ - switch to Devel::GlobalDestruction to correctly disarm the
+ Moo::sification trigger under threads
- make extends after has work
- name subs if Sub::Name is available for better stracktraces
- undefer all subs before creating a concrete Moose metaclass
'strictures' => 1.001001,
'Module::Runtime' => 0.013,
'Role::Tiny' => 1.000900,
+ 'Devel::GlobalDestruction' => '0.0401',
);
# have to do this since old EUMM dev releases miss the eval $VERSION line
use strictures 1;
use base qw(Moo::Object);
+use Devel::GlobalDestruction ();
use Sub::Quote;
use Moo::_Utils;
use B qw(perlstring);
local $@;
require Moo::_Utils;
eval {
- $self->DEMOLISHALL($Moo::_Utils::_in_global_destruction);
+ $self->DEMOLISHALL(Devel::GlobalDestruction::in_global_destruction);
};
$@;
};
use strictures 1;
use Module::Runtime qw(require_module);
+use Devel::GlobalDestruction;
use base qw(Exporter);
use Moo::_mro;
can_haz_subname ? Sub::Name::subname(@_) : $_[1];
}
-our $_in_global_destruction = 0;
-END { $_in_global_destruction = 1 }
-
sub STANDARD_DESTROY {
my $self = shift;
local $?;
local $@;
eval {
- $self->DEMOLISHALL($_in_global_destruction);
+ $self->DEMOLISHALL(in_global_destruction);
};
$@;
};
package Moo::sification;
use strictures 1;
+use Devel::GlobalDestruction;
-END { our $sky_falling = 1 }
+sub unimport { our $disarmed = 1 }
sub Moo::HandleMoose::AuthorityHack::DESTROY {
- unless (our $sky_falling) {
+ unless (our $disarmed or in_global_destruction) {
require Moo::HandleMoose;
Moo::HandleMoose->import;
}