line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
package GP1; |
3
|
1
|
|
|
1
|
|
29
|
use strict; |
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
82
|
|
4
|
1
|
|
|
1
|
|
11
|
use warnings; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
166
|
|
5
|
1
|
|
|
1
|
|
13
|
no warnings qw( once void ); |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
250
|
|
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
|
|
10
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "GP1" ); |
13
|
1
|
|
|
|
|
8
|
( *after, *around, *before, *extends, *has, *signature_for, *with ) = do { |
14
|
|
|
|
|
|
|
package Mite::Shim; |
15
|
1
|
|
|
1
|
|
13
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
256
|
|
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
|
1
|
|
|
|
|
16
|
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
|
1
|
|
|
|
|
83
|
); |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# Gather metadata for constructor and destructor |
29
|
|
|
|
|
|
|
sub __META__ { |
30
|
1
|
|
|
1
|
|
11
|
no strict 'refs'; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
870
|
|
31
|
3
|
|
33
|
3
|
|
6
|
my $class = shift; $class = ref($class) || $class; |
|
3
|
|
|
|
|
12
|
|
32
|
3
|
|
|
|
|
11
|
my $linear_isa = mro::get_linear_isa( $class ); |
33
|
|
|
|
|
|
|
return { |
34
|
|
|
|
|
|
|
BUILD => [ |
35
|
6
|
50
|
|
|
|
7
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
6
|
|
|
|
|
26
|
|
|
0
|
|
|
|
|
0
|
|
36
|
6
|
|
|
|
|
15
|
map { "$_\::BUILD" } reverse @$linear_isa |
37
|
|
|
|
|
|
|
], |
38
|
|
|
|
|
|
|
DEMOLISH => [ |
39
|
6
|
50
|
|
|
|
7
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
6
|
|
|
|
|
75
|
|
|
0
|
|
|
|
|
0
|
|
40
|
3
|
|
|
|
|
6
|
map { "$_\::DEMOLISH" } @$linear_isa |
|
6
|
|
|
|
|
13
|
|
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
|
1
|
50
|
|
1
|
|
162
|
my $class = ref($_[0]) ? ref(shift) : shift; |
51
|
1
|
|
33
|
|
|
6
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
52
|
1
|
|
|
|
|
3
|
my $self = bless {}, $class; |
53
|
1
|
50
|
|
|
|
5
|
my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; |
|
0
|
50
|
|
|
|
0
|
|
54
|
1
|
|
|
|
|
3
|
my $no_build = delete $args->{__no_BUILD__}; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# Attribute foo |
57
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/Ty5nUFJtF3, line 3 |
58
|
1
|
50
|
|
|
|
6
|
$self->{"foo"} = ( exists( $args->{"foo"} ) ? $args->{"foo"} : "23" ); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
# Call BUILD methods |
62
|
1
|
50
|
33
|
|
|
4
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
|
1
|
50
|
|
|
|
5
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# Unrecognized parameters |
65
|
1
|
50
|
|
|
|
3
|
my @unknown = grep not( /\Afoo\z/ ), keys %{$args}; @unknown and Mite::Shim::croak( "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
66
|
|
|
|
|
|
|
|
67
|
1
|
|
|
|
|
10
|
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
|
3
|
|
|
3
|
|
2113
|
my $self = shift; |
80
|
3
|
|
33
|
|
|
7
|
my $class = ref( $self ) || $self; |
81
|
3
|
|
33
|
|
|
9
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
82
|
3
|
50
|
|
|
|
10
|
my $in_global_destruction = defined ${^GLOBAL_PHASE} |
83
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
84
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
85
|
3
|
50
|
|
|
|
4
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
|
3
|
|
|
|
|
7
|
|
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
|
1
|
|
|
1
|
|
13
|
no warnings 'misc'; # avoid (in cleanup) warnings |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
467
|
|
92
|
0
|
0
|
|
|
|
0
|
die $e if $e; # rethrow |
93
|
|
|
|
|
|
|
} |
94
|
3
|
|
|
|
|
18
|
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/Ty5nUFJtF3, 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
|
21
|
|
|
21
|
|
29
|
my ( $self, $role ) = @_; |
115
|
21
|
|
|
|
|
20
|
our %DOES; |
116
|
21
|
50
|
|
|
|
32
|
return $DOES{$role} if exists $DOES{$role}; |
117
|
21
|
50
|
|
|
|
33
|
return 1 if $role eq __PACKAGE__; |
118
|
21
|
50
|
0
|
|
|
38
|
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
|
21
|
|
|
|
|
103
|
return $self->SUPER::DOES( $role ); |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
125
|
|
|
|
|
|
|
sub does { |
126
|
7
|
|
|
7
|
|
660
|
shift->DOES( @_ ); |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
1; |
130
|
|
|
|
|
|
|
}{ |
131
|
|
|
|
|
|
|
package P1; |
132
|
1
|
|
|
1
|
|
10
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
133
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
37
|
|
134
|
1
|
|
|
1
|
|
6
|
no warnings qw( once void ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
172
|
|
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
|
1
|
|
|
1
|
|
10
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "P1" ); |
142
|
1
|
|
|
|
|
2
|
( *after, *around, *before, *extends, *has, *signature_for, *with ) = do { |
143
|
|
|
|
|
|
|
package Mite::Shim; |
144
|
1
|
|
|
1
|
|
14
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
233
|
|
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
|
1
|
|
|
|
|
5
|
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
|
1
|
|
|
|
|
98
|
); |
154
|
|
|
|
|
|
|
}; |
155
|
|
|
|
|
|
|
}; |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
BEGIN { |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
|
161
|
1
|
|
|
1
|
|
7
|
use mro 'c3'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
22
|
|
162
|
1
|
|
|
1
|
|
49
|
our @ISA; |
163
|
1
|
|
|
|
|
617
|
push @ISA, "GP1"; |
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
167
|
|
|
|
|
|
|
sub new { |
168
|
1
|
50
|
|
1
|
|
2267
|
my $class = ref($_[0]) ? ref(shift) : shift; |
169
|
1
|
|
33
|
|
|
17
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
170
|
1
|
|
|
|
|
4
|
my $self = bless {}, $class; |
171
|
1
|
50
|
|
|
|
5
|
my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; |
|
0
|
50
|
|
|
|
0
|
|
172
|
1
|
|
|
|
|
13
|
my $no_build = delete $args->{__no_BUILD__}; |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
# Attribute foo |
175
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/Ty5nUFJtF3, line 10 |
176
|
1
|
50
|
|
|
|
7
|
$self->{"foo"} = ( exists( $args->{"foo"} ) ? $args->{"foo"} : "42" ); |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
# Call BUILD methods |
180
|
1
|
50
|
33
|
|
|
4
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
|
1
|
50
|
|
|
|
16
|
|
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
# Unrecognized parameters |
183
|
1
|
50
|
|
|
|
5
|
my @unknown = grep not( /\Afoo\z/ ), keys %{$args}; @unknown and Mite::Shim::croak( "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
184
|
|
|
|
|
|
|
|
185
|
1
|
|
|
|
|
5
|
return $self; |
186
|
|
|
|
|
|
|
} |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
# Accessors for foo |
191
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/Ty5nUFJtF3, line 10 |
192
|
|
|
|
|
|
|
if ( $__XS ) { |
193
|
|
|
|
|
|
|
Class::XSAccessor->import( |
194
|
|
|
|
|
|
|
chained => 1, |
195
|
|
|
|
|
|
|
"accessors" => { "foo" => "foo" }, |
196
|
|
|
|
|
|
|
); |
197
|
|
|
|
|
|
|
} |
198
|
|
|
|
|
|
|
else { |
199
|
|
|
|
|
|
|
*foo = sub { @_ > 1 ? do { $_[0]{"foo"} = $_[1]; $_[0]; } : ( $_[0]{"foo"} ) }; |
200
|
|
|
|
|
|
|
} |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
# See UNIVERSAL |
204
|
|
|
|
|
|
|
sub DOES { |
205
|
14
|
|
|
14
|
|
22
|
my ( $self, $role ) = @_; |
206
|
14
|
|
|
|
|
16
|
our %DOES; |
207
|
14
|
50
|
|
|
|
21
|
return $DOES{$role} if exists $DOES{$role}; |
208
|
14
|
50
|
|
|
|
22
|
return 1 if $role eq __PACKAGE__; |
209
|
14
|
50
|
0
|
|
|
25
|
if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) { |
|
|
|
33
|
|
|
|
|
210
|
0
|
0
|
0
|
|
|
0
|
$meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1; |
211
|
|
|
|
|
|
|
} |
212
|
14
|
|
|
|
|
96
|
return $self->SUPER::DOES( $role ); |
213
|
|
|
|
|
|
|
} |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
216
|
|
|
|
|
|
|
sub does { |
217
|
7
|
|
|
7
|
|
686
|
shift->DOES( @_ ); |
218
|
|
|
|
|
|
|
} |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
1; |
221
|
|
|
|
|
|
|
}{ |
222
|
|
|
|
|
|
|
package C1; |
223
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
224
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
69
|
|
225
|
1
|
|
|
1
|
|
6
|
no warnings qw( once void ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
121
|
|
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
228
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
229
|
|
|
|
|
|
|
our $MITE_VERSION = "0.012000"; |
230
|
|
|
|
|
|
|
# Mite keywords |
231
|
|
|
|
|
|
|
BEGIN { |
232
|
1
|
|
|
1
|
|
5
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "C1" ); |
233
|
1
|
|
|
|
|
1
|
( *after, *around, *before, *extends, *has, *signature_for, *with ) = do { |
234
|
|
|
|
|
|
|
package Mite::Shim; |
235
|
1
|
|
|
1
|
|
11
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
218
|
|
236
|
|
|
|
|
|
|
( |
237
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
238
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
239
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
240
|
|
|
|
|
|
|
sub {}, |
241
|
1
|
|
|
|
|
10
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
242
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
243
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
244
|
1
|
|
|
|
|
46
|
); |
245
|
|
|
|
|
|
|
}; |
246
|
|
|
|
|
|
|
}; |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
BEGIN { |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
|
252
|
1
|
|
|
1
|
|
6
|
use mro 'c3'; |
|
1
|
|
|
|
|
35
|
|
|
1
|
|
|
|
|
7
|
|
253
|
1
|
|
|
1
|
|
74
|
our @ISA; |
254
|
1
|
|
|
|
|
654
|
push @ISA, "P1"; |
255
|
|
|
|
|
|
|
} |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
258
|
|
|
|
|
|
|
sub new { |
259
|
1
|
50
|
|
1
|
|
1274
|
my $class = ref($_[0]) ? ref(shift) : shift; |
260
|
1
|
|
33
|
|
|
12
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
261
|
1
|
|
|
|
|
3
|
my $self = bless {}, $class; |
262
|
1
|
50
|
|
|
|
5
|
my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; |
|
0
|
50
|
|
|
|
0
|
|
263
|
1
|
|
|
|
|
1
|
my $no_build = delete $args->{__no_BUILD__}; |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
# Attribute foo |
266
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/Ty5nUFJtF3, line 10 |
267
|
1
|
50
|
|
|
|
8
|
$self->{"foo"} = ( exists( $args->{"foo"} ) ? $args->{"foo"} : "42" ); |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
# Attribute bar |
270
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/Ty5nUFJtF3, line 17 |
271
|
1
|
50
|
|
|
|
5
|
if ( exists $args->{"bar"} ) { $self->{"bar"} = $args->{"bar"}; } ; |
|
0
|
|
|
|
|
0
|
|
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
# Call BUILD methods |
275
|
1
|
50
|
33
|
|
|
3
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
|
1
|
50
|
|
|
|
15
|
|
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
# Unrecognized parameters |
278
|
1
|
50
|
|
|
|
3
|
my @unknown = grep not( /\A(?:bar|foo)\z/ ), keys %{$args}; @unknown and Mite::Shim::croak( "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
4
|
|
279
|
|
|
|
|
|
|
|
280
|
1
|
|
|
|
|
4
|
return $self; |
281
|
|
|
|
|
|
|
} |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
# Accessors for bar |
286
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/Ty5nUFJtF3, line 17 |
287
|
|
|
|
|
|
|
if ( $__XS ) { |
288
|
|
|
|
|
|
|
Class::XSAccessor->import( |
289
|
|
|
|
|
|
|
chained => 1, |
290
|
|
|
|
|
|
|
"accessors" => { "bar" => "bar" }, |
291
|
|
|
|
|
|
|
); |
292
|
|
|
|
|
|
|
} |
293
|
|
|
|
|
|
|
else { |
294
|
|
|
|
|
|
|
*bar = sub { @_ > 1 ? do { $_[0]{"bar"} = $_[1]; $_[0]; } : ( $_[0]{"bar"} ) }; |
295
|
|
|
|
|
|
|
} |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
# See UNIVERSAL |
299
|
|
|
|
|
|
|
sub DOES { |
300
|
7
|
|
|
7
|
|
8
|
my ( $self, $role ) = @_; |
301
|
7
|
|
|
|
|
8
|
our %DOES; |
302
|
7
|
50
|
|
|
|
12
|
return $DOES{$role} if exists $DOES{$role}; |
303
|
7
|
50
|
|
|
|
53
|
return 1 if $role eq __PACKAGE__; |
304
|
7
|
50
|
0
|
|
|
15
|
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
|
7
|
|
|
|
|
19
|
return $self->SUPER::DOES( $role ); |
308
|
|
|
|
|
|
|
} |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
311
|
|
|
|
|
|
|
sub does { |
312
|
7
|
|
|
7
|
|
720
|
shift->DOES( @_ ); |
313
|
|
|
|
|
|
|
} |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
1; |
316
|
|
|
|
|
|
|
} |