[Moose-commits] r7551 - in Mouse/trunk: lib/Mouse/Meta/Method t

sartak at code2.0beta.co.uk sartak at code2.0beta.co.uk
Thu Feb 5 02:07:30 GMT 2009


Author: sartak
Date: 2009-02-04 18:07:30 -0800 (Wed, 04 Feb 2009)
New Revision: 7551

Modified:
   Mouse/trunk/lib/Mouse/Meta/Method/Constructor.pm
   Mouse/trunk/t/040-existing-subclass.t
Log:
Don't require there to be a BUILDARGS method; fix undef warning

Modified: Mouse/trunk/lib/Mouse/Meta/Method/Constructor.pm
===================================================================
--- Mouse/trunk/lib/Mouse/Meta/Method/Constructor.pm	2009-02-05 02:00:36 UTC (rev 7550)
+++ Mouse/trunk/lib/Mouse/Meta/Method/Constructor.pm	2009-02-05 02:07:30 UTC (rev 7551)
@@ -136,7 +136,7 @@
     my $self = shift;
     my $meta = shift;
 
-    if ($meta->name->can('BUILDARGS') != Mouse::Object->can('BUILDARGS')) {
+    if ($meta->name->can('BUILDARGS') && $meta->name->can('BUILDARGS') != Mouse::Object->can('BUILDARGS')) {
         return '$class->BUILDARGS(@_)';
     }
 

Modified: Mouse/trunk/t/040-existing-subclass.t
===================================================================
--- Mouse/trunk/t/040-existing-subclass.t	2009-02-05 02:00:36 UTC (rev 7550)
+++ Mouse/trunk/t/040-existing-subclass.t	2009-02-05 02:07:30 UTC (rev 7551)
@@ -6,7 +6,7 @@
 BEGIN {
     eval "use Test::Output;";
     plan skip_all => "Test::Output is required for this test" if $@;
-    plan tests => 2;
+    plan tests => 3;
 }
 
 do {
@@ -45,3 +45,15 @@
     'Mouse does not warn about inlining a constructor when the superclass inlined a constructor',
 );
 
+do {
+    package Baz;
+
+    package Quux;
+    BEGIN { our @ISA = 'Baz' }
+    use Mouse;
+
+    __PACKAGE__->meta->make_immutable;
+};
+
+ok(Quux->new);
+




More information about the Moose-commits mailing list