X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FUtil.pm;h=c8b3c67d4570310ced0406e87a89bce8f90e69fe;hp=cc78ccfa97c7c6e001a0a2bd91d8211ed86c124d;hb=8fcbe7fb24ac710b860595ae1ecea066c3add1f5;hpb=00ca1c62fb631cb9b01962299f5e72b20b8063ec diff --git a/lib/Mouse/Util.pm b/lib/Mouse/Util.pm index cc78ccf..c8b3c67 100644 --- a/lib/Mouse/Util.pm +++ b/lib/Mouse/Util.pm @@ -5,6 +5,32 @@ use warnings; use base 'Exporter'; our %dependencies = ( + 'Scalar::Util' => { + 'blessed' => do { + do { + no strict 'refs'; + *UNIVERSAL::a_sub_not_likely_to_be_here = sub { + my $ref = ref($_[0]); + + # deviation from Scalar::Util + # XS returns undef, PP returns GLOB. + # let's make that more consistent by having PP return + # undef if it's a GLOB. :/ + + # \*STDOUT would be allowed as an object in PP blessed + # but not XS + return $ref eq 'GLOB' ? undef : $ref; + }; + }; + + sub { + local($@, $SIG{__DIE__}, $SIG{__WARN__}); + length(ref($_[0])) + ? eval { $_[0]->a_sub_not_likely_to_be_here } + : undef; + }, + }, + }, 'MRO::Compat' => { 'get_linear_isa' => { loaded => \&mro::get_linear_isa,