Change 29414 by [EMAIL PROTECTED] on 2006/11/29 10:19:19

        Fix Attribute::Handlers to cope with proxy constant subroutines.

Affected files ...

... //depot/perl/MANIFEST#1485 edit
... //depot/perl/lib/Attribute/Handlers.pm#28 edit
... //depot/perl/lib/Attribute/Handlers/t/constants.t#1 add

Differences ...

==== //depot/perl/MANIFEST#1485 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST#1484~29404~   2006-11-28 05:50:37.000000000 -0800
+++ perl/MANIFEST       2006-11-29 02:19:19.000000000 -0800
@@ -1392,6 +1392,7 @@
 lib/Attribute/Handlers/demo/MyClass.pm Attribute::Handlers demo
 lib/Attribute/Handlers.pm      Attribute::Handlers
 lib/Attribute/Handlers/README          Attribute::Handlers
+lib/Attribute/Handlers/t/constants.t   Test constants and Attribute::Handlers
 lib/Attribute/Handlers/t/linerep.t     See if Attribute::Handlers works
 lib/Attribute/Handlers/t/multi.t       See if Attribute::Handlers works
 lib/attributes.pm              For "sub foo : attrlist"

==== //depot/perl/lib/Attribute/Handlers.pm#28 (text) ====
Index: perl/lib/Attribute/Handlers.pm
--- perl/lib/Attribute/Handlers.pm#27~29412~    2006-11-28 15:31:15.000000000 
-0800
+++ perl/lib/Attribute/Handlers.pm      2006-11-29 02:19:19.000000000 -0800
@@ -16,6 +16,7 @@
        no strict 'refs';
         foreach my $sym ( values %{$pkg."::"} ) {
            use strict;
+           next unless ref ( \$sym ) eq 'GLOB';
             return $symcache{$pkg,$ref} = \$sym
                if *{$sym}{$type} && *{$sym}{$type} == $ref;
        }

==== //depot/perl/lib/Attribute/Handlers/t/constants.t#1 (text) ====
Index: perl/lib/Attribute/Handlers/t/constants.t
--- /dev/null   2006-11-16 10:04:37.532058837 -0800
+++ perl/lib/Attribute/Handlers/t/constants.t   2006-11-29 02:19:19.000000000 
-0800
@@ -0,0 +1,13 @@
+BEGIN {
+    if ($ENV{PERL_CORE}) {
+       chdir 't' if -d 't';
+       @INC = '../lib';
+    }
+}
+use strict;
+use Test::More tests => 1;
+use Attribute::Handlers;
+# This had been failing since the introduction of proxy constant subroutines
+use constant SETUP => undef;
+sub Test : ATTR(CODE) { };
+ok(1, "If we got here, CHECK didn't fail");
End of Patch.

Reply via email to