From: Shawn M Moore Date: Tue, 10 Jun 2008 01:04:37 +0000 (+0000) Subject: If we re-import Mouse, don't thrash the class's superclasses. X-Git-Tag: 0.04~84 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ca73a2089db9f6fb7a1c5fb282f4ba7277d27e25;p=gitmo%2FMouse.git If we re-import Mouse, don't thrash the class's superclasses. --- diff --git a/lib/Mouse.pm b/lib/Mouse.pm index d2b2fc6..fce4bd8 100644 --- a/lib/Mouse.pm +++ b/lib/Mouse.pm @@ -62,8 +62,9 @@ do { strict->import; warnings->import; - no strict 'refs'; - @{ $CALLER . '::ISA' } = 'Mouse::Object'; + my $meta = Mouse::Class->initialize($CALLER); + $meta->superclasses('Mouse::Object') + unless $meta->superclasses; goto $exporter; } diff --git a/t/005-extends.t b/t/005-extends.t index c84fd00..d3d6af1 100644 --- a/t/005-extends.t +++ b/t/005-extends.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 5; +use Test::More tests => 7; use lib 't/lib'; do { @@ -29,3 +29,11 @@ isa_ok($child => 'Mouse::Object'); can_ok('Mouse::TestClass' => qw(mouse antimouse)); +eval " + package Child; + use Mouse; +"; + +isa_ok($child => 'Class'); +isa_ok($child => 'Mouse::Object'); +