line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
package Thingy1; |
3
|
1
|
|
|
1
|
|
26
|
use strict; |
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
146
|
|
4
|
1
|
|
|
1
|
|
19
|
use warnings; |
|
1
|
|
|
|
|
23
|
|
|
1
|
|
|
|
|
179
|
|
5
|
1
|
|
|
1
|
|
26
|
no warnings qw( once void ); |
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
484
|
|
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
|
|
54
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "Thingy1" ); |
13
|
1
|
|
|
|
|
4
|
( *after, *around, *before, *extends, *has, *signature_for, *with ) = do { |
14
|
|
|
|
|
|
|
package Mite::Shim; |
15
|
1
|
|
|
1
|
|
18
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
180
|
|
|
1
|
|
|
|
|
677
|
|
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
|
|
|
|
|
17
|
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
|
|
|
|
|
111
|
); |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# Gather metadata for constructor and destructor |
29
|
|
|
|
|
|
|
sub __META__ { |
30
|
1
|
|
|
1
|
|
61
|
no strict 'refs'; |
|
1
|
|
|
|
|
16
|
|
|
1
|
|
|
|
|
2173
|
|
31
|
1
|
|
33
|
1
|
|
6
|
my $class = shift; $class = ref($class) || $class; |
|
1
|
|
|
|
|
9
|
|
32
|
1
|
|
|
|
|
7
|
my $linear_isa = mro::get_linear_isa( $class ); |
33
|
|
|
|
|
|
|
return { |
34
|
|
|
|
|
|
|
BUILD => [ |
35
|
1
|
50
|
|
|
|
2
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
1
|
|
|
|
|
8
|
|
|
0
|
|
|
|
|
0
|
|
36
|
1
|
|
|
|
|
4
|
map { "$_\::BUILD" } reverse @$linear_isa |
37
|
|
|
|
|
|
|
], |
38
|
|
|
|
|
|
|
DEMOLISH => [ |
39
|
1
|
50
|
|
|
|
2
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
1
|
|
|
|
|
17
|
|
|
0
|
|
|
|
|
0
|
|
40
|
1
|
|
|
|
|
3
|
map { "$_\::DEMOLISH" } @$linear_isa |
|
1
|
|
|
|
|
3
|
|
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
|
|
201
|
my $class = ref($_[0]) ? ref(shift) : shift; |
51
|
1
|
|
33
|
|
|
19
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
52
|
1
|
|
|
|
|
2
|
my $self = bless {}, $class; |
53
|
1
|
50
|
|
|
|
6
|
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 xyz (type: ArrayRef[Bool]) |
57
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/L4RD3UeTP8, line 3 |
58
|
1
|
50
|
0
|
|
|
2
|
do { my $value = exists( $args->{"xyz"} ) ? $args->{"xyz"} : []; do { my $coerced_value = do { my $to_coerce = $value; (do { package Thingy1::__SAFE_NAMESPACE__; (ref($to_coerce) eq 'ARRAY') and do { my $ok = 1; for my $i (@{$to_coerce}) { ($ok = 0, last) unless (!ref $i and (!defined $i or $i eq q() or $i eq '0' or $i eq '1')) }; $ok } }) ? $to_coerce : ((ref($to_coerce) eq 'ARRAY')) ? scalar(do { local $_ = $to_coerce; do { my ($orig, $return_orig, @new) = ($_, 0); for (@$orig) { ++$return_orig && last unless (do { package Thingy1::__SAFE_NAMESPACE__; ((!ref $_ and (!defined $_ or $_ eq q() or $_ eq '0' or $_ eq '1')) or (!!1)) }); push @new, (((!ref $_ and (!defined $_ or $_ eq q() or $_ eq '0' or $_ eq '1'))) ? $_ : ((!!1)) ? scalar(do { !!$_ }) : $_); } $return_orig ? $orig : \@new } }) : $to_coerce }; do { package Thingy1::__SAFE_NAMESPACE__; (ref($coerced_value) eq 'ARRAY') and do { my $ok = 1; for my $i (@{$coerced_value}) { ($ok = 0, last) unless (!ref $i and (!defined $i or $i eq q() or $i eq '0' or $i eq '1')) }; $ok } } or Mite::Shim::croak "Type check failed in constructor: %s should be %s", "xyz", "ArrayRef[Bool]"; $self->{"xyz"} = $coerced_value; }; }; |
|
1
|
0
|
0
|
|
|
4
|
|
|
1
|
50
|
0
|
|
|
3
|
|
|
1
|
0
|
0
|
|
|
1
|
|
|
1
|
0
|
0
|
|
|
2
|
|
|
1
|
0
|
0
|
|
|
2
|
|
|
1
|
0
|
0
|
|
|
6
|
|
|
1
|
0
|
0
|
|
|
2
|
|
|
1
|
50
|
|
|
|
2
|
|
|
1
|
0
|
|
|
|
2
|
|
|
0
|
50
|
|
|
|
0
|
|
|
1
|
50
|
|
|
|
4
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
3
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
# Call BUILD methods |
62
|
1
|
50
|
33
|
|
|
5
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
|
1
|
50
|
|
|
|
8
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# Unrecognized parameters |
65
|
1
|
50
|
|
|
|
2
|
my @unknown = grep not( /\Axyz\z/ ), keys %{$args}; @unknown and Mite::Shim::croak( "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
66
|
|
|
|
|
|
|
|
67
|
1
|
|
|
|
|
22
|
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
|
1
|
|
|
1
|
|
3227
|
my $self = shift; |
80
|
1
|
|
33
|
|
|
4
|
my $class = ref( $self ) || $self; |
81
|
1
|
|
33
|
|
|
4
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
82
|
1
|
50
|
|
|
|
5
|
my $in_global_destruction = defined ${^GLOBAL_PHASE} |
83
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
84
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
85
|
1
|
50
|
|
|
|
2
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
|
1
|
|
|
|
|
4
|
|
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
|
|
15
|
no warnings 'misc'; # avoid (in cleanup) warnings |
|
1
|
|
|
|
|
20
|
|
|
1
|
|
|
|
|
1548
|
|
92
|
0
|
0
|
|
|
|
0
|
die $e if $e; # rethrow |
93
|
|
|
|
|
|
|
} |
94
|
1
|
|
|
|
|
12
|
return; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
# Accessors for xyz |
100
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/L4RD3UeTP8, line 3 |
101
|
|
|
|
|
|
|
if ( $__XS ) { |
102
|
|
|
|
|
|
|
Class::XSAccessor->import( |
103
|
|
|
|
|
|
|
chained => 1, |
104
|
|
|
|
|
|
|
"getters" => { "xyz" => "xyz" }, |
105
|
|
|
|
|
|
|
); |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
else { |
108
|
|
|
|
|
|
|
*xyz = sub { @_ == 1 or Mite::Shim::croak( 'Reader "xyz" usage: $self->xyz()' ); $_[0]{"xyz"} }; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
# Delegated methods for xyz |
112
|
|
|
|
|
|
|
# has declaration, file ../../../../tmp/L4RD3UeTP8, line 3 |
113
|
|
|
|
|
|
|
*pop_xyz = sub { |
114
|
0
|
0
|
|
0
|
|
0
|
@_==1 or Mite::Shim::croak("Wrong number of parameters in signature for pop_xyz; usage: "."\$instance->pop_xyz()"); |
115
|
|
|
|
|
|
|
|
116
|
0
|
|
|
|
|
0
|
1; |
117
|
0
|
|
|
|
|
0
|
my $shv_ref_invocant = do { $_[0]->xyz }; |
|
0
|
|
|
|
|
0
|
|
118
|
0
|
|
|
|
|
0
|
pop(@{$shv_ref_invocant}) |
|
0
|
|
|
|
|
0
|
|
119
|
|
|
|
|
|
|
}; |
120
|
|
|
|
|
|
|
*push_xyz = sub { |
121
|
|
|
|
|
|
|
|
122
|
2
|
|
|
2
|
|
20
|
my $shv_self=shift; |
123
|
2
|
|
|
|
|
4
|
my @shv_values = map { my $shv_value = $_; $shv_value = !!$shv_value; } @_; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
7
|
|
124
|
2
|
|
|
|
|
2
|
my $shv_ref_invocant = do { $shv_self->xyz }; |
|
2
|
|
|
|
|
6
|
|
125
|
2
|
|
|
|
|
3
|
push(@{$shv_ref_invocant}, @shv_values) |
|
2
|
|
|
|
|
7
|
|
126
|
|
|
|
|
|
|
}; |
127
|
|
|
|
|
|
|
*push_false = sub { |
128
|
|
|
|
|
|
|
|
129
|
1
|
|
|
1
|
|
7
|
my $shv_self=shift; |
130
|
1
|
|
|
|
|
3
|
CORE::unshift(@_, ("0")); |
131
|
1
|
|
|
|
|
10
|
my @shv_values = map { my $shv_value = $_; $shv_value = !!$shv_value; } @_; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
3
|
|
132
|
1
|
|
|
|
|
4
|
my $shv_ref_invocant = do { $shv_self->xyz }; |
|
1
|
|
|
|
|
3
|
|
133
|
1
|
|
|
|
|
2
|
push(@{$shv_ref_invocant}, @shv_values) |
|
1
|
|
|
|
|
5
|
|
134
|
|
|
|
|
|
|
}; |
135
|
|
|
|
|
|
|
do { |
136
|
|
|
|
|
|
|
my $ENVIRONMENT = { |
137
|
|
|
|
|
|
|
'@curry' => [ |
138
|
|
|
|
|
|
|
{} |
139
|
|
|
|
|
|
|
] |
140
|
|
|
|
|
|
|
}; |
141
|
|
|
|
|
|
|
; my @curry = @{$ENVIRONMENT->{'@curry'}}; |
142
|
|
|
|
|
|
|
*push_true = sub { |
143
|
|
|
|
|
|
|
|
144
|
3
|
|
|
3
|
|
27
|
my $shv_self=shift; |
145
|
3
|
|
|
|
|
4
|
CORE::unshift(@_, @curry); |
146
|
3
|
|
|
|
|
4
|
my @shv_values = map { my $shv_value = $_; $shv_value = !!$shv_value; } @_; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
7
|
|
147
|
3
|
|
|
|
|
4
|
my $shv_ref_invocant = do { $shv_self->xyz }; |
|
3
|
|
|
|
|
5
|
|
148
|
3
|
|
|
|
|
4
|
push(@{$shv_ref_invocant}, @shv_values) |
|
3
|
|
|
|
|
9
|
|
149
|
|
|
|
|
|
|
}; |
150
|
|
|
|
|
|
|
}; |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
# See UNIVERSAL |
153
|
|
|
|
|
|
|
sub DOES { |
154
|
7
|
|
|
7
|
|
15
|
my ( $self, $role ) = @_; |
155
|
7
|
|
|
|
|
8
|
our %DOES; |
156
|
7
|
50
|
|
|
|
15
|
return $DOES{$role} if exists $DOES{$role}; |
157
|
7
|
50
|
|
|
|
18
|
return 1 if $role eq __PACKAGE__; |
158
|
7
|
50
|
0
|
|
|
14
|
if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) { |
|
|
|
33
|
|
|
|
|
159
|
0
|
0
|
0
|
|
|
0
|
$meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1; |
160
|
|
|
|
|
|
|
} |
161
|
7
|
|
|
|
|
42
|
return $self->SUPER::DOES( $role ); |
162
|
|
|
|
|
|
|
} |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
165
|
|
|
|
|
|
|
sub does { |
166
|
7
|
|
|
7
|
|
1782
|
shift->DOES( @_ ); |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
1; |
170
|
|
|
|
|
|
|
} |