X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FPurePerl.pm;h=5741014eec12c46e0445fbb3172719dd5b2b4179;hp=a67857cba8da64631fd3bbd57816f99e1b28b338;hb=adb5eb76f6875283f11d6f2b8d281568f0a4a688;hpb=f35b50f2b89b223295501395f16f3fd651db8cf5 diff --git a/lib/Mouse/PurePerl.pm b/lib/Mouse/PurePerl.pm index a67857c..5741014 100644 --- a/lib/Mouse/PurePerl.pm +++ b/lib/Mouse/PurePerl.pm @@ -513,6 +513,24 @@ sub DESTROY { die $e if $e; # rethrow } +sub BUILDALL { + my $self = shift; + + # short circuit + return unless $self->can('BUILD'); + + for my $class (reverse $self->meta->linearized_isa) { + my $build = Mouse::Util::get_code_ref($class, 'BUILD') + || next; + + $self->$build(@_); + } + return; +} + +sub DEMOLISHALL; +*DEMOLISHALL = \&DESTROY; + 1; __END__