r60281 - in /branches/upstream/libpadwalker-perl/current: ./ t/

carnil-guest at users.alioth.debian.org carnil-guest at users.alioth.debian.org
Wed Jul 14 05:45:23 UTC 2010


Author: carnil-guest
Date: Wed Jul 14 05:45:08 2010
New Revision: 60281

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=60281
Log:
[svn-upgrade] new version libpadwalker-perl (1.91)

Added:
    branches/upstream/libpadwalker-perl/current/._Changes   (with props)
    branches/upstream/libpadwalker-perl/current/._Makefile.PL   (with props)
    branches/upstream/libpadwalker-perl/current/._PadWalker.pm   (with props)
    branches/upstream/libpadwalker-perl/current/._README   (with props)
    branches/upstream/libpadwalker-perl/current/t/._bar.pl   (with props)
    branches/upstream/libpadwalker-perl/current/t/._baz.pl   (with props)
    branches/upstream/libpadwalker-perl/current/t/._dm.t   (with props)
    branches/upstream/libpadwalker-perl/current/t/._foo.t   (with props)
    branches/upstream/libpadwalker-perl/current/t/._our.t   (with props)
    branches/upstream/libpadwalker-perl/current/t/._recurse.t   (with props)
    branches/upstream/libpadwalker-perl/current/t/._sub.t   (with props)
    branches/upstream/libpadwalker-perl/current/t/._test.t   (with props)
    branches/upstream/libpadwalker-perl/current/t/._tt.t   (with props)
    branches/upstream/libpadwalker-perl/current/t/._var_name.t   (with props)
    branches/upstream/libpadwalker-perl/current/t/._vn-inc-1.pl   (with props)
    branches/upstream/libpadwalker-perl/current/t/._vn-inc-2.pl   (with props)
Modified:
    branches/upstream/libpadwalker-perl/current/Changes
    branches/upstream/libpadwalker-perl/current/PadWalker.pm
    branches/upstream/libpadwalker-perl/current/PadWalker.xs
    branches/upstream/libpadwalker-perl/current/README
    branches/upstream/libpadwalker-perl/current/t/closure.t

Added: branches/upstream/libpadwalker-perl/current/._Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/._Changes?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/._Changes
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libpadwalker-perl/current/._Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/._Makefile.PL?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/._Makefile.PL
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libpadwalker-perl/current/._PadWalker.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/._PadWalker.pm?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/._PadWalker.pm
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libpadwalker-perl/current/._README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/._README?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/._README
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: branches/upstream/libpadwalker-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/Changes?rev=60281&op=diff
==============================================================================
--- branches/upstream/libpadwalker-perl/current/Changes (original)
+++ branches/upstream/libpadwalker-perl/current/Changes Wed Jul 14 05:45:08 2010
@@ -126,3 +126,8 @@
 1.9  Fri 26 Jun 2009 10:01:17 BST
 	- Identical to 1.8, but with the bogus metadata ._ files removed
 	  from the distributed tar file.
+
+1.91  Wed 14 Jul 2010 01:07:05 BST
+	- Incorporate patches from Florian Ragwitz and Yuval Kogman
+          (see http://github.com/robinhouston/PadWalker/commits/master)
+

Modified: branches/upstream/libpadwalker-perl/current/PadWalker.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/PadWalker.pm?rev=60281&op=diff
==============================================================================
--- branches/upstream/libpadwalker-perl/current/PadWalker.pm (original)
+++ branches/upstream/libpadwalker-perl/current/PadWalker.pm Wed Jul 14 05:45:08 2010
@@ -12,7 +12,7 @@
 @EXPORT_OK = qw(peek_my peek_our closed_over peek_sub var_name set_closed_over);
 %EXPORT_TAGS = (all => \@EXPORT_OK);
 
-$VERSION = '1.9';
+$VERSION = '1.91';
 
 bootstrap PadWalker $VERSION;
 

Modified: branches/upstream/libpadwalker-perl/current/PadWalker.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/PadWalker.xs?rev=60281&op=diff
==============================================================================
--- branches/upstream/libpadwalker-perl/current/PadWalker.xs (original)
+++ branches/upstream/libpadwalker-perl/current/PadWalker.xs Wed Jul 14 05:45:08 2010
@@ -244,7 +244,7 @@
               }
 
               hv_store((is_our ? our_hash : my_hash), name_str, name_len,
-                       newRV_inc(val_sv), 0);
+                       (val_sv ? newRV_inc(val_sv) : &PL_sv_undef), 0);
             }
           }
         }
@@ -456,6 +456,35 @@
     }
 }
 
+STATIC bool
+is_scalar_type(SV *sv) {
+    switch (SvTYPE(sv)) {
+        case SVt_NULL:
+        case SVt_IV:
+        case SVt_RV:
+        case SVt_NV:
+        case SVt_PV:
+        case SVt_PVIV:
+        case SVt_PVNV:
+        case SVt_PVMG:
+        case SVt_PVLV:
+            return 1;
+        case SVt_PVGV:
+            return !isGV_with_GP(sv);
+        default:
+            return 0;
+    }
+}
+
+STATIC bool
+is_correct_type(SV *orig, SV *restore) {
+    return (
+        ( SvTYPE(orig) == SvTYPE(restore) )
+            ||
+        ( is_scalar_type(orig) && is_scalar_type(restore) )
+    );
+}
+
 
 MODULE = PadWalker              PACKAGE = PadWalker
 PROTOTYPES: DISABLE             
@@ -496,8 +525,6 @@
     SvREFCNT_dec((SV*) ignore);
     EXTEND(SP, 1);
     PUSHs(sv_2mortal(newRV_noinc((SV*)ret)));
-
-
 
 void
 set_closed_over(sv, pad)
@@ -524,8 +551,9 @@
             if ( SvROK(*restore_ref) ) {
               SV *restore = SvRV(*restore_ref);
               SV **orig = av_fetch(pad_vallist, i, 0);
-
-              if ( !orig || !*orig || strcmp(sv_reftype(*orig, 0), sv_reftype(restore, 0)) == 0 ) {
+              int restore_type = SvTYPE(restore);
+
+              if ( !orig || !*orig || is_correct_type(*orig, restore) ) {
                 SvREFCNT_inc(restore);
 
                 if ( av_store(pad_vallist, i, restore) == NULL )

Modified: branches/upstream/libpadwalker-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/README?rev=60281&op=diff
==============================================================================
--- branches/upstream/libpadwalker-perl/current/README (original)
+++ branches/upstream/libpadwalker-perl/current/README Wed Jul 14 05:45:08 2010
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
-| PadWalker v1.8    - Robin Houston
+| PadWalker v1.91    - Robin Houston
 -----------------------------------------------------------------------------
 
 NAME
@@ -106,13 +106,13 @@
 AUTHOR
        Robin Houston <robin at cpan.org>
 
-       With contributions from Richard Soberberg, bug-spotting from Peter
-       Scott and Dave Mitchell, and suggestions from demerphq.
+       With contributions from Richard Soberberg, Florian Ragwitz and Yuval Kogman,
+       bug-spotting from Peter Scott and Dave Mitchell, and suggestions from demerphq.
 
 SEE ALSO
        Devel::LexAlias, Devel::Caller, Sub::Parameters
 
 COPYRIGHT
-       Copyright (c) 2000-2009, Robin Houston. All Rights Reserved.  This mod-
+       Copyright (c) 2000-2010, Robin Houston. All Rights Reserved.  This mod-
        ule is free software. It may be used, redistributed and/or modified
        under the same terms as Perl itself.

Added: branches/upstream/libpadwalker-perl/current/t/._bar.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/t/._bar.pl?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/t/._bar.pl
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libpadwalker-perl/current/t/._baz.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/t/._baz.pl?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/t/._baz.pl
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libpadwalker-perl/current/t/._dm.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/t/._dm.t?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/t/._dm.t
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libpadwalker-perl/current/t/._foo.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/t/._foo.t?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/t/._foo.t
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libpadwalker-perl/current/t/._our.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/t/._our.t?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/t/._our.t
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libpadwalker-perl/current/t/._recurse.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/t/._recurse.t?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/t/._recurse.t
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libpadwalker-perl/current/t/._sub.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/t/._sub.t?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/t/._sub.t
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libpadwalker-perl/current/t/._test.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/t/._test.t?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/t/._test.t
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libpadwalker-perl/current/t/._tt.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/t/._tt.t?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/t/._tt.t
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libpadwalker-perl/current/t/._var_name.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/t/._var_name.t?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/t/._var_name.t
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libpadwalker-perl/current/t/._vn-inc-1.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/t/._vn-inc-1.pl?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/t/._vn-inc-1.pl
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libpadwalker-perl/current/t/._vn-inc-2.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/t/._vn-inc-2.pl?rev=60281&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libpadwalker-perl/current/t/._vn-inc-2.pl
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: branches/upstream/libpadwalker-perl/current/t/closure.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/t/closure.t?rev=60281&op=diff
==============================================================================
--- branches/upstream/libpadwalker-perl/current/t/closure.t (original)
+++ branches/upstream/libpadwalker-perl/current/t/closure.t Wed Jul 14 05:45:08 2010
@@ -1,7 +1,7 @@
 use strict; use warnings;
 use PadWalker 'closed_over', 'set_closed_over';
 
-print "1..28\n";
+print "1..29\n";
 
 my $x=2;
 my $h = closed_over (my $sub = sub {my $y = $x++});
@@ -64,6 +64,7 @@
     my $x     = 1;
     my @foo   = ();
     my $other = 5;
+    my $ref   = \"foo";
     my $h     = closed_over( my $sub = sub { my $y = $x++; push @foo, $y; $y } );
 
     my @keys = keys %$h;
@@ -97,4 +98,9 @@
     eval { set_closed_over( $sub, { '@foo' => \"foo" } ) };
 
     print( $@ ? "ok 28\n" : "not ok 28\n" );
+
+    # test that REF and SCALAR are interchangiable
+    eval { set_closed_over( $sub, { '$x' => \$ref } ) };
+
+    print( $@ ? "not ok 29\n" : "ok 29\n" );
 }




More information about the Pkg-perl-cvs-commits mailing list