line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
package MyTest1; |
3
|
1
|
|
|
1
|
|
38
|
use strict; |
|
1
|
|
|
|
|
14
|
|
|
1
|
|
|
|
|
97
|
|
4
|
1
|
|
|
1
|
|
16
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
147
|
|
5
|
1
|
|
|
1
|
|
14
|
no warnings qw( once void ); |
|
1
|
|
|
|
|
21
|
|
|
1
|
|
|
|
|
352
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
8
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
9
|
|
|
|
|
|
|
our $MITE_VERSION = "0.012000"; |
10
|
|
|
|
|
|
|
# Mite keywords |
11
|
|
|
|
|
|
|
BEGIN { |
12
|
1
|
|
|
1
|
|
13
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "MyTest1" ); |
13
|
1
|
|
|
|
|
4
|
( *after, *around, *before, *extends, *has, *signature_for, *with ) = do { |
14
|
|
|
|
|
|
|
package Mite::Shim; |
15
|
1
|
|
|
1
|
|
16
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
466
|
|
16
|
|
|
|
|
|
|
( |
17
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
18
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
19
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
20
|
|
|
|
0
|
|
|
sub {}, |
21
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
22
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
23
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
24
|
1
|
|
|
|
|
200
|
); |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# Mite imports |
29
|
|
|
|
|
|
|
BEGIN { |
30
|
1
|
|
|
1
|
|
7
|
*bare = \&Mite::Shim::bare; |
31
|
1
|
|
|
|
|
14
|
*false = \&Mite::Shim::false; |
32
|
1
|
|
|
|
|
4
|
*lazy = \&Mite::Shim::lazy; |
33
|
1
|
|
|
|
|
3
|
*ro = \&Mite::Shim::ro; |
34
|
1
|
|
|
|
|
3
|
*rw = \&Mite::Shim::rw; |
35
|
1
|
|
|
|
|
11
|
*rwp = \&Mite::Shim::rwp; |
36
|
1
|
|
|
|
|
52
|
*true = \&Mite::Shim::true; |
37
|
|
|
|
|
|
|
}; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# Gather metadata for constructor and destructor |
40
|
|
|
|
|
|
|
sub __META__ { |
41
|
1
|
|
|
1
|
|
16
|
no strict 'refs'; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
1184
|
|
42
|
0
|
|
0
|
0
|
|
|
my $class = shift; $class = ref($class) || $class; |
|
0
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
my $linear_isa = mro::get_linear_isa( $class ); |
44
|
|
|
|
|
|
|
return { |
45
|
|
|
|
|
|
|
BUILD => [ |
46
|
0
|
0
|
|
|
|
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
map { "$_\::BUILD" } reverse @$linear_isa |
48
|
|
|
|
|
|
|
], |
49
|
|
|
|
|
|
|
DEMOLISH => [ |
50
|
0
|
0
|
|
|
|
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
map { "$_\::DEMOLISH" } @$linear_isa |
|
0
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
], |
53
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
54
|
|
|
|
|
|
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
55
|
|
|
|
|
|
|
}; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
60
|
|
|
|
|
|
|
sub new { |
61
|
0
|
0
|
|
0
|
|
|
my $class = ref($_[0]) ? ref(shift) : shift; |
62
|
0
|
|
0
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
63
|
0
|
|
|
|
|
|
my $self = bless {}, $class; |
64
|
0
|
0
|
|
|
|
|
my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; |
|
0
|
0
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
my $no_build = delete $args->{__no_BUILD__}; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# Call BUILD methods |
70
|
0
|
0
|
0
|
|
|
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
|
0
|
0
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
# Unrecognized parameters |
73
|
0
|
0
|
|
|
|
|
my @unknown = grep not( do { package MyTest1::__SAFE_NAMESPACE__; defined($_) and do { ref(\$_) eq 'SCALAR' or ref(\(my $val = $_)) eq 'SCALAR' } } ), keys %{$args}; @unknown and Mite::Shim::croak( "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
|
return $self; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
79
|
|
|
|
|
|
|
sub BUILDALL { |
80
|
0
|
|
|
0
|
|
|
my $class = ref( $_[0] ); |
81
|
0
|
|
0
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
82
|
0
|
0
|
|
|
|
|
$_->( @_ ) for @{ $meta->{BUILD} || [] }; |
|
0
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
86
|
|
|
|
|
|
|
sub DESTROY { |
87
|
0
|
|
|
0
|
|
|
my $self = shift; |
88
|
0
|
|
0
|
|
|
|
my $class = ref( $self ) || $self; |
89
|
0
|
|
0
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
90
|
0
|
0
|
|
|
|
|
my $in_global_destruction = defined ${^GLOBAL_PHASE} |
91
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
92
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
93
|
0
|
0
|
|
|
|
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
|
0
|
|
|
|
|
|
|
94
|
0
|
|
|
|
|
|
my $e = do { |
95
|
0
|
|
|
|
|
|
local ( $?, $@ ); |
96
|
0
|
|
|
|
|
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
|
0
|
|
|
|
|
|
|
97
|
0
|
|
|
|
|
|
$@; |
98
|
|
|
|
|
|
|
}; |
99
|
1
|
|
|
1
|
|
31
|
no warnings 'misc'; # avoid (in cleanup) warnings |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
440
|
|
100
|
0
|
0
|
|
|
|
|
die $e if $e; # rethrow |
101
|
|
|
|
|
|
|
} |
102
|
0
|
|
|
|
|
|
return; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
# See UNIVERSAL |
107
|
|
|
|
|
|
|
sub DOES { |
108
|
0
|
|
|
0
|
|
|
my ( $self, $role ) = @_; |
109
|
0
|
|
|
|
|
|
our %DOES; |
110
|
0
|
0
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
111
|
0
|
0
|
|
|
|
|
return 1 if $role eq __PACKAGE__; |
112
|
0
|
0
|
0
|
|
|
|
if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) { |
|
|
|
0
|
|
|
|
|
113
|
0
|
0
|
0
|
|
|
|
$meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1; |
114
|
|
|
|
|
|
|
} |
115
|
0
|
|
|
|
|
|
return $self->SUPER::DOES( $role ); |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
119
|
|
|
|
|
|
|
sub does { |
120
|
0
|
|
|
0
|
|
|
shift->DOES( @_ ); |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
1; |
124
|
|
|
|
|
|
|
}{ |
125
|
|
|
|
|
|
|
package MyTest2; |
126
|
1
|
|
|
1
|
|
10
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
127
|
1
|
|
|
1
|
|
33
|
use warnings; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
60
|
|
128
|
1
|
|
|
1
|
|
14
|
no warnings qw( once void ); |
|
1
|
|
|
|
|
15
|
|
|
1
|
|
|
|
|
178
|
|
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
131
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
132
|
|
|
|
|
|
|
our $MITE_VERSION = "0.012000"; |
133
|
|
|
|
|
|
|
# Mite keywords |
134
|
|
|
|
|
|
|
BEGIN { |
135
|
1
|
|
|
1
|
|
8
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "MyTest2" ); |
136
|
1
|
|
|
|
|
2
|
( *extends, *signature_for, *with ) = do { |
137
|
|
|
|
|
|
|
package Mite::Shim; |
138
|
1
|
|
|
1
|
|
12
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
178
|
|
139
|
|
|
|
|
|
|
( |
140
|
|
|
|
0
|
|
|
sub {}, |
141
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
142
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
143
|
1
|
|
|
|
|
72
|
); |
144
|
|
|
|
|
|
|
}; |
145
|
|
|
|
|
|
|
}; |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
# Gather metadata for constructor and destructor |
148
|
|
|
|
|
|
|
sub __META__ { |
149
|
1
|
|
|
1
|
|
10
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
938
|
|
150
|
0
|
|
0
|
0
|
|
|
my $class = shift; $class = ref($class) || $class; |
|
0
|
|
|
|
|
|
|
151
|
0
|
|
|
|
|
|
my $linear_isa = mro::get_linear_isa( $class ); |
152
|
|
|
|
|
|
|
return { |
153
|
|
|
|
|
|
|
BUILD => [ |
154
|
0
|
0
|
|
|
|
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
155
|
0
|
|
|
|
|
|
map { "$_\::BUILD" } reverse @$linear_isa |
156
|
|
|
|
|
|
|
], |
157
|
|
|
|
|
|
|
DEMOLISH => [ |
158
|
0
|
0
|
|
|
|
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
159
|
0
|
|
|
|
|
|
map { "$_\::DEMOLISH" } @$linear_isa |
|
0
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
], |
161
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
162
|
|
|
|
|
|
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
163
|
|
|
|
|
|
|
}; |
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
168
|
|
|
|
|
|
|
sub new { |
169
|
0
|
0
|
|
0
|
|
|
my $class = ref($_[0]) ? ref(shift) : shift; |
170
|
0
|
|
0
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
171
|
0
|
|
|
|
|
|
my $self = bless {}, $class; |
172
|
0
|
0
|
|
|
|
|
my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; |
|
0
|
0
|
|
|
|
|
|
173
|
0
|
|
|
|
|
|
my $no_build = delete $args->{__no_BUILD__}; |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
# Call BUILD methods |
178
|
0
|
0
|
0
|
|
|
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
|
0
|
0
|
|
|
|
|
|
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
# Unrecognized parameters |
181
|
0
|
0
|
|
|
|
|
my @unknown = grep not( do { package MyTest2::__SAFE_NAMESPACE__; defined($_) and do { ref(\$_) eq 'SCALAR' or ref(\(my $val = $_)) eq 'SCALAR' } } ), keys %{$args}; @unknown and Mite::Shim::croak( "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
|
183
|
0
|
|
|
|
|
|
return $self; |
184
|
|
|
|
|
|
|
} |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
187
|
|
|
|
|
|
|
sub BUILDALL { |
188
|
0
|
|
|
0
|
|
|
my $class = ref( $_[0] ); |
189
|
0
|
|
0
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
190
|
0
|
0
|
|
|
|
|
$_->( @_ ) for @{ $meta->{BUILD} || [] }; |
|
0
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
} |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
194
|
|
|
|
|
|
|
sub DESTROY { |
195
|
0
|
|
|
0
|
|
|
my $self = shift; |
196
|
0
|
|
0
|
|
|
|
my $class = ref( $self ) || $self; |
197
|
0
|
|
0
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
198
|
0
|
0
|
|
|
|
|
my $in_global_destruction = defined ${^GLOBAL_PHASE} |
199
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
200
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
201
|
0
|
0
|
|
|
|
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
|
0
|
|
|
|
|
|
|
202
|
0
|
|
|
|
|
|
my $e = do { |
203
|
0
|
|
|
|
|
|
local ( $?, $@ ); |
204
|
0
|
|
|
|
|
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
|
0
|
|
|
|
|
|
|
205
|
0
|
|
|
|
|
|
$@; |
206
|
|
|
|
|
|
|
}; |
207
|
1
|
|
|
1
|
|
11
|
no warnings 'misc'; # avoid (in cleanup) warnings |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
453
|
|
208
|
0
|
0
|
|
|
|
|
die $e if $e; # rethrow |
209
|
|
|
|
|
|
|
} |
210
|
0
|
|
|
|
|
|
return; |
211
|
|
|
|
|
|
|
} |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
# See UNIVERSAL |
215
|
|
|
|
|
|
|
sub DOES { |
216
|
0
|
|
|
0
|
|
|
my ( $self, $role ) = @_; |
217
|
0
|
|
|
|
|
|
our %DOES; |
218
|
0
|
0
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
219
|
0
|
0
|
|
|
|
|
return 1 if $role eq __PACKAGE__; |
220
|
0
|
0
|
0
|
|
|
|
if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) { |
|
|
|
0
|
|
|
|
|
221
|
0
|
0
|
0
|
|
|
|
$meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1; |
222
|
|
|
|
|
|
|
} |
223
|
0
|
|
|
|
|
|
return $self->SUPER::DOES( $role ); |
224
|
|
|
|
|
|
|
} |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
227
|
|
|
|
|
|
|
sub does { |
228
|
0
|
|
|
0
|
|
|
shift->DOES( @_ ); |
229
|
|
|
|
|
|
|
} |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
1; |
232
|
|
|
|
|
|
|
}{ |
233
|
|
|
|
|
|
|
package MyTest3; |
234
|
1
|
|
|
1
|
|
10
|
use strict; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
38
|
|
235
|
1
|
|
|
1
|
|
19
|
use warnings; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
44
|
|
236
|
1
|
|
|
1
|
|
8
|
no warnings qw( once void ); |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
136
|
|
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
239
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
240
|
|
|
|
|
|
|
our $MITE_VERSION = "0.012000"; |
241
|
|
|
|
|
|
|
# Mite keywords |
242
|
|
|
|
|
|
|
BEGIN { |
243
|
1
|
|
|
1
|
|
15
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "MyTest3" ); |
244
|
1
|
|
|
|
|
93
|
( *has ) = do { |
245
|
|
|
|
|
|
|
package Mite::Shim; |
246
|
1
|
|
|
1
|
|
11
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
120
|
|
247
|
|
|
|
|
|
|
( |
248
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
249
|
1
|
|
|
|
|
44
|
); |
250
|
|
|
|
|
|
|
}; |
251
|
|
|
|
|
|
|
}; |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
# Gather metadata for constructor and destructor |
254
|
|
|
|
|
|
|
sub __META__ { |
255
|
1
|
|
|
1
|
|
17
|
no strict 'refs'; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
929
|
|
256
|
0
|
|
0
|
0
|
|
|
my $class = shift; $class = ref($class) || $class; |
|
0
|
|
|
|
|
|
|
257
|
0
|
|
|
|
|
|
my $linear_isa = mro::get_linear_isa( $class ); |
258
|
|
|
|
|
|
|
return { |
259
|
|
|
|
|
|
|
BUILD => [ |
260
|
0
|
0
|
|
|
|
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
261
|
0
|
|
|
|
|
|
map { "$_\::BUILD" } reverse @$linear_isa |
262
|
|
|
|
|
|
|
], |
263
|
|
|
|
|
|
|
DEMOLISH => [ |
264
|
0
|
0
|
|
|
|
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
265
|
0
|
|
|
|
|
|
map { "$_\::DEMOLISH" } @$linear_isa |
|
0
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
], |
267
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
268
|
|
|
|
|
|
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
269
|
|
|
|
|
|
|
}; |
270
|
|
|
|
|
|
|
} |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
274
|
|
|
|
|
|
|
sub new { |
275
|
0
|
0
|
|
0
|
|
|
my $class = ref($_[0]) ? ref(shift) : shift; |
276
|
0
|
|
0
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
277
|
0
|
|
|
|
|
|
my $self = bless {}, $class; |
278
|
0
|
0
|
|
|
|
|
my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; |
|
0
|
0
|
|
|
|
|
|
279
|
0
|
|
|
|
|
|
my $no_build = delete $args->{__no_BUILD__}; |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
# Call BUILD methods |
284
|
0
|
0
|
0
|
|
|
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
|
0
|
0
|
|
|
|
|
|
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
# Unrecognized parameters |
287
|
0
|
0
|
|
|
|
|
my @unknown = grep not( do { package MyTest3::__SAFE_NAMESPACE__; defined($_) and do { ref(\$_) eq 'SCALAR' or ref(\(my $val = $_)) eq 'SCALAR' } } ), keys %{$args}; @unknown and Mite::Shim::croak( "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
|
289
|
0
|
|
|
|
|
|
return $self; |
290
|
|
|
|
|
|
|
} |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
293
|
|
|
|
|
|
|
sub BUILDALL { |
294
|
0
|
|
|
0
|
|
|
my $class = ref( $_[0] ); |
295
|
0
|
|
0
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
296
|
0
|
0
|
|
|
|
|
$_->( @_ ) for @{ $meta->{BUILD} || [] }; |
|
0
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
300
|
|
|
|
|
|
|
sub DESTROY { |
301
|
0
|
|
|
0
|
|
|
my $self = shift; |
302
|
0
|
|
0
|
|
|
|
my $class = ref( $self ) || $self; |
303
|
0
|
|
0
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
304
|
0
|
0
|
|
|
|
|
my $in_global_destruction = defined ${^GLOBAL_PHASE} |
305
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
306
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
307
|
0
|
0
|
|
|
|
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
|
0
|
|
|
|
|
|
|
308
|
0
|
|
|
|
|
|
my $e = do { |
309
|
0
|
|
|
|
|
|
local ( $?, $@ ); |
310
|
0
|
|
|
|
|
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
|
0
|
|
|
|
|
|
|
311
|
0
|
|
|
|
|
|
$@; |
312
|
|
|
|
|
|
|
}; |
313
|
1
|
|
|
1
|
|
53
|
no warnings 'misc'; # avoid (in cleanup) warnings |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
339
|
|
314
|
0
|
0
|
|
|
|
|
die $e if $e; # rethrow |
315
|
|
|
|
|
|
|
} |
316
|
0
|
|
|
|
|
|
return; |
317
|
|
|
|
|
|
|
} |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
# See UNIVERSAL |
321
|
|
|
|
|
|
|
sub DOES { |
322
|
0
|
|
|
0
|
|
|
my ( $self, $role ) = @_; |
323
|
0
|
|
|
|
|
|
our %DOES; |
324
|
0
|
0
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
325
|
0
|
0
|
|
|
|
|
return 1 if $role eq __PACKAGE__; |
326
|
0
|
0
|
0
|
|
|
|
if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) { |
|
|
|
0
|
|
|
|
|
327
|
0
|
0
|
0
|
|
|
|
$meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1; |
328
|
|
|
|
|
|
|
} |
329
|
0
|
|
|
|
|
|
return $self->SUPER::DOES( $role ); |
330
|
|
|
|
|
|
|
} |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
333
|
|
|
|
|
|
|
sub does { |
334
|
0
|
|
|
0
|
|
|
shift->DOES( @_ ); |
335
|
|
|
|
|
|
|
} |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
1; |
338
|
|
|
|
|
|
|
} |