Move BUILDALL and DEMOLISHALL into XS
[gitmo/Mouse.git] / lib / Mouse / PurePerl.pm
index fc6b457..5741014 100644 (file)
@@ -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__
 
@@ -522,7 +540,7 @@ Mouse::PurePerl - A Mouse guts in pure Perl
 
 =head1 VERSION
 
-This document describes Mouse version 0.43
+This document describes Mouse version 0.44
 
 =head1 SEE ALSO