need to use a consistent sort order, now that this isn't cached
Jesse Luehrs [Thu, 11 Nov 2010 15:11:48 +0000 (09:11 -0600)]
lib/Class/MOP/Class.pm
lib/Class/MOP/Method/Constructor.pm

index fbe64e4..891e611 100644 (file)
@@ -643,7 +643,7 @@ sub _inline_slot_initializers {
     my $idx = 0;
 
     return map { $self->_inline_slot_initializer($_, $idx++) }
-               $self->get_all_attributes;
+               sort { $a->name cmp $b->name } $self->get_all_attributes;
 }
 
 sub _inline_slot_initializer {
index b64c1c5..31392dd 100644 (file)
@@ -75,7 +75,10 @@ sub associated_metaclass { (shift)->{'associated_metaclass'} }
 
 sub _attributes {
     my $self = shift;
-    $self->{'attributes'} ||= [ $self->associated_metaclass->get_all_attributes ]
+    $self->{'attributes'} ||= [
+        sort { $a->name cmp $b->name }
+             $self->associated_metaclass->get_all_attributes
+    ]
 }
 
 ## method