Checking in changes prior to tagging of version 0.55.
[gitmo/Mouse.git] / lib / Mouse / PurePerl.pm
index ac261cb..d1b2c27 100644 (file)
@@ -280,7 +280,7 @@ sub new_object {
 }
 
 sub _initialize_object{
-    my($self, $object, $args, $ignore_triggers) = @_;
+    my($self, $object, $args, $is_cloning) = @_;
 
     my @triggers_queue;
 
@@ -298,7 +298,7 @@ sub _initialize_object{
                 push @triggers_queue, [ $attribute->trigger, $object->{$slot} ];
             }
         }
-        else { # no init arg
+        elsif(!$is_cloning) { # no init arg, noop while cloning
             if ($attribute->has_default || $attribute->has_builder) {
                 if (!$attribute->is_lazy) {
                     my $default = $attribute->default;
@@ -319,7 +319,7 @@ sub _initialize_object{
         }
     }
 
-    if(!$ignore_triggers){
+    if(@triggers_queue){
         foreach my $trigger_and_value(@triggers_queue){
             my($trigger, $value) = @{$trigger_and_value};
             $trigger->($object, $value);
@@ -617,6 +617,12 @@ sub compile_type_constraint{
     return;
 }
 
+sub check {
+    my $self = shift;
+    return $self->_compiled_type_constraint->(@_);
+}
+
+
 package Mouse::Object;
 
 sub BUILDARGS {
@@ -714,7 +720,7 @@ Mouse::PurePerl - A Mouse guts in pure Perl
 
 =head1 VERSION
 
-This document describes Mouse version 0.50_09
+This document describes Mouse version 0.55
 
 =head1 SEE ALSO