]> git.vpit.fr Git - perl/modules/Sub-Prototype-Util.git/commitdiff
Importing Sub-Prototype-Util-0.08.tar.gz v0.08
authorVincent Pit <vince@profvince.com>
Sun, 29 Jun 2008 15:52:15 +0000 (17:52 +0200)
committerVincent Pit <vince@profvince.com>
Sun, 29 Jun 2008 15:52:15 +0000 (17:52 +0200)
Changes
META.yml
Makefile.PL
README
lib/Sub/Prototype/Util.pm
t/11-recall.t

diff --git a/Changes b/Changes
index cd1307f5b63d3f9fa4e15a692ecfd2663accaf00..15a567f5c58ed8725c2b0f284a84a5e9603971f6 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for Sub-Prototype-Util
 
+0.08    2008-05-02 15:25 UTC
+        + Fix : "{ $func => undef }" (resp. "=> ''") should enforce no prototype
+                (resp. enforce an empty prototype).
+
 0.07    2008-04-21 09:00 UTC
         + Add : Forward eval() errors when compiling in wrap().
         + Add : Talk about wrap() in the synopsis and samples/try.pl.
index 796b2c75836f4b9610e56a2055639652df0df9f4..dfa711fe3e75eeb770197d4b1bfa4a42f2730888 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -1,11 +1,11 @@
 --- #YAML:1.0
 name:                Sub-Prototype-Util
-version:             0.07
+version:             0.08
 abstract:            Prototype-related utility routines.
 license:             perl
 author:              
     - Vincent Pit <perl@profvince.com>
-generated_by:        ExtUtils::MakeMaker version 6.42
+generated_by:        ExtUtils::MakeMaker version 6.44
 distribution_type:   module
 requires:     
     Carp:                          0
index 0874b2c94787f6faab15a1e26f2653cd0eb68eb8..6958e5b678124ddd83706b0cacec55feb432aed4 100644 (file)
@@ -1,3 +1,5 @@
+use 5.006;
+
 use strict;
 use warnings;
 use ExtUtils::MakeMaker;
diff --git a/README b/README
index 4ff0b7457af8fa65ff32a2d99cffc861ec826120..316b1f609e8360c89476d3912457e8a9264c13d8 100644 (file)
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ NAME
     Sub::Prototype::Util - Prototype-related utility routines.
 
 VERSION
-    Version 0.07
+    Version 0.08
 
 SYNOPSIS
         use Sub::Prototype::Util qw/flatten recall wrap/;
index 531cdae7bd989c0693a84cc8ef7c6b3ee4b404fc..11eeb91395a79e2ad1db7a54ea992916075e194d 100644 (file)
@@ -12,13 +12,13 @@ Sub::Prototype::Util - Prototype-related utility routines.
 
 =head1 VERSION
 
-Version 0.07
+Version 0.08
 
 =cut
 
 use vars qw/$VERSION/;
 
-$VERSION = '0.07';
+$VERSION = '0.08';
 
 =head1 SYNOPSIS
 
@@ -116,15 +116,16 @@ sub _check_name {
  croak 'No subroutine specified' unless $name;
  my $proto;
  my $r = ref $name;
- if ($r eq 'HASH') {
+ if (!$r) {
+  $proto = prototype $name;
+ } elsif ($r eq 'HASH') {
   croak 'Forced prototype hash reference must contain exactly one key/value pair' unless keys %$name == 1;
   ($name, $proto) = %$name;
- } elsif (length $r) {
+ } else {
   croak 'Unhandled ' . $r . ' reference as first argument';
  }
  $name =~ s/^\s+//;
  $name =~ s/[\s\$\@\%\*\&;].*//;
- $proto = prototype $name unless $proto;
  return $name, $proto;
 }
 
index 10c479c89ade2a7d0535f41acfe458773812838f..916e7c5820c07c2829d7411f18821b3153243c5e 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 7 + 18 + (($^V ge v5.10.0) ? 4 : 0);
+use Test::More tests => 7 + 20 + (($^V ge v5.10.0) ? 4 : 0);
 
 use Scalar::Util qw/set_prototype/;
 use Sub::Prototype::Util qw/recall/;
@@ -35,7 +35,8 @@ my $g = [ sub { $_ > 2 }, 1 .. 5 ];
 
 my @tests = (
  [ 'main::noproto', 'no prototype', $t, $t, [ 2, 1 ] ],
- [ { 'CORE::push' => undef }, 'push', [ [ 1, 2 ], 3, 5 ], [ [ 1, 2, 3, 5 ], 3, 5 ], [ 4 ] ],
+ [ { 'main::noproto' => undef }, 'no prototype forced', $t, $t, [ 2, 1 ] ],
+ [ 'CORE::push', 'push', [ [ 1, 2 ], 3, 5 ], [ [ 1, 2, 3, 5 ], 3, 5 ], [ 4 ] ],
  [ { 'CORE::push' => '\@$' }, 'push just one', [ [ 1, 2 ], 3, 5 ], [ [ 1, 2, 3 ], 3, 5 ], [ 3 ] ],
  [ { 'CORE::map' => '\&@' }, 'map', $m, $m, [ 11 .. 15 ] ],
  [ 'main::mytrunc', 'truncate 1', [ 1 ], [ 1 ], [ undef, 1 ] ],