From db7c38b0b0dcd88368ad5b88df89772f63292386 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 3 Jan 2013 23:31:08 -0600 Subject: make it explicit that anon stash support requires 5.10 --- XS.xs | 5 +++++ t/edge-cases.t | 2 ++ 2 files changed, 7 insertions(+) diff --git a/XS.xs b/XS.xs index f636392..84f89f7 100644 --- a/XS.xs +++ b/XS.xs @@ -556,6 +556,10 @@ new(class, package) } } else if (SvROK(package) && SvTYPE(SvRV(package)) == SVt_PVHV) { +#if PERL_VERSION < 10 + croak("The XS implementation of Package::Stash does not support " + "anonymous stashes before perl 5.10"); +#else instance = newHV(); if (!hv_store(instance, "namespace", 9, SvREFCNT_inc_simple_NN(package), 0)) { @@ -563,6 +567,7 @@ new(class, package) SvREFCNT_dec(instance); croak("Couldn't initialize the 'namespace' key, hv_store failed"); } +#endif } else { croak("Package::Stash->new must be passed the name of the package to access"); diff --git a/t/edge-cases.t b/t/edge-cases.t index ddaca14..4e851c3 100644 --- a/t/edge-cases.t +++ b/t/edge-cases.t @@ -56,6 +56,8 @@ is(ref($stash->get_or_add_symbol('$glob')), 'SCALAR', "got an empty scalar"); SKIP: { skip "PP doesn't support anon stashes before 5.14", 4 if $] < 5.014 && $Package::Stash::IMPLEMENTATION eq 'PP'; + skip "XS doesn't support anon stashes before 5.10", 4 + if $] < 5.010 && $Package::Stash::IMPLEMENTATION eq 'XS'; local $TODO = "don't know how to properly inflate a stash entry in PP" if $Package::Stash::IMPLEMENTATION eq 'PP'; -- cgit v1.2.3