|  line  | 
 stmt  | 
 bran  | 
 cond  | 
 sub  | 
 pod  | 
 time  | 
 code  | 
| 
1
 | 
  
 
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 {  | 
| 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     use strict;  | 
| 
4
 | 
109
 | 
 
 | 
 
 | 
  
109
  
 | 
 
 | 
900
 | 
     use warnings;  | 
| 
 
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
317
 | 
    | 
| 
 
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3622
 | 
    | 
| 
5
 | 
109
 | 
 
 | 
 
 | 
  
109
  
 | 
 
 | 
626
 | 
     no warnings qw( once void );  | 
| 
 
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
306
 | 
    | 
| 
 
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3563
 | 
    | 
| 
6
 | 
109
 | 
 
 | 
 
 | 
  
109
  
 | 
 
 | 
582
 | 
    | 
| 
 
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
327
 | 
    | 
| 
 
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
13875
 | 
    | 
| 
7
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     our $USES_MITE    = "Mite::Role";  | 
| 
8
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     our $MITE_SHIM    = "Mite::Shim";  | 
| 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     our $MITE_VERSION = "0.011000";  | 
| 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
11
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # Mite keywords  | 
| 
12
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     BEGIN {  | 
| 
13
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         my ( $SHIM, $CALLER ) =  | 
| 
14
 | 
109
 | 
 
 | 
 
 | 
  
109
  
 | 
 
 | 
624
 | 
           ( "Mite::Shim", "Mite::Trait::HasMethods" );  | 
| 
15
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         (  | 
| 
16
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             *after,    *around,        *before,  | 
| 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             *field,    *has,           *param,  | 
| 
18
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             *requires, *signature_for, *with  | 
| 
19
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
           )  | 
| 
20
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
           = do {  | 
| 
21
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
265
 | 
    | 
| 
22
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             no warnings 'redefine';  | 
| 
23
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             (  | 
| 
24
 | 
109
 | 
 
 | 
 
 | 
  
109
  
 | 
 
 | 
780
 | 
                 sub { $SHIM->HANDLE_after( $CALLER, "role", @_ ) },  | 
| 
 
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
271
 | 
    | 
| 
 
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
26628
 | 
    | 
| 
25
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 sub { $SHIM->HANDLE_around( $CALLER, "role", @_ ) },  | 
| 
26
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
                 sub { $SHIM->HANDLE_before( $CALLER, "role", @_ ) },  | 
| 
27
 | 
109
 | 
 
 | 
 
 | 
  
109
  
 | 
 
 | 
500
 | 
                 sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) },  | 
| 
28
 | 
109
 | 
 
 | 
 
 | 
  
109
  
 | 
 
 | 
552
 | 
                 sub { $SHIM->HANDLE_has( $CALLER, has   => @_ ) },  | 
| 
29
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
                 sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) },  | 
| 
30
 | 
109
 | 
 
 | 
 
 | 
  
109
  
 | 
 
 | 
75828
 | 
                 sub { },  | 
| 
31
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
                 sub { $SHIM->HANDLE_signature_for( $CALLER, "role", @_ ) },  | 
| 
32
 | 
 
 | 
 
 | 
 
 | 
  
109
  
 | 
 
 | 
 
 | 
                 sub { $SHIM->HANDLE_with( $CALLER, @_ ) },  | 
| 
33
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
             );  | 
| 
34
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
     }  | 
| 
35
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
20869
 | 
    | 
| 
36
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # Mite imports  | 
| 
37
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     BEGIN {  | 
| 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         require Scalar::Util;  | 
| 
39
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         *STRICT  = \&Mite::Shim::STRICT;  | 
| 
40
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         *bare    = \&Mite::Shim::bare;  | 
| 
41
 | 
109
 | 
 
 | 
 
 | 
  
109
  
 | 
 
 | 
820
 | 
         *blessed = \&Scalar::Util::blessed;  | 
| 
42
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1432
 | 
         *carp    = \&Mite::Shim::carp;  | 
| 
43
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
382
 | 
         *confess = \&Mite::Shim::confess;  | 
| 
44
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
279
 | 
         *croak   = \&Mite::Shim::croak;  | 
| 
45
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
317
 | 
         *false   = \&Mite::Shim::false;  | 
| 
46
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
280
 | 
         *guard   = \&Mite::Shim::guard;  | 
| 
47
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
294
 | 
         *lazy    = \&Mite::Shim::lazy;  | 
| 
48
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
284
 | 
         *lock    = \&Mite::Shim::lock;  | 
| 
49
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
268
 | 
         *ro      = \&Mite::Shim::ro;  | 
| 
50
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
247
 | 
         *rw      = \&Mite::Shim::rw;  | 
| 
51
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
266
 | 
         *rwp     = \&Mite::Shim::rwp;  | 
| 
52
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
255
 | 
         *true    = \&Mite::Shim::true;  | 
| 
53
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
296
 | 
         *unlock  = \&Mite::Shim::unlock;  | 
| 
54
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
272
 | 
     }  | 
| 
55
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
261
 | 
    | 
| 
56
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
4226
 | 
     # Gather metadata for constructor and destructor  | 
| 
57
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         no strict 'refs';  | 
| 
58
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         my $class = shift;  | 
| 
59
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         $class = ref($class) || $class;  | 
| 
60
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         my $linear_isa = mro::get_linear_isa($class);  | 
| 
61
 | 
109
 | 
 
 | 
 
 | 
  
109
  
 | 
 
 | 
728
 | 
         return {  | 
| 
 
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
286
 | 
    | 
| 
 
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
46103
 | 
    | 
| 
62
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
             BUILD => [  | 
| 
63
 | 
  
0
  
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
                 map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () }  | 
| 
64
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                 map { "$_\::BUILD" } reverse @$linear_isa  | 
| 
65
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             ],  | 
| 
66
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             DEMOLISH => [  | 
| 
67
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                 map   { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () }  | 
| 
 
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
68
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                   map { "$_\::DEMOLISH" } @$linear_isa  | 
| 
69
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             ],  | 
| 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             HAS_BUILDARGS        => $class->can('BUILDARGS'),  | 
| 
71
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'),  | 
| 
 
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
72
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         };  | 
| 
 
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
73
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
74
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
75
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # See UNIVERSAL  | 
| 
76
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         my ( $self, $role ) = @_;  | 
| 
77
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         our %DOES;  | 
| 
78
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         return $DOES{$role} if exists $DOES{$role};  | 
| 
79
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         return 1            if $role eq __PACKAGE__;  | 
| 
80
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         if ( $INC{'Moose/Util.pm'}  | 
| 
81
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
             and my $meta = Moose::Util::find_meta( ref $self or $self ) )  | 
| 
82
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         {  | 
| 
83
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             $meta->can('does_role') and $meta->does_role($role) and return 1;  | 
| 
84
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         }  | 
| 
85
 | 
  
0
  
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
         return $self->SUPER::DOES($role);  | 
| 
 
 | 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
86
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
87
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
88
 | 
  
0
  
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
     # Alias for Moose/Moo-compatibility  | 
| 
89
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         shift->DOES(@_);  | 
| 
90
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     }  | 
| 
91
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
92
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # Callback which classes consuming this role will call  | 
| 
93
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         my ( $me, $target, $args ) = @_;  | 
| 
94
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         our ( %CONSUMERS, @METHOD_MODIFIERS );  | 
| 
95
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
    | 
| 
96
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         # Ensure a given target only consumes this role once.  | 
| 
97
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         if ( exists $CONSUMERS{$target} ) {  | 
| 
98
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             return;  | 
| 
99
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
100
 | 
124
 | 
 
 | 
 
 | 
  
124
  
 | 
 
 | 
509
 | 
         $CONSUMERS{$target} = 1;  | 
| 
101
 | 
124
 | 
 
 | 
 
 | 
 
 | 
 
 | 
261
 | 
    | 
| 
102
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         my $type = do { no strict 'refs'; ${"$target\::USES_MITE"} };  | 
| 
103
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         return if $type ne 'Mite::Class';  | 
| 
104
 | 
124
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
647
 | 
    | 
| 
105
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         my @missing_methods;  | 
| 
106
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         @missing_methods = grep( !$target->can($_),  | 
| 
107
 | 
124
 | 
 
 | 
 
 | 
 
 | 
 
 | 
405
 | 
             "_function_for_croak", "compilation_stages",  | 
| 
108
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             "inject_mite_functions" )  | 
| 
109
 | 
109
 | 
 
 | 
 
 | 
  
109
  
 | 
 
 | 
932
 | 
           and croak( "$me requires $target to implement methods: " . join q[, ],  | 
| 
 
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
265
 | 
    | 
| 
 
 | 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
30552
 | 
    | 
| 
 
 | 
124
 | 
 
 | 
 
 | 
 
 | 
 
 | 
280
 | 
    | 
| 
 
 | 
124
 | 
 
 | 
 
 | 
 
 | 
 
 | 
267
 | 
    | 
| 
 
 | 
124
 | 
 
 | 
 
 | 
 
 | 
 
 | 
680
 | 
    | 
| 
110
 | 
124
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
536
 | 
             @missing_methods );  | 
| 
111
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
112
 | 
124
 | 
 
 | 
 
 | 
 
 | 
 
 | 
319
 | 
         my @roles    = ();  | 
| 
113
 | 
124
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
1420
 | 
         my %nextargs = %{ $args || {} };  | 
| 
114
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         ( $nextargs{-indirect} ||= 0 )++;  | 
| 
115
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         croak("PANIC!") if $nextargs{-indirect} > 100;  | 
| 
116
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         for my $role (@roles) {  | 
| 
117
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             $role->__FINALIZE_APPLICATION__( $target, {%nextargs} );  | 
| 
118
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
119
 | 
124
 | 
 
 | 
 
 | 
 
 | 
 
 | 
356
 | 
    | 
| 
120
 | 
124
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
264
 | 
         my $shim = "Mite::Shim";  | 
| 
 
 | 
124
 | 
 
 | 
 
 | 
 
 | 
 
 | 
935
 | 
    | 
| 
121
 | 
124
 | 
 
 | 
  
 50
  
 | 
 
 | 
 
 | 
949
 | 
         for my $modifier_rule (@METHOD_MODIFIERS) {  | 
| 
122
 | 
124
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
551
 | 
             my ( $modification, $names, $coderef ) = @$modifier_rule;  | 
| 
123
 | 
124
 | 
 
 | 
 
 | 
 
 | 
 
 | 
420
 | 
             my $handler = "HANDLE_$modification";  | 
| 
124
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             $shim->$handler( $target, "class", $names, $coderef );  | 
| 
125
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
126
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
127
 | 
124
 | 
 
 | 
 
 | 
 
 | 
 
 | 
316
 | 
         return;  | 
| 
128
 | 
124
 | 
 
 | 
 
 | 
 
 | 
 
 | 
385
 | 
     }  | 
| 
129
 | 
248
 | 
 
 | 
 
 | 
 
 | 
 
 | 
762
 | 
    | 
| 
130
 | 
248
 | 
 
 | 
 
 | 
 
 | 
 
 | 
637
 | 
     1;  |