From: gfx Date: Sat, 19 Dec 2009 08:15:44 +0000 (+0900) Subject: Rename: s/verify_type_constraint_error/_throw_type_constraint_error/g; It's Mouse... X-Git-Tag: 0.45~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=da23cd4afe3c5b0add3a9ed24a43696deb380f2b Rename: s/verify_type_constraint_error/_throw_type_constraint_error/g; It's Mouse specific. --- diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index c4b749e..1c78109 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -199,8 +199,7 @@ sub canonicalize_args{ # DEPRECATED my ($self, $name, %args) = @_; Carp::cluck("$self->canonicalize_args has been deprecated." - . "Use \$self->_process_options instead.") - if Mouse::Util::_MOUSE_VERBOSE; + . "Use \$self->_process_options instead."); return %args; } @@ -209,8 +208,7 @@ sub create { # DEPRECATED my ($self, $class, $name, %args) = @_; Carp::cluck("$self->create has been deprecated." - . "Use \$meta->add_attribute and \$attr->install_accessors instead.") - if Mouse::Util::_MOUSE_VERBOSE; + . "Use \$meta->add_attribute and \$attr->install_accessors instead."); # noop return $self; @@ -238,10 +236,10 @@ sub verify_against_type_constraint { return 1 if !$type_constraint; return 1 if $type_constraint->check($value); - $self->verify_type_constraint_error($value, $type_constraint); + $self->_throw_type_constraint_error($value, $type_constraint); } -sub verify_type_constraint_error { +sub _throw_type_constraint_error { my($self, $value, $type) = @_; $self->throw_error( @@ -282,8 +280,7 @@ sub clone_parent { # DEPRECATED my %args = ($self->get_parent_args($class, $name), @_); Carp::cluck("$self->clone_parent has been deprecated." - . "Use \$meta->add_attribute and \$attr->install_accessors instead.") - if Mouse::Util::_MOUSE_VERBOSE; + . "Use \$meta->add_attribute and \$attr->install_accessors instead."); $self->clone_and_inherited_args($class, $name, %args); } diff --git a/lib/Mouse/Meta/Method/Accessor.pm b/lib/Mouse/Meta/Method/Accessor.pm index be8d9ff..b34cd5f 100755 --- a/lib/Mouse/Meta/Method/Accessor.pm +++ b/lib/Mouse/Meta/Method/Accessor.pm @@ -49,7 +49,7 @@ sub _generate_accessor_any{ $accessor .= "\n". '$compiled_type_constraint->('.$value.') or - $attribute->verify_type_constraint_error('.$value.', $constraint);' . "\n"; + $attribute->_throw_type_constraint_error('.$value.', $constraint);' . "\n"; } # if there's nothing left to do for the attribute we can return during @@ -96,7 +96,7 @@ sub _generate_accessor_any{ $accessor .= "my \$tmp = $value;\n"; $accessor .= "\$compiled_type_constraint->(\$tmp)"; - $accessor .= " || \$attribute->verify_type_constraint_error(\$tmp, \$constraint);\n"; + $accessor .= " || \$attribute->_throw_type_constraint_error(\$tmp, \$constraint);\n"; $accessor .= "$slot = \$tmp;\n"; } else{ diff --git a/lib/Mouse/Meta/Method/Constructor.pm b/lib/Mouse/Meta/Method/Constructor.pm index deed6b0..d5961aa 100644 --- a/lib/Mouse/Meta/Method/Constructor.pm +++ b/lib/Mouse/Meta/Method/Constructor.pm @@ -77,7 +77,7 @@ sub _generate_processattrs { my $post_process = ''; if(defined $type_constraint){ $post_process .= "\$checks[$index]->($instance_slot)"; - $post_process .= " or $attr_var->verify_type_constraint_error($instance_slot, $constraint_var);\n"; + $post_process .= " or $attr_var->_throw_type_constraint_error($instance_slot, $constraint_var);\n"; } if($is_weak_ref){ $post_process .= "Scalar::Util::weaken($instance_slot) if ref $instance_slot;\n";