line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
package xGP1; |
3
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
60
|
|
4
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
58
|
|
5
|
2
|
|
|
2
|
|
10
|
no warnings qw( once void ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
296
|
|
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
|
2
|
|
|
2
|
|
8
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "xGP1" ); |
13
|
2
|
|
|
|
|
18
|
( *after, *around, *before, *extends, *has, *signature_for, *with ) = do { |
14
|
|
|
|
|
|
|
package Mite::Shim; |
15
|
2
|
|
|
2
|
|
14
|
no warnings 'redefine'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
380
|
|
16
|
|
|
|
|
|
|
( |
17
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
18
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
19
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
20
|
|
|
|
|
|
|
sub {}, |
21
|
2
|
|
|
|
|
12
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
22
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
23
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
24
|
2
|
|
|
|
|
108
|
); |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# Gather metadata for constructor and destructor |
29
|
|
|
|
|
|
|
sub __META__ { |
30
|
2
|
|
|
2
|
|
16
|
no strict 'refs'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1252
|
|
31
|
8
|
|
33
|
8
|
|
14
|
my $class = shift; $class = ref($class) || $class; |
|
8
|
|
|
|
|
66
|
|
32
|
8
|
|
|
|
|
30
|
my $linear_isa = mro::get_linear_isa( $class ); |
33
|
|
|
|
|
|
|
return { |
34
|
|
|
|
|
|
|
BUILD => [ |
35
|
18
|
50
|
|
|
|
20
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
18
|
|
|
|
|
76
|
|
|
0
|
|
|
|
|
0
|
|
36
|
18
|
|
|
|
|
44
|
map { "$_\::BUILD" } reverse @$linear_isa |
37
|
|
|
|
|
|
|
], |
38
|
|
|
|
|
|
|
DEMOLISH => [ |
39
|
18
|
50
|
|
|
|
20
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
18
|
|
|
|
|
134
|
|
|
0
|
|
|
|
|
0
|
|
40
|
8
|
|
|
|
|
20
|
map { "$_\::DEMOLISH" } @$linear_isa |
|
18
|
|
|
|
|
34
|
|
41
|
|
|
|
|
|
|
], |
42
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
43
|
|
|
|
|
|
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
44
|
|
|
|
|
|
|
}; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
49
|
|
|
|
|
|
|
sub new { |
50
|
2
|
50
|
|
2
|
|
344
|
my $class = ref($_[0]) ? ref(shift) : shift; |
51
|
2
|
|
33
|
|
|
14
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
52
|
2
|
|
|
|
|
6
|
my $self = bless {}, $class; |
53
|
2
|
50
|
|
|
|
10
|
my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; |
|
0
|
50
|
|
|
|
0
|
|
54
|
2
|
|
|
|
|
4
|
my $no_build = delete $args->{__no_BUILD__}; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# Attribute foo |
57
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/o5RWkZRrKK, line 3 |
58
|
2
|
50
|
|
|
|
12
|
$self->{"foo"} = ( exists( $args->{"foo"} ) ? $args->{"foo"} : "gp1 foo default" ); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
# Call BUILD methods |
62
|
2
|
50
|
33
|
|
|
10
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
|
2
|
50
|
|
|
|
8
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# Unrecognized parameters |
65
|
2
|
50
|
|
|
|
6
|
my @unknown = grep not( /\Afoo\z/ ), keys %{$args}; @unknown and Mite::Shim::croak( "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
6
|
|
66
|
|
|
|
|
|
|
|
67
|
2
|
|
|
|
|
18
|
return $self; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
71
|
|
|
|
|
|
|
sub BUILDALL { |
72
|
0
|
|
|
0
|
|
0
|
my $class = ref( $_[0] ); |
73
|
0
|
|
0
|
|
|
0
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
74
|
0
|
0
|
|
|
|
0
|
$_->( @_ ) for @{ $meta->{BUILD} || [] }; |
|
0
|
|
|
|
|
0
|
|
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
78
|
|
|
|
|
|
|
sub DESTROY { |
79
|
8
|
|
|
8
|
|
3838
|
my $self = shift; |
80
|
8
|
|
33
|
|
|
32
|
my $class = ref( $self ) || $self; |
81
|
8
|
|
33
|
|
|
16
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
82
|
8
|
50
|
|
|
|
20
|
my $in_global_destruction = defined ${^GLOBAL_PHASE} |
83
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
84
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
85
|
8
|
50
|
|
|
|
12
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
|
8
|
|
|
|
|
20
|
|
86
|
0
|
|
|
|
|
0
|
my $e = do { |
87
|
0
|
|
|
|
|
0
|
local ( $?, $@ ); |
88
|
0
|
|
|
|
|
0
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
|
0
|
|
|
|
|
0
|
|
89
|
0
|
|
|
|
|
0
|
$@; |
90
|
|
|
|
|
|
|
}; |
91
|
2
|
|
|
2
|
|
14
|
no warnings 'misc'; # avoid (in cleanup) warnings |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
776
|
|
92
|
0
|
0
|
|
|
|
0
|
die $e if $e; # rethrow |
93
|
|
|
|
|
|
|
} |
94
|
8
|
|
|
|
|
28
|
return; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
# Accessors for foo |
100
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/o5RWkZRrKK, line 3 |
101
|
|
|
|
|
|
|
if ( $__XS ) { |
102
|
|
|
|
|
|
|
Class::XSAccessor->import( |
103
|
|
|
|
|
|
|
chained => 1, |
104
|
|
|
|
|
|
|
"accessors" => { "foo" => "foo" }, |
105
|
|
|
|
|
|
|
); |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
else { |
108
|
|
|
|
|
|
|
*foo = sub { @_ > 1 ? do { $_[0]{"foo"} = $_[1]; $_[0]; } : ( $_[0]{"foo"} ) }; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
# See UNIVERSAL |
113
|
|
|
|
|
|
|
sub DOES { |
114
|
56
|
|
|
56
|
|
80
|
my ( $self, $role ) = @_; |
115
|
56
|
|
|
|
|
50
|
our %DOES; |
116
|
56
|
50
|
|
|
|
82
|
return $DOES{$role} if exists $DOES{$role}; |
117
|
56
|
50
|
|
|
|
80
|
return 1 if $role eq __PACKAGE__; |
118
|
56
|
50
|
0
|
|
|
86
|
if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) { |
|
|
|
33
|
|
|
|
|
119
|
0
|
0
|
0
|
|
|
0
|
$meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1; |
120
|
|
|
|
|
|
|
} |
121
|
56
|
|
|
|
|
246
|
return $self->SUPER::DOES( $role ); |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
125
|
|
|
|
|
|
|
sub does { |
126
|
14
|
|
|
14
|
|
4046
|
shift->DOES( @_ ); |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
1; |
130
|
|
|
|
|
|
|
}{ |
131
|
|
|
|
|
|
|
package xP1; |
132
|
2
|
|
|
2
|
|
16
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
60
|
|
133
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
54
|
|
134
|
2
|
|
|
2
|
|
10
|
no warnings qw( once void ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
232
|
|
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
137
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
138
|
|
|
|
|
|
|
our $MITE_VERSION = "0.012000"; |
139
|
|
|
|
|
|
|
# Mite keywords |
140
|
|
|
|
|
|
|
BEGIN { |
141
|
2
|
|
|
2
|
|
14
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "xP1" ); |
142
|
2
|
|
|
|
|
4
|
( *after, *around, *before, *extends, *has, *signature_for, *with ) = do { |
143
|
|
|
|
|
|
|
package Mite::Shim; |
144
|
2
|
|
|
2
|
|
32
|
no warnings 'redefine'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
454
|
|
145
|
|
|
|
|
|
|
( |
146
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
147
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
148
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
149
|
|
|
|
|
|
|
sub {}, |
150
|
2
|
|
|
|
|
8
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
151
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
152
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
153
|
2
|
|
|
|
|
194
|
); |
154
|
|
|
|
|
|
|
}; |
155
|
|
|
|
|
|
|
}; |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
BEGIN { |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
|
161
|
2
|
|
|
2
|
|
18
|
use mro 'c3'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
56
|
|
162
|
2
|
|
|
2
|
|
104
|
our @ISA; |
163
|
2
|
|
|
|
|
1242
|
push @ISA, "xGP1"; |
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
167
|
|
|
|
|
|
|
sub new { |
168
|
2
|
50
|
|
2
|
|
6252
|
my $class = ref($_[0]) ? ref(shift) : shift; |
169
|
2
|
|
33
|
|
|
38
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
170
|
2
|
|
|
|
|
6
|
my $self = bless {}, $class; |
171
|
2
|
50
|
|
|
|
12
|
my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; |
|
0
|
50
|
|
|
|
0
|
|
172
|
2
|
|
|
|
|
32
|
my $no_build = delete $args->{__no_BUILD__}; |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
# Attribute foo |
175
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/o5RWkZRrKK, line 3 |
176
|
2
|
50
|
|
|
|
16
|
$self->{"foo"} = ( exists( $args->{"foo"} ) ? $args->{"foo"} : "gp1 foo default" ); |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
# Attribute bar |
179
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/o5RWkZRrKK, line 10 |
180
|
2
|
50
|
|
|
|
18
|
$self->{"bar"} = ( exists( $args->{"bar"} ) ? $args->{"bar"} : "p1 bar default" ); |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
# Call BUILD methods |
184
|
2
|
50
|
33
|
|
|
8
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
|
2
|
50
|
|
|
|
10
|
|
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
# Unrecognized parameters |
187
|
2
|
50
|
|
|
|
4
|
my @unknown = grep not( /\A(?:bar|foo)\z/ ), keys %{$args}; @unknown and Mite::Shim::croak( "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
4
|
|
188
|
|
|
|
|
|
|
|
189
|
2
|
|
|
|
|
10
|
return $self; |
190
|
|
|
|
|
|
|
} |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
# Accessors for bar |
195
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/o5RWkZRrKK, line 10 |
196
|
|
|
|
|
|
|
if ( $__XS ) { |
197
|
|
|
|
|
|
|
Class::XSAccessor->import( |
198
|
|
|
|
|
|
|
chained => 1, |
199
|
|
|
|
|
|
|
"accessors" => { "bar" => "bar" }, |
200
|
|
|
|
|
|
|
); |
201
|
|
|
|
|
|
|
} |
202
|
|
|
|
|
|
|
else { |
203
|
|
|
|
|
|
|
*bar = sub { @_ > 1 ? do { $_[0]{"bar"} = $_[1]; $_[0]; } : ( $_[0]{"bar"} ) }; |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
# See UNIVERSAL |
208
|
|
|
|
|
|
|
sub DOES { |
209
|
28
|
|
|
28
|
|
40
|
my ( $self, $role ) = @_; |
210
|
28
|
|
|
|
|
32
|
our %DOES; |
211
|
28
|
50
|
|
|
|
40
|
return $DOES{$role} if exists $DOES{$role}; |
212
|
28
|
50
|
|
|
|
44
|
return 1 if $role eq __PACKAGE__; |
213
|
28
|
50
|
0
|
|
|
48
|
if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) { |
|
|
|
33
|
|
|
|
|
214
|
0
|
0
|
0
|
|
|
0
|
$meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1; |
215
|
|
|
|
|
|
|
} |
216
|
28
|
|
|
|
|
46
|
return $self->SUPER::DOES( $role ); |
217
|
|
|
|
|
|
|
} |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
220
|
|
|
|
|
|
|
sub does { |
221
|
14
|
|
|
14
|
|
1272
|
shift->DOES( @_ ); |
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
1; |
225
|
|
|
|
|
|
|
}{ |
226
|
|
|
|
|
|
|
package xP2; |
227
|
2
|
|
|
2
|
|
34
|
use strict; |
|
2
|
|
|
|
|
20
|
|
|
2
|
|
|
|
|
76
|
|
228
|
2
|
|
|
2
|
|
18
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
60
|
|
229
|
2
|
|
|
2
|
|
8
|
no warnings qw( once void ); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
238
|
|
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
232
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
233
|
|
|
|
|
|
|
our $MITE_VERSION = "0.012000"; |
234
|
|
|
|
|
|
|
# Mite keywords |
235
|
|
|
|
|
|
|
BEGIN { |
236
|
2
|
|
|
2
|
|
8
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "xP2" ); |
237
|
2
|
|
|
|
|
4
|
( *after, *around, *before, *extends, *has, *signature_for, *with ) = do { |
238
|
|
|
|
|
|
|
package Mite::Shim; |
239
|
2
|
|
|
2
|
|
12
|
no warnings 'redefine'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
402
|
|
240
|
|
|
|
|
|
|
( |
241
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
242
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
243
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
244
|
|
|
|
|
|
|
sub {}, |
245
|
2
|
|
|
|
|
6
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
246
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
247
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
248
|
2
|
|
|
|
|
116
|
); |
249
|
|
|
|
|
|
|
}; |
250
|
|
|
|
|
|
|
}; |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
BEGIN { |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
|
256
|
2
|
|
|
2
|
|
14
|
use mro 'c3'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
10
|
|
257
|
2
|
|
|
2
|
|
112
|
our @ISA; |
258
|
2
|
|
|
|
|
1128
|
push @ISA, "xGP1"; |
259
|
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
262
|
|
|
|
|
|
|
sub new { |
263
|
2
|
50
|
|
2
|
|
3716
|
my $class = ref($_[0]) ? ref(shift) : shift; |
264
|
2
|
|
33
|
|
|
24
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
265
|
2
|
|
|
|
|
6
|
my $self = bless {}, $class; |
266
|
2
|
50
|
|
|
|
12
|
my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; |
|
0
|
50
|
|
|
|
0
|
|
267
|
2
|
|
|
|
|
4
|
my $no_build = delete $args->{__no_BUILD__}; |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
# Attribute foo |
270
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/o5RWkZRrKK, line 17 |
271
|
2
|
50
|
|
|
|
10
|
$self->{"foo"} = ( exists( $args->{"foo"} ) ? $args->{"foo"} : "p2 foo default" ); |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
# Call BUILD methods |
275
|
2
|
50
|
33
|
|
|
8
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
|
2
|
50
|
|
|
|
36
|
|
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
# Unrecognized parameters |
278
|
2
|
50
|
|
|
|
4
|
my @unknown = grep not( /\Afoo\z/ ), keys %{$args}; @unknown and Mite::Shim::croak( "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
8
|
|
279
|
|
|
|
|
|
|
|
280
|
2
|
|
|
|
|
8
|
return $self; |
281
|
|
|
|
|
|
|
} |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
# Accessors for foo |
286
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/o5RWkZRrKK, line 17 |
287
|
|
|
|
|
|
|
if ( $__XS ) { |
288
|
|
|
|
|
|
|
Class::XSAccessor->import( |
289
|
|
|
|
|
|
|
chained => 1, |
290
|
|
|
|
|
|
|
"accessors" => { "foo" => "foo" }, |
291
|
|
|
|
|
|
|
); |
292
|
|
|
|
|
|
|
} |
293
|
|
|
|
|
|
|
else { |
294
|
|
|
|
|
|
|
*foo = sub { @_ > 1 ? do { $_[0]{"foo"} = $_[1]; $_[0]; } : ( $_[0]{"foo"} ) }; |
295
|
|
|
|
|
|
|
} |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
# See UNIVERSAL |
299
|
|
|
|
|
|
|
sub DOES { |
300
|
14
|
|
|
14
|
|
24
|
my ( $self, $role ) = @_; |
301
|
14
|
|
|
|
|
14
|
our %DOES; |
302
|
14
|
50
|
|
|
|
24
|
return $DOES{$role} if exists $DOES{$role}; |
303
|
14
|
50
|
|
|
|
20
|
return 1 if $role eq __PACKAGE__; |
304
|
14
|
50
|
0
|
|
|
34
|
if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) { |
|
|
|
33
|
|
|
|
|
305
|
0
|
0
|
0
|
|
|
0
|
$meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1; |
306
|
|
|
|
|
|
|
} |
307
|
14
|
|
|
|
|
24
|
return $self->SUPER::DOES( $role ); |
308
|
|
|
|
|
|
|
} |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
311
|
|
|
|
|
|
|
sub does { |
312
|
14
|
|
|
14
|
|
1194
|
shift->DOES( @_ ); |
313
|
|
|
|
|
|
|
} |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
1; |
316
|
|
|
|
|
|
|
}{ |
317
|
|
|
|
|
|
|
package xC1; |
318
|
2
|
|
|
2
|
|
16
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
110
|
|
319
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
74
|
|
320
|
2
|
|
|
2
|
|
12
|
no warnings qw( once void ); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
238
|
|
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
323
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
324
|
|
|
|
|
|
|
our $MITE_VERSION = "0.012000"; |
325
|
|
|
|
|
|
|
# Mite keywords |
326
|
|
|
|
|
|
|
BEGIN { |
327
|
2
|
|
|
2
|
|
8
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "xC1" ); |
328
|
2
|
|
|
|
|
4
|
( *after, *around, *before, *extends, *has, *signature_for, *with ) = do { |
329
|
|
|
|
|
|
|
package Mite::Shim; |
330
|
2
|
|
|
2
|
|
12
|
no warnings 'redefine'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
382
|
|
331
|
|
|
|
|
|
|
( |
332
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
333
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
334
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
335
|
|
|
|
|
|
|
sub {}, |
336
|
2
|
|
|
|
|
6
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
337
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
338
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
339
|
2
|
|
|
|
|
116
|
); |
340
|
|
|
|
|
|
|
}; |
341
|
|
|
|
|
|
|
}; |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
BEGIN { |
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
|
347
|
2
|
|
|
2
|
|
12
|
use mro 'c3'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
14
|
|
348
|
2
|
|
|
2
|
|
94
|
our @ISA; |
349
|
2
|
|
|
|
|
1130
|
push @ISA, "xP1", "xP2"; |
350
|
|
|
|
|
|
|
} |
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
353
|
|
|
|
|
|
|
sub new { |
354
|
2
|
50
|
|
2
|
|
3254
|
my $class = ref($_[0]) ? ref(shift) : shift; |
355
|
2
|
|
33
|
|
|
22
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
356
|
2
|
|
|
|
|
6
|
my $self = bless {}, $class; |
357
|
2
|
50
|
|
|
|
10
|
my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; |
|
0
|
50
|
|
|
|
0
|
|
358
|
2
|
|
|
|
|
4
|
my $no_build = delete $args->{__no_BUILD__}; |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
# Attribute foo |
361
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/o5RWkZRrKK, line 17 |
362
|
2
|
50
|
|
|
|
42
|
$self->{"foo"} = ( exists( $args->{"foo"} ) ? $args->{"foo"} : "p2 foo default" ); |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
# Attribute bar |
365
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/o5RWkZRrKK, line 24 |
366
|
2
|
50
|
|
|
|
8
|
if ( exists $args->{"bar"} ) { $self->{"bar"} = $args->{"bar"}; } ; |
|
0
|
|
|
|
|
0
|
|
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
# Call BUILD methods |
370
|
2
|
50
|
33
|
|
|
6
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
|
2
|
50
|
|
|
|
12
|
|
371
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
# Unrecognized parameters |
373
|
2
|
50
|
|
|
|
4
|
my @unknown = grep not( /\A(?:bar|foo)\z/ ), keys %{$args}; @unknown and Mite::Shim::croak( "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
6
|
|
374
|
|
|
|
|
|
|
|
375
|
2
|
|
|
|
|
8
|
return $self; |
376
|
|
|
|
|
|
|
} |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
# Accessors for bar |
381
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/o5RWkZRrKK, line 24 |
382
|
|
|
|
|
|
|
if ( $__XS ) { |
383
|
|
|
|
|
|
|
Class::XSAccessor->import( |
384
|
|
|
|
|
|
|
chained => 1, |
385
|
|
|
|
|
|
|
"accessors" => { "bar" => "bar" }, |
386
|
|
|
|
|
|
|
); |
387
|
|
|
|
|
|
|
} |
388
|
|
|
|
|
|
|
else { |
389
|
|
|
|
|
|
|
*bar = sub { @_ > 1 ? do { $_[0]{"bar"} = $_[1]; $_[0]; } : ( $_[0]{"bar"} ) }; |
390
|
|
|
|
|
|
|
} |
391
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
# See UNIVERSAL |
394
|
|
|
|
|
|
|
sub DOES { |
395
|
14
|
|
|
14
|
|
16
|
my ( $self, $role ) = @_; |
396
|
14
|
|
|
|
|
14
|
our %DOES; |
397
|
14
|
50
|
|
|
|
30
|
return $DOES{$role} if exists $DOES{$role}; |
398
|
14
|
50
|
|
|
|
20
|
return 1 if $role eq __PACKAGE__; |
399
|
14
|
50
|
0
|
|
|
22
|
if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) { |
|
|
|
33
|
|
|
|
|
400
|
0
|
0
|
0
|
|
|
0
|
$meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1; |
401
|
|
|
|
|
|
|
} |
402
|
14
|
|
|
|
|
26
|
return $self->SUPER::DOES( $role ); |
403
|
|
|
|
|
|
|
} |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
406
|
|
|
|
|
|
|
sub does { |
407
|
14
|
|
|
14
|
|
1248
|
shift->DOES( @_ ); |
408
|
|
|
|
|
|
|
} |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
1; |
411
|
|
|
|
|
|
|
} |