зеркало из https://github.com/mozilla/pjs.git
Removed an unused variable. Made the selecting array always return an array even in scalar context. This makes using it in |if| statements a lot easier.
This commit is contained in:
Родитель
bdc0b5ca1d
Коммит
4adb0e69e5
|
@ -51,17 +51,12 @@ sub AUTOLOAD {
|
|||
my $self = shift;
|
||||
my $name = $AUTOLOAD;
|
||||
$name =~ s/^.*://o; # strip fully-qualified portion
|
||||
my @allResults;
|
||||
foreach my $object (@$self) {
|
||||
my $method = $object->can($name);
|
||||
if ($method) {
|
||||
my @result = &$method($object, @_);
|
||||
if (@result) {
|
||||
if (wantarray) {
|
||||
return @result;
|
||||
} else {
|
||||
return $result[0];
|
||||
}
|
||||
return @result;
|
||||
}
|
||||
} else {
|
||||
confess("Failed to find method or property '$name' in object '$object' of MagicSelectingArray '$self', aborting"); # die with stack trace
|
||||
|
|
Загрузка…
Ссылка в новой задаче