line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
use strict; |
3
|
1
|
|
|
1
|
|
18
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
4
|
1
|
|
|
1
|
|
5
|
no warnings qw( once void ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
5
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
147
|
|
6
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
7
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
8
|
|
|
|
|
|
|
our $MITE_VERSION = "0.010008"; |
9
|
|
|
|
|
|
|
# Mite keywords |
10
|
|
|
|
|
|
|
BEGIN { |
11
|
|
|
|
|
|
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "My::Deparse" ); |
12
|
1
|
|
|
1
|
|
4
|
( *after, *around, *before, *extends, *has, *signature_for, *with ) = do { |
13
|
1
|
|
|
|
|
5
|
no warnings 'redefine'; |
14
|
|
|
|
|
|
|
( |
15
|
1
|
|
|
1
|
|
6
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
193
|
|
16
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
17
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
18
|
0
|
|
|
|
|
0
|
sub {}, |
19
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
20
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
21
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
22
|
0
|
|
|
|
|
0
|
); |
23
|
0
|
|
|
|
|
0
|
}; |
24
|
1
|
|
|
|
|
48
|
|
25
|
|
|
|
|
|
|
# Gather metadata for constructor and destructor |
26
|
|
|
|
|
|
|
no strict 'refs'; |
27
|
|
|
|
|
|
|
my $class = shift; $class = ref($class) || $class; |
28
|
|
|
|
|
|
|
my $linear_isa = mro::get_linear_isa( $class ); |
29
|
|
|
|
|
|
|
return { |
30
|
1
|
|
|
1
|
|
5
|
BUILD => [ |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
211
|
|
31
|
1
|
|
33
|
1
|
|
1
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
1
|
|
|
|
|
4
|
|
32
|
1
|
|
|
|
|
5
|
map { "$_\::BUILD" } reverse @$linear_isa |
33
|
|
|
|
|
|
|
], |
34
|
|
|
|
|
|
|
DEMOLISH => [ |
35
|
2
|
50
|
|
|
|
4
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
2
|
|
|
|
|
23
|
|
|
0
|
|
|
|
|
0
|
|
36
|
2
|
|
|
|
|
5
|
map { "$_\::DEMOLISH" } @$linear_isa |
37
|
|
|
|
|
|
|
], |
38
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
39
|
2
|
50
|
|
|
|
3
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
|
2
|
|
|
|
|
25
|
|
|
0
|
|
|
|
|
0
|
|
40
|
1
|
|
|
|
|
2
|
}; |
|
2
|
|
|
|
|
4
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
BEGIN { |
44
|
|
|
|
|
|
|
require B::Deparse; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
use mro 'c3'; |
47
|
|
|
|
|
|
|
our @ISA; |
48
|
1
|
|
|
1
|
|
51
|
push @ISA, "B::Deparse"; |
49
|
|
|
|
|
|
|
} |
50
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
15
|
|
51
|
1
|
|
|
|
|
2
|
# Standard Moose/Moo-style constructor |
52
|
1
|
|
|
|
|
515
|
my $class = ref($_[0]) ? ref(shift) : shift; |
53
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
54
|
|
|
|
|
|
|
my $self = $class->SUPER::new( $meta->{HAS_FOREIGNBUILDARGS} ? $class->FOREIGNBUILDARGS( @_ ) : @_ ); |
55
|
|
|
|
|
|
|
my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; |
56
|
|
|
|
|
|
|
my $no_build = delete $args->{__no_BUILD__}; |
57
|
2
|
50
|
|
2
|
|
187
|
|
58
|
2
|
|
66
|
|
|
11
|
|
59
|
2
|
50
|
|
|
|
11
|
|
60
|
2
|
50
|
|
|
|
5589
|
# Call BUILD methods |
|
0
|
50
|
|
|
|
0
|
|
61
|
2
|
|
|
|
|
3
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# Unrecognized parameters |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
return $self; |
66
|
2
|
50
|
33
|
|
|
6
|
} |
|
2
|
50
|
|
|
|
7
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
69
|
2
|
50
|
|
|
|
3
|
my $class = ref( $_[0] ); |
|
2
|
50
|
|
|
|
4
|
|
|
2
|
50
|
|
|
|
10
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
5
|
|
70
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
71
|
2
|
|
|
|
|
8
|
$_->( @_ ) for @{ $meta->{BUILD} || [] }; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
75
|
|
|
|
|
|
|
my $self = shift; |
76
|
0
|
|
|
0
|
|
0
|
my $class = ref( $self ) || $self; |
77
|
0
|
|
0
|
|
|
0
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
78
|
0
|
0
|
|
|
|
0
|
my $in_global_destruction = defined ${^GLOBAL_PHASE} |
|
0
|
|
|
|
|
0
|
|
79
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
80
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
81
|
|
|
|
|
|
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
82
|
|
|
|
|
|
|
my $e = do { |
83
|
2
|
|
|
2
|
|
2342
|
local ( $?, $@ ); |
84
|
2
|
|
33
|
|
|
7
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
85
|
2
|
|
33
|
|
|
4
|
$@; |
86
|
2
|
50
|
|
|
|
7
|
}; |
87
|
|
|
|
|
|
|
no warnings 'misc'; # avoid (in cleanup) warnings |
88
|
|
|
|
|
|
|
die $e if $e; # rethrow |
89
|
2
|
50
|
|
|
|
3
|
} |
|
2
|
|
|
|
|
7
|
|
90
|
0
|
|
|
|
|
0
|
return; |
91
|
0
|
|
|
|
|
0
|
} |
92
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
93
|
0
|
|
|
|
|
0
|
|
94
|
|
|
|
|
|
|
# See UNIVERSAL |
95
|
1
|
|
|
1
|
|
6
|
my ( $self, $role ) = @_; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
228
|
|
96
|
0
|
0
|
|
|
|
0
|
our %DOES; |
97
|
|
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
98
|
2
|
|
|
|
|
11
|
return 1 if $role eq __PACKAGE__; |
99
|
|
|
|
|
|
|
if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) { |
100
|
|
|
|
|
|
|
$meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
return $self->SUPER::DOES( $role ); |
103
|
|
|
|
|
|
|
} |
104
|
7
|
|
|
7
|
|
10
|
|
105
|
7
|
|
|
|
|
6
|
# Alias for Moose/Moo-compatibility |
106
|
7
|
50
|
|
|
|
10
|
shift->DOES( @_ ); |
107
|
7
|
50
|
|
|
|
10
|
} |
108
|
7
|
50
|
0
|
|
|
12
|
|
|
|
|
33
|
|
|
|
|
109
|
0
|
0
|
0
|
|
|
0
|
1; |