Fix native methods which accept string to accept the empty string
[gitmo/Moose.git] / lib / Moose / Exporter.pm
index 57d5a55..aca3f3a 100644 (file)
@@ -3,7 +3,7 @@ package Moose::Exporter;
 use strict;
 use warnings;
 
-our $VERSION = '1.14';
+our $VERSION = '1.15';
 our $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
@@ -426,7 +426,7 @@ sub _make_import_sub {
 }
 
 sub _strip_traits {
-    my $idx = first_index { $_ eq '-traits' } @_;
+    my $idx = first_index { ( $_ || '' ) eq '-traits' } @_;
 
     return ( [], @_ ) unless $idx >= 0 && $#_ >= $idx + 1;
 
@@ -440,7 +440,7 @@ sub _strip_traits {
 }
 
 sub _strip_metaclass {
-    my $idx = first_index { $_ eq '-metaclass' } @_;
+    my $idx = first_index { ( $_ || '' ) eq '-metaclass' } @_;
 
     return ( undef, @_ ) unless $idx >= 0 && $#_ >= $idx + 1;
 
@@ -452,7 +452,7 @@ sub _strip_metaclass {
 }
 
 sub _strip_meta_name {
-    my $idx = first_index { $_ eq '-meta_name' } @_;
+    my $idx = first_index { ( $_ || '' ) eq '-meta_name' } @_;
 
     return ( 'meta', @_ ) unless $idx >= 0 && $#_ >= $idx + 1;