This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Updated Safe to CPAN release 2.33
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Fri, 8 Jun 2012 12:20:11 +0000 (13:20 +0100)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Sun, 17 Jun 2012 20:26:49 +0000 (21:26 +0100)
  [DELTA]

2.33 Tue Apr  3 2012
    - Don't eval code under 'no strict' (Father Chrysostomos)

2.32 Sat Mar 31 2012
    - Make Safe play nice with Devel::Cover

MANIFEST
Porting/Maintainers.pl
dist/Safe/Changes
dist/Safe/MANIFEST
dist/Safe/META.yml
dist/Safe/Safe.pm
dist/Safe/t/safeload.t
dist/Safe/t/saferegexp.t [new file with mode: 0644]

index c1fa3e3..13922b1 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -3402,6 +3402,7 @@ dist/Safe/t/safe3.t               See if Safe works
 dist/Safe/t/safeload.t         Tests that some modules can be loaded by Safe
 dist/Safe/t/safenamedcap.t     Tests that Tie::Hash::NamedCapture can be loaded
 dist/Safe/t/safeops.t          Tests that all ops can be trapped by Safe
+dist/Safe/t/saferegexp.t
 dist/Safe/t/safesort.t         Tests Safe with sort
 dist/Safe/t/safeuniversal.t    Tests Safe with functions from universal.c
 dist/Safe/t/safeutf8.t         Tests Safe with utf8.pm
index 55b02dc..5d28d7f 100755 (executable)
@@ -1587,7 +1587,7 @@ use File::Glob qw(:case);
 
     'Safe' => {
         'MAINTAINER'   => 'rgarcia',
-        'DISTRIBUTION' => 'RGARCIA/Safe-2.30.tar.gz',
+        'DISTRIBUTION' => 'RGARCIA/Safe-2.33.tar.gz',
         'FILES'        => q[dist/Safe],
         'UPSTREAM'     => 'blead',
     },
index 593049c..7acc3d5 100644 (file)
@@ -1,3 +1,10 @@
+2.33 Tue Apr  3 2012
+    - Don’t eval code under ‘no strict’ (Father Chrysostomos)
+      cf. Perl 5 change 25dc25e774abbe993644899cf4d9f9925a9fb9a8
+
+2.32 Sat Mar 31 2012
+    - Make Safe play nice with Devel::Cover
+
 2.31 Fri Jan 20 2012
     - Now need to use code points above 255 to get SWASHNEW to load
 
index b527bc4..cb08dd3 100644 (file)
@@ -9,8 +9,10 @@ t/safe3.t
 t/safeload.t
 t/safenamedcap.t
 t/safeops.t
+t/saferegexp.t
 t/safesort.t
 t/safeuniversal.t
 t/safeutf8.t
 t/safewrap.t
 META.yml                                 Module meta-data (added by MakeMaker)
+META.json                                Module JSON meta-data (added by MakeMaker)
index 14c4c5a..3e6eb55 100644 (file)
@@ -1,20 +1,21 @@
---- #YAML:1.0
-name:               Safe
-version:            2.30
-abstract:           ~
-author:  []
-license:            unknown
-distribution_type:  module
-configure_requires:
-    ExtUtils::MakeMaker:  0
+---
+abstract: unknown
+author:
+  - unknown
 build_requires:
-    ExtUtils::MakeMaker:  0
-requires:  {}
-no_index:
-    directory:
-        - t
-        - inc
-generated_by:       ExtUtils::MakeMaker version 6.57_05
+  ExtUtils::MakeMaker: 0
+configure_requires:
+  ExtUtils::MakeMaker: 0
+dynamic_config: 1
+generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112150'
+license: unknown
 meta-spec:
-    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
-    version:  1.4
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4
+name: Safe
+no_index:
+  directory:
+    - t
+    - inc
+requires: {}
+version: 2.33
index a5cc238..865a9dc 100644 (file)
@@ -3,7 +3,7 @@ package Safe;
 use 5.003_11;
 use Scalar::Util qw(reftype refaddr);
 
-$Safe::VERSION = "2.31_01";
+$Safe::VERSION = "2.33_01";
 
 # *** Don't declare any lexicals above this point ***
 #
@@ -140,6 +140,9 @@ my $default_share = [qw[
     &Tie::Hash::NamedCapture::SCALAR
     &Tie::Hash::NamedCapture::flags
 ])];
+if (defined $Devel::Cover::VERSION) {
+    push @$default_share, '&Devel::Cover::use_file';
+}
 
 sub new {
     my($class, $root, $mask) = @_;
index 6ff7a76..4d4e7b5 100644 (file)
@@ -18,13 +18,17 @@ BEGIN {
 use strict;
 use Test::More;
 use Safe;
-plan(tests => 2);
+plan(tests => 3);
 
 my $c = new Safe;
 $c->permit(qw(require caller entereval unpack));
 my $r = $c->reval(q{ use version; 1 });
 ok( defined $r, "Can load version.pm in a Safe compartment" ) or diag $@;
 
+$r = $c->reval(q{ version->new(1.2) });
+is(ref $r, "Safe::Root0::version", "version objects rerooted");
+$r or diag $@;
+
 # Does this test really belong here?  We are testing the "loading" of
 # a perl version number.
 # This should died because of strictures under 5.12+ and because of the
diff --git a/dist/Safe/t/saferegexp.t b/dist/Safe/t/saferegexp.t
new file mode 100644 (file)
index 0000000..2719ca1
--- /dev/null
@@ -0,0 +1,34 @@
+#!perl -w
+
+BEGIN {
+    require Config; import Config;
+    if ($Config{'extensions'} !~ /\bOpcode\b/) {
+        print "1..0\n";
+        exit 0;
+    }
+}
+
+use Test::More tests => 3;
+use Safe;
+
+my $c; my $r;
+my $snippet = q{
+    my $foo = qr/foo/;
+    ref $foo;
+};
+$c = new Safe;
+$r = $c->reval($snippet);
+is( $r, "Safe::Root0::Regexp" );
+$r or diag $@;
+
+# once more with the same compartment
+# (where DESTROY has been cleaned up)
+$r = $c->reval($snippet);
+is( $r, "Safe::Root0::Regexp" );
+$r or diag $@;
+
+# try with a new compartment
+$c = new Safe;
+$r = $c->reval($snippet);
+is( $r, "Safe::Root1::Regexp" );
+$r or diag $@;