From: 大沢 和宏 Date: Wed, 3 Dec 2008 09:10:39 +0000 (+0000) Subject: remove trash X-Git-Tag: 0.19~136^2~48 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bc37d507054f96febd96fea2a63f9f1b2c62dab4;p=gitmo%2FMouse.git remove trash --- diff --git a/lib/Mouse/TypeRegistry.pm b/lib/Mouse/TypeRegistry.pm index c1f4d36..d468296 100644 --- a/lib/Mouse/TypeRegistry.pm +++ b/lib/Mouse/TypeRegistry.pm @@ -9,15 +9,11 @@ use Mouse::Util qw/blessed looks_like_number openhandle/; my $SUBTYPE = +{}; my $COERCE = +{}; +#find_type_constraint register_type_constraint sub import { my $class = shift; my %args = @_; - my $caller = caller(0); - - if (defined $args{'-export'} && ref($args{'-export'}) eq 'ARRAY') { - no strict 'refs'; - *{"$caller\::import"} = sub { _import(@_) }; - } + my $caller = $args{callee} || caller(0); no strict 'refs'; *{"$caller\::as"} = \&_as; @@ -47,14 +43,6 @@ sub _via (&) { $_[0] } -sub _import { - my($class, @types) = @_; - return unless exists $SUBTYPE->{$class} && exists $COERCE->{$class}; - my $pkg = caller(1); - return unless @types; - copy_types($class, $pkg, @types); -} - sub _subtype { my $pkg = caller(0); my($name, %conf) = @_;