X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FUtil.pm;h=19876a17f4068ff4eb0d1e094d21ab7d3def6eea;hp=107f700b26c114dbbe0450fe75cd4d73dbf6dd87;hb=45f22b92d1140ad101f7c3112bc565890ea5a1ad;hpb=6a4ab70d0af178844599e0ccedea24a7f59f0338 diff --git a/lib/Mouse/Util.pm b/lib/Mouse/Util.pm index 107f700..19876a1 100644 --- a/lib/Mouse/Util.pm +++ b/lib/Mouse/Util.pm @@ -38,7 +38,7 @@ BEGIN{ # Because Mouse::Util is loaded first in all the Mouse sub-modules, # XS loader is placed here, not in Mouse.pm. - our $VERSION = '0.44'; + our $VERSION = '0.49'; my $xs = !(exists $INC{'Mouse/PurePerl.pm'} || $ENV{MOUSE_PUREPERL}); @@ -54,7 +54,7 @@ BEGIN{ Mouse::Util->import({ into => 'Mouse::Meta::Method::Destructor::XS' }, ':meta'); Mouse::Util->import({ into => 'Mouse::Meta::Method::Accessor::XS' }, ':meta'); return 1; - }; + } || 0; #warn $@ if $@; } @@ -153,7 +153,7 @@ BEGIN { } return $type eq 'c3' ? [calculateMRO($classname)] - : $_get_linear_isa_dfs->($classname); + : $_get_linear_isa_dfs->($classname); }; } @@ -266,7 +266,7 @@ sub load_class { sub is_class_loaded; sub apply_all_roles { - my $applicant = Scalar::Util::blessed($_[0]) + my $consumer = Scalar::Util::blessed($_[0]) ? shift # instance : Mouse::Meta::Class->initialize(shift); # class or role name @@ -284,15 +284,15 @@ sub apply_all_roles { load_class($role_name); is_a_metarole( get_metaclass_by_name($role_name) ) - || $applicant->meta->throw_error("You can only consume roles, $role_name is not a Mouse role"); + || $consumer->meta->throw_error("You can only consume roles, $role_name is not a Mouse role"); } if ( scalar @roles == 1 ) { my ( $role_name, $params ) = @{ $roles[0] }; - get_metaclass_by_name($role_name)->apply( $applicant, defined $params ? $params : () ); + get_metaclass_by_name($role_name)->apply( $consumer, defined $params ? $params : () ); } else { - Mouse::Meta::Role->combine(@roles)->apply($applicant); + Mouse::Meta::Role->combine(@roles)->apply($consumer); } return; } @@ -350,7 +350,7 @@ Mouse::Util - Features, with or without their dependencies =head1 VERSION -This document describes Mouse version 0.44 +This document describes Mouse version 0.49 =head1 IMPLEMENTATIONS FOR