line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moo::Object; |
2
|
210
|
|
|
210
|
|
279027
|
use strict; |
|
210
|
|
|
|
|
481
|
|
|
210
|
|
|
|
|
6095
|
|
3
|
210
|
|
|
210
|
|
1112
|
use warnings; |
|
210
|
|
|
|
|
463
|
|
|
210
|
|
|
|
|
4762
|
|
4
|
|
|
|
|
|
|
|
5
|
210
|
|
|
210
|
|
1017
|
use Carp (); |
|
210
|
|
|
|
|
460
|
|
|
210
|
|
|
|
|
110336
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our %NO_BUILD; |
8
|
|
|
|
|
|
|
our %NO_DEMOLISH; |
9
|
|
|
|
|
|
|
our $BUILD_MAKER; |
10
|
|
|
|
|
|
|
our $DEMOLISH_MAKER; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
950
|
|
|
950
|
0
|
80865
|
my $class = shift; |
14
|
950
|
100
|
|
|
|
3047
|
unless (exists $NO_DEMOLISH{$class}) { |
15
|
294
|
100
|
|
|
|
3432
|
unless ($NO_DEMOLISH{$class} = !$class->can('DEMOLISH')) { |
16
|
14
|
|
66
|
|
|
89
|
($DEMOLISH_MAKER ||= do { |
17
|
10
|
|
|
|
|
3637
|
require Method::Generate::DemolishAll; |
18
|
10
|
|
|
|
|
140
|
Method::Generate::DemolishAll->new |
19
|
|
|
|
|
|
|
})->generate_method($class); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
950
|
|
|
|
|
4718
|
my $proto = $class->BUILDARGS(@_); |
23
|
948
|
100
|
|
|
|
9112
|
$NO_BUILD{$class} and |
24
|
|
|
|
|
|
|
return bless({}, $class); |
25
|
294
|
100
|
|
|
|
2391
|
$NO_BUILD{$class} = !$class->can('BUILD') unless exists $NO_BUILD{$class}; |
26
|
294
|
100
|
|
|
|
4873
|
$NO_BUILD{$class} |
27
|
|
|
|
|
|
|
? bless({}, $class) |
28
|
|
|
|
|
|
|
: bless({}, $class)->BUILDALL($proto); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# Inlined into Method::Generate::Constructor::_generate_args() - keep in sync |
32
|
|
|
|
|
|
|
sub BUILDARGS { |
33
|
1206
|
|
|
1206
|
0
|
90002
|
my $class = shift; |
34
|
|
|
|
|
|
|
scalar @_ == 1 |
35
|
|
|
|
|
|
|
? ref $_[0] eq 'HASH' |
36
|
1206
|
100
|
|
|
|
9449
|
? { %{ $_[0] } } |
|
14
|
100
|
|
|
|
72
|
|
|
|
100
|
|
|
|
|
|
37
|
|
|
|
|
|
|
: Carp::croak("Single parameters to new() must be a HASH ref" |
38
|
|
|
|
|
|
|
. " data => ". $_[0]) |
39
|
|
|
|
|
|
|
: @_ % 2 |
40
|
|
|
|
|
|
|
? Carp::croak("The new() method for $class expects a hash reference or a" |
41
|
|
|
|
|
|
|
. " key/value list. You passed an odd number of arguments") |
42
|
|
|
|
|
|
|
: {@_} |
43
|
|
|
|
|
|
|
; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub BUILDALL { |
47
|
22
|
|
|
22
|
0
|
9308
|
my $self = shift; |
48
|
22
|
|
66
|
|
|
56
|
$self->${\(($BUILD_MAKER ||= do { |
|
22
|
|
|
|
|
122
|
|
49
|
16
|
|
|
|
|
7761
|
require Method::Generate::BuildAll; |
50
|
16
|
|
|
|
|
548
|
Method::Generate::BuildAll->new |
51
|
|
|
|
|
|
|
})->generate_method(ref($self)))}(@_); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub DEMOLISHALL { |
55
|
2
|
|
|
2
|
0
|
5753
|
my $self = shift; |
56
|
2
|
|
33
|
|
|
5
|
$self->${\(($DEMOLISH_MAKER ||= do { |
|
2
|
|
|
|
|
12
|
|
57
|
2
|
|
|
|
|
12
|
require Method::Generate::DemolishAll; |
58
|
2
|
|
|
|
|
18
|
Method::Generate::DemolishAll->new |
59
|
|
|
|
|
|
|
})->generate_method(ref($self)))}(@_); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub does { |
63
|
|
|
|
|
|
|
return !!0 |
64
|
8
|
100
|
100
|
8
|
0
|
6067
|
unless ($INC{'Moose/Role.pm'} || $INC{'Role/Tiny.pm'}); |
65
|
6
|
|
|
|
|
42
|
require Moo::Role; |
66
|
6
|
|
|
|
|
45
|
my $does = Moo::Role->can("does_role"); |
67
|
210
|
|
|
210
|
|
1711
|
{ no warnings 'redefine'; *does = $does } |
|
210
|
|
|
|
|
545
|
|
|
210
|
|
|
|
|
31341
|
|
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
62
|
|
68
|
6
|
|
|
|
|
33
|
goto &$does; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
# duplicated in Moo::Role |
72
|
|
|
|
|
|
|
sub meta { |
73
|
60
|
|
|
60
|
0
|
98154
|
require Moo::HandleMoose::FakeMetaClass; |
74
|
60
|
|
66
|
|
|
397
|
my $class = ref($_[0])||$_[0]; |
75
|
60
|
|
|
|
|
682
|
bless({ name => $class }, 'Moo::HandleMoose::FakeMetaClass'); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |