On Fri Jul 25 01:15:29 2014, TEAM wrote:
Show quoted text> Noticed this today - the checks for missing entries in %metas use 'or'
> instead of '||':
Oops; yes. And a couple more in Tangence::Struct.
Patch attached.
--
Paul Evans
=== modified file 'lib/Tangence/Class.pm'
--- lib/Tangence/Class.pm 2014-03-30 19:26:01 +0000
+++ lib/Tangence/Class.pm 2014-08-13 21:03:35 +0000
@@ -101,10 +101,16 @@
);
}
+ my @superclasses;
+ foreach ( @{ $args{superclasses} } ) {
+ push @superclasses, Tangence::Class->for_perlname( $_ );
+ }
+
$self->define(
- methods => \%methods,
- events => \%events,
- properties => \%properties,
+ methods => \%methods,
+ events => \%events,
+ properties => \%properties,
+ superclasses => \@superclasses,
);
}
@@ -133,7 +139,7 @@
my $class = shift;
my ( $name ) = @_;
- return $metas{$name} or croak "Unknown Tangence::Class for '$name'";
+ return $metas{$name} || croak "Unknown Tangence::Class for '$name'";
}
sub for_perlname
@@ -142,7 +148,7 @@
my ( $perlname ) = @_;
( my $name = $perlname ) =~ s{::}{.}g;
- return $metas{$name} or croak "Unknown Tangence::Class for '$perlname'";
+ return $metas{$name} || croak "Unknown Tangence::Class for '$perlname'";
}
sub superclasses
=== modified file 'lib/Tangence/Struct.pm'
--- lib/Tangence/Struct.pm 2014-03-30 19:54:18 +0000
+++ lib/Tangence/Struct.pm 2014-08-13 21:03:35 +0000
@@ -98,7 +98,7 @@
my $class = shift;
my ( $name ) = @_;
- return $STRUCTS_BY_NAME{$name} or croak "Unknown Tangence::Struct for '$name'";
+ return $STRUCTS_BY_NAME{$name} || croak "Unknown Tangence::Struct for '$name'";
}
sub for_perlname
@@ -106,7 +106,7 @@
my $class = shift;
my ( $perlname ) = @_;
- return $STRUCTS_BY_PERLNAME{$perlname} or croak "Unknown Tangence::Struct for '$perlname'";
+ return $STRUCTS_BY_PERLNAME{$perlname} || croak "Unknown Tangence::Struct for '$perlname'";
}
sub perlname