use strict;
use warnings;
-use Mouse::Util 'get_linear_isa';
-use Scalar::Util 'blessed';
+use Mouse::Util qw/get_linear_isa blessed/;
use Carp 'confess';
use Class::Method::Modifiers ();
use strict;
use warnings;
-use Scalar::Util qw/looks_like_number blessed openhandle/;
+use Mouse::Util 'blessed';
+use Scalar::Util qw/looks_like_number openhandle/;
no warnings 'uninitialized';
sub optimized_constraints {
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,