line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
use strict; |
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
4
|
no warnings qw( once void ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
5
|
1
|
|
|
1
|
|
4
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
126
|
|
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", "TestClass2" ); |
12
|
1
|
|
|
1
|
|
4
|
( *after, *around, *before, *extends, *has, *signature_for, *with ) = do { |
13
|
1
|
|
|
|
|
1
|
no warnings 'redefine'; |
14
|
|
|
|
|
|
|
( |
15
|
1
|
|
|
1
|
|
5
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
152
|
|
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
|
|
|
|
|
45
|
|
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
|
|
6
|
BUILD => [ |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
190
|
|
31
|
1
|
|
33
|
1
|
|
4
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
1
|
|
|
|
|
4
|
|
32
|
1
|
|
|
|
|
4
|
map { "$_\::BUILD" } reverse @$linear_isa |
33
|
|
|
|
|
|
|
], |
34
|
|
|
|
|
|
|
DEMOLISH => [ |
35
|
3
|
100
|
|
|
|
4
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
3
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
2
|
|
36
|
3
|
|
|
|
|
7
|
map { "$_\::DEMOLISH" } @$linear_isa |
37
|
|
|
|
|
|
|
], |
38
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
39
|
3
|
50
|
|
|
|
4
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
|
3
|
|
|
|
|
19
|
|
|
0
|
|
|
|
|
0
|
|
40
|
1
|
|
|
|
|
6
|
}; |
|
3
|
|
|
|
|
5
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
BEGIN { |
44
|
|
|
|
|
|
|
require TestClass1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
use mro 'c3'; |
47
|
|
|
|
|
|
|
our @ISA; |
48
|
1
|
|
|
1
|
|
473
|
push @ISA, "TestClass1"; |
49
|
|
|
|
|
|
|
} |
50
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
11
|
|
51
|
1
|
|
|
|
|
226
|
# Standard Moose/Moo-style constructor |
52
|
1
|
|
|
|
|
384
|
my $class = ref($_[0]) ? ref(shift) : shift; |
53
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
54
|
|
|
|
|
|
|
my $self = do { my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; $args->{__no_BUILD__} = 1; $class->SUPER::new( $args ) }; |
55
|
|
|
|
|
|
|
my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; |
56
|
|
|
|
|
|
|
my $no_build = delete $args->{__no_BUILD__}; |
57
|
2
|
50
|
|
2
|
|
2631
|
|
58
|
2
|
|
66
|
|
|
8
|
|
59
|
2
|
0
|
|
|
|
14
|
|
|
2
|
50
|
|
|
|
8
|
|
|
0
|
|
|
|
|
0
|
|
|
2
|
|
|
|
|
24
|
|
|
2
|
|
|
|
|
6
|
|
60
|
2
|
0
|
|
|
|
42
|
# Call BUILD methods |
|
0
|
50
|
|
|
|
0
|
|
61
|
2
|
|
|
|
|
17
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# Unrecognized parameters |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
return $self; |
66
|
2
|
50
|
66
|
|
|
5
|
} |
|
1
|
100
|
|
|
|
6
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
69
|
2
|
50
|
|
|
|
8
|
my $class = ref( $_[0] ); |
|
2
|
50
|
|
|
|
3
|
|
|
2
|
50
|
|
|
|
10
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
4
|
|
70
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
71
|
2
|
|
|
|
|
5
|
$_->( @_ ) for @{ $meta->{BUILD} || [] }; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
75
|
|
|
|
|
|
|
my $self = shift; |
76
|
1
|
|
|
1
|
|
2
|
my $class = ref( $self ) || $self; |
77
|
1
|
|
33
|
|
|
3
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
78
|
1
|
50
|
|
|
|
1
|
my $in_global_destruction = defined ${^GLOBAL_PHASE} |
|
1
|
|
|
|
|
3
|
|
79
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
80
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
81
|
|
|
|
|
|
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
82
|
|
|
|
|
|
|
my $e = do { |
83
|
2
|
|
|
2
|
|
524
|
local ( $?, $@ ); |
84
|
2
|
|
33
|
|
|
5
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
85
|
2
|
|
33
|
|
|
6
|
$@; |
86
|
2
|
50
|
|
|
|
7
|
}; |
87
|
|
|
|
|
|
|
no warnings 'misc'; # avoid (in cleanup) warnings |
88
|
|
|
|
|
|
|
die $e if $e; # rethrow |
89
|
2
|
50
|
|
|
|
9
|
} |
|
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
|
|
|
|
|
205
|
|
96
|
0
|
0
|
|
|
|
0
|
our %DOES; |
97
|
|
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
98
|
2
|
|
|
|
|
21
|
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
|
|
|
|
|
5
|
# Alias for Moose/Moo-compatibility |
106
|
7
|
50
|
|
|
|
11
|
shift->DOES( @_ ); |
107
|
7
|
50
|
|
|
|
9
|
} |
108
|
7
|
50
|
0
|
|
|
14
|
|
|
|
|
33
|
|
|
|
|
109
|
0
|
0
|
0
|
|
|
0
|
1; |