Mercurial > pub > Impl
diff Lib/IMPL/declare.pm @ 211:2b9b55cfb79b
Completed IMPL::Web::AutoLocator, added tests
author | cin |
---|---|
date | Tue, 05 Jun 2012 07:45:21 +0400 |
parents | a8db61d0ed33 |
children | 431db7034a88 |
line wrap: on
line diff
--- a/Lib/IMPL/declare.pm Tue May 29 20:07:22 2012 +0400 +++ b/Lib/IMPL/declare.pm Tue Jun 05 07:45:21 2012 +0400 @@ -31,8 +31,13 @@ my @isa; if (ref $base eq 'ARRAY') { - carp("will be changed in next version"); - @isa = map _require($_), @$base if @$base; + carp "Odd elements number in require" unless scalar(@$base)%2 == 0; + while ( my ($class,$mapper) = splice @$base, 0, 2 ) { + $class = $aliases->{$class} || _require($class); + + push @isa,$class; + $ctor{$class} = $mapper; + } } elsif (ref $base eq 'HASH' ) { while ( my ($class,$mapper) = each %$base ) { $class = $aliases->{$class} || _require($class);