We do need to copy %options so we can use $options{superclasses} later
Shawn M Moore [Mon, 22 Dec 2008 04:15:00 +0000 (04:15 +0000)]
lib/Mouse/Meta/Class.pm

index 8d82928..82f293d 100644 (file)
@@ -236,7 +236,8 @@ sub create {
         confess "creation of $package_name failed : $@" if $@;
     };
 
-    delete @options{qw(
+    my %initialize_options = %options;
+    delete @initialize_options{qw(
         package
         superclasses
         attributes
@@ -244,7 +245,7 @@ sub create {
         version
         authority
     )};
-    my $meta = $self->initialize( $package_name => %options );
+    my $meta = $self->initialize( $package_name => %initialize_options );
 
     # FIXME totally lame
     $meta->add_method('meta' => sub {