Use Mouse::Object::BUILDARGS, because it's safe and flexible.
[gitmo/Mouse.git] / lib / Mouse / Meta / Class.pm
index 5d1755b..d95e4be 100644 (file)
@@ -207,13 +207,13 @@ sub new_object;
 sub clone_object {
     my $class  = shift;
     my $object = shift;
-    my %params = (@_ == 1) ? %{$_[0]} : @_;
+    my $args   = $object->Mouse::Object::BUILDARGS(@_);
 
     (blessed($object) && $object->isa($class->name))
         || $class->throw_error("You must pass an instance of the metaclass (" . $class->name . "), not ($object)");
 
     my $cloned = bless { %$object }, ref $object;
-    $class->_initialize_object($cloned, \%params);
+    $class->_initialize_object($cloned, $args);
 
     return $cloned;
 }
@@ -462,7 +462,7 @@ Mouse::Meta::Class - The Mouse class metaclass
 
 =head1 VERSION
 
-This document describes Mouse version 0.46
+This document describes Mouse version 0.47
 
 =head1 METHODS