line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
package MyTest; |
3
|
4
|
|
|
4
|
|
28
|
use Storable (); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
100
|
|
4
|
4
|
|
|
4
|
|
24
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
80
|
|
5
|
4
|
|
|
4
|
|
16
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
108
|
|
6
|
4
|
|
|
4
|
|
16
|
no warnings qw( once void ); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
624
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
9
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
10
|
|
|
|
|
|
|
our $MITE_VERSION = "0.012000"; |
11
|
|
|
|
|
|
|
# Mite keywords |
12
|
|
|
|
|
|
|
BEGIN { |
13
|
4
|
|
|
4
|
|
16
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "MyTest" ); |
14
|
4
|
|
|
|
|
16
|
( *after, *around, *before, *extends, *has, *signature_for, *with ) = do { |
15
|
|
|
|
|
|
|
package Mite::Shim; |
16
|
4
|
|
|
4
|
|
28
|
no warnings 'redefine'; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
908
|
|
17
|
|
|
|
|
|
|
( |
18
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
19
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
20
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
21
|
|
|
|
|
|
|
sub {}, |
22
|
4
|
|
|
|
|
68
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
23
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
24
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
25
|
4
|
|
|
|
|
184
|
); |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
}; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# Gather metadata for constructor and destructor |
30
|
|
|
|
|
|
|
sub __META__ { |
31
|
4
|
|
|
4
|
|
32
|
no strict 'refs'; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
3136
|
|
32
|
4
|
|
33
|
4
|
|
8
|
my $class = shift; $class = ref($class) || $class; |
|
4
|
|
|
|
|
24
|
|
33
|
4
|
|
|
|
|
36
|
my $linear_isa = mro::get_linear_isa( $class ); |
34
|
|
|
|
|
|
|
return { |
35
|
|
|
|
|
|
|
BUILD => [ |
36
|
4
|
50
|
|
|
|
16
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
4
|
|
|
|
|
28
|
|
|
0
|
|
|
|
|
0
|
|
37
|
4
|
|
|
|
|
16
|
map { "$_\::BUILD" } reverse @$linear_isa |
38
|
|
|
|
|
|
|
], |
39
|
|
|
|
|
|
|
DEMOLISH => [ |
40
|
4
|
50
|
|
|
|
8
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
4
|
|
|
|
|
56
|
|
|
0
|
|
|
|
|
0
|
|
41
|
4
|
|
|
|
|
12
|
map { "$_\::DEMOLISH" } @$linear_isa |
|
4
|
|
|
|
|
16
|
|
42
|
|
|
|
|
|
|
], |
43
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
44
|
|
|
|
|
|
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
45
|
|
|
|
|
|
|
}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
50
|
|
|
|
|
|
|
sub new { |
51
|
4
|
50
|
|
4
|
|
764
|
my $class = ref($_[0]) ? ref(shift) : shift; |
52
|
4
|
|
33
|
|
|
32
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
53
|
4
|
|
|
|
|
12
|
my $self = bless {}, $class; |
54
|
4
|
50
|
|
|
|
24
|
my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; |
|
0
|
50
|
|
|
|
0
|
|
55
|
4
|
|
|
|
|
24
|
my $no_build = delete $args->{__no_BUILD__}; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# Attribute foo |
58
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/rLRJ5T68lT, line 3 |
59
|
4
|
50
|
|
|
|
364
|
$args->{"foo"} = Storable::dclone( $args->{"foo"} ) if exists( $args->{"foo"} ); |
60
|
4
|
50
|
|
|
|
28
|
if ( exists $args->{"foo"} ) { $self->{"foo"} = $args->{"foo"}; } ; |
|
4
|
|
|
|
|
20
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# Call BUILD methods |
64
|
4
|
50
|
33
|
|
|
12
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
|
4
|
50
|
|
|
|
32
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# Unrecognized parameters |
67
|
4
|
50
|
|
|
|
8
|
my @unknown = grep not( /\Afoo\z/ ), keys %{$args}; @unknown and Mite::Shim::croak( "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
|
4
|
|
|
|
|
28
|
|
|
4
|
|
|
|
|
16
|
|
68
|
|
|
|
|
|
|
|
69
|
4
|
|
|
|
|
20
|
return $self; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
73
|
|
|
|
|
|
|
sub BUILDALL { |
74
|
0
|
|
|
0
|
|
0
|
my $class = ref( $_[0] ); |
75
|
0
|
|
0
|
|
|
0
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
76
|
0
|
0
|
|
|
|
0
|
$_->( @_ ) for @{ $meta->{BUILD} || [] }; |
|
0
|
|
|
|
|
0
|
|
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
80
|
|
|
|
|
|
|
sub DESTROY { |
81
|
4
|
|
|
4
|
|
12380
|
my $self = shift; |
82
|
4
|
|
33
|
|
|
16
|
my $class = ref( $self ) || $self; |
83
|
4
|
|
33
|
|
|
12
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
84
|
4
|
50
|
|
|
|
20
|
my $in_global_destruction = defined ${^GLOBAL_PHASE} |
85
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
86
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
87
|
4
|
50
|
|
|
|
8
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
|
4
|
|
|
|
|
16
|
|
88
|
0
|
|
|
|
|
0
|
my $e = do { |
89
|
0
|
|
|
|
|
0
|
local ( $?, $@ ); |
90
|
0
|
|
|
|
|
0
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
|
0
|
|
|
|
|
0
|
|
91
|
0
|
|
|
|
|
0
|
$@; |
92
|
|
|
|
|
|
|
}; |
93
|
4
|
|
|
4
|
|
28
|
no warnings 'misc'; # avoid (in cleanup) warnings |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
1356
|
|
94
|
0
|
0
|
|
|
|
0
|
die $e if $e; # rethrow |
95
|
|
|
|
|
|
|
} |
96
|
4
|
|
|
|
|
44
|
return; |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
# Accessors for foo |
102
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/rLRJ5T68lT, line 3 |
103
|
4
|
50
|
|
4
|
|
32
|
sub foo { @_ == 1 or Mite::Shim::croak( 'Reader "foo" usage: $self->foo()' ); Storable::dclone( $_[0]{"foo"} ) } |
|
4
|
|
|
|
|
108
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
# See UNIVERSAL |
107
|
|
|
|
|
|
|
sub DOES { |
108
|
28
|
|
|
28
|
|
48
|
my ( $self, $role ) = @_; |
109
|
28
|
|
|
|
|
32
|
our %DOES; |
110
|
28
|
50
|
|
|
|
48
|
return $DOES{$role} if exists $DOES{$role}; |
111
|
28
|
50
|
|
|
|
52
|
return 1 if $role eq __PACKAGE__; |
112
|
28
|
50
|
0
|
|
|
60
|
if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) { |
|
|
|
33
|
|
|
|
|
113
|
0
|
0
|
0
|
|
|
0
|
$meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1; |
114
|
|
|
|
|
|
|
} |
115
|
28
|
|
|
|
|
144
|
return $self->SUPER::DOES( $role ); |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
119
|
|
|
|
|
|
|
sub does { |
120
|
28
|
|
|
28
|
|
8548
|
shift->DOES( @_ ); |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
1; |
124
|
|
|
|
|
|
|
} |