}
use Carp 'confess';
-use Mouse::Util 'blessed';
+use Scalar::Util 'blessed';
+use Mouse::Util;
use Mouse::Meta::Attribute;
use Mouse::Meta::Class;
confess "Invalid class name ($display)";
}
+ return 1 if $class eq 'Mouse::Object';
return 1 if is_class_loaded($class);
(my $file = "$class.pm") =~ s{::}{/}g;
require overload;
use Carp 'confess';
-require Mouse::Util;
+use Scalar::Util ();
sub new {
my $class = shift;
$accessor .= $self.'->{'.$key.'} = '.$value.';' . "\n";
if ($is_weak) {
- $accessor .= 'Mouse::Util::weaken('.$self.'->{'.$key.'}) if ref('.$self.'->{'.$key.'});' . "\n";
+ $accessor .= 'Scalar::Util::weaken('.$self.'->{'.$key.'}) if ref('.$self.'->{'.$key.'});' . "\n";
}
if ($trigger) {
my $optimized_constraints = Mouse::TypeRegistry->optimized_constraints;
if (@type_constraints == 1) {
$code = $optimized_constraints->{$type_constraints[0]} ||
- sub { Mouse::Util::blessed($_) && Mouse::Util::blessed($_) eq $type_constraints[0] };
+ sub { Scalar::Util::blessed($_) && Scalar::Util::blessed($_) eq $type_constraints[0] };
$args{type_constraint} = $type_constraints[0];
} else {
my @code_list = map {
my $type = $_;
$optimized_constraints->{$type} ||
- sub { Mouse::Util::blessed($_) && Mouse::Util::blessed($_) eq $type }
+ sub { Scalar::Util::blessed($_) && Scalar::Util::blessed($_) eq $type }
} @type_constraints;
$code = sub {
for my $code (@code_list) {
use Mouse::Meta::Method::Constructor;
use Mouse::Meta::Method::Destructor;
-use Mouse::Util qw/get_linear_isa blessed/;
+use Scalar::Util qw/blessed/;
+use Mouse::Util qw/get_linear_isa/;
use Carp 'confess';
do {
use strict;
use warnings;
-use Mouse::Util qw/weaken/;
+use Scalar::Util qw/weaken/;
use Carp 'confess';
sub new {
use base 'Exporter';
use Carp 'confess';
-use Mouse::Util 'blessed';
+use Scalar::Util 'blessed';
use Mouse::Meta::Role;
use warnings;
use Carp ();
-use Mouse::Util qw/blessed looks_like_number openhandle/;
+use Scalar::Util qw/blessed looks_like_number openhandle/;
my %SUBTYPE;
my %COERCE;
use warnings;
use base qw/Exporter/;
use Carp;
-use Scalar::Util qw(blessed looks_like_number openhandle reftype weaken);
our @EXPORT_OK = qw(
- blessed looks_like_number openhandle reftype weaken
get_linear_isa
);
our %EXPORT_TAGS = (
=head3 get_linear_isa
-=head2 L<Scalar::Util>
-
-=head3 blessed
-
-=head3 looks_like_number
-
-=head3 reftype
-
-=head3 openhandle
-
-=head3 weaken
-
-C<weaken> I<must> be implemented in XS. If the user tries to use C<weaken>
-without L<Scalar::Util>, an error is thrown.
-
-=head2 Test::Exception
-
-=head3 throws_ok
-
-=head3 lives_ok
-
=cut
use strict;
use warnings;
-use Mouse::Util 'blessed';
+use Scalar::Util 'blessed';
use overload(
'""' => sub { ${ $_[0] } },
use warnings;
use Test::More;
-use Mouse::Util 'blessed';
+use Scalar::Util 'blessed';
do {
package Foo;
use warnings;
use Test::More;
-use Mouse::Util 'blessed';
+use Scalar::Util 'blessed';
do {
package Foo::Role;