line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moo::Object; |
2
|
210
|
|
|
210
|
|
310084
|
use strict; |
|
210
|
|
|
|
|
430
|
|
|
210
|
|
|
|
|
6348
|
|
3
|
210
|
|
|
210
|
|
1062
|
use warnings; |
|
210
|
|
|
|
|
408
|
|
|
210
|
|
|
|
|
5053
|
|
4
|
|
|
|
|
|
|
|
5
|
210
|
|
|
210
|
|
1040
|
use Carp (); |
|
210
|
|
|
|
|
411
|
|
|
210
|
|
|
|
|
110313
|
|
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
|
82999
|
my $class = shift; |
14
|
950
|
100
|
|
|
|
3369
|
unless (exists $NO_DEMOLISH{$class}) { |
15
|
294
|
100
|
|
|
|
3957
|
unless ($NO_DEMOLISH{$class} = !$class->can('DEMOLISH')) { |
16
|
14
|
|
66
|
|
|
87
|
($DEMOLISH_MAKER ||= do { |
17
|
10
|
|
|
|
|
3924
|
require Method::Generate::DemolishAll; |
18
|
10
|
|
|
|
|
141
|
Method::Generate::DemolishAll->new |
19
|
|
|
|
|
|
|
})->generate_method($class); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
950
|
|
|
|
|
5361
|
my $proto = $class->BUILDARGS(@_); |
23
|
948
|
100
|
|
|
|
9520
|
$NO_BUILD{$class} and |
24
|
|
|
|
|
|
|
return bless({}, $class); |
25
|
294
|
100
|
|
|
|
2673
|
$NO_BUILD{$class} = !$class->can('BUILD') unless exists $NO_BUILD{$class}; |
26
|
294
|
100
|
|
|
|
5514
|
$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
|
91882
|
my $class = shift; |
34
|
|
|
|
|
|
|
scalar @_ == 1 |
35
|
|
|
|
|
|
|
? ref $_[0] eq 'HASH' |
36
|
1206
|
100
|
|
|
|
11564
|
? { %{ $_[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
|
9597
|
my $self = shift; |
48
|
22
|
|
66
|
|
|
57
|
$self->${\(($BUILD_MAKER ||= do { |
|
22
|
|
|
|
|
128
|
|
49
|
16
|
|
|
|
|
8734
|
require Method::Generate::BuildAll; |
50
|
16
|
|
|
|
|
199
|
Method::Generate::BuildAll->new |
51
|
|
|
|
|
|
|
})->generate_method(ref($self)))}(@_); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub DEMOLISHALL { |
55
|
2
|
|
|
2
|
0
|
4804
|
my $self = shift; |
56
|
2
|
|
33
|
|
|
5
|
$self->${\(($DEMOLISH_MAKER ||= do { |
|
2
|
|
|
|
|
11
|
|
57
|
2
|
|
|
|
|
11
|
require Method::Generate::DemolishAll; |
58
|
2
|
|
|
|
|
15
|
Method::Generate::DemolishAll->new |
59
|
|
|
|
|
|
|
})->generate_method(ref($self)))}(@_); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub does { |
63
|
|
|
|
|
|
|
return !!0 |
64
|
8
|
100
|
100
|
8
|
0
|
6278
|
unless ($INC{'Moose/Role.pm'} || $INC{'Role/Tiny.pm'}); |
65
|
6
|
|
|
|
|
42
|
require Moo::Role; |
66
|
6
|
|
|
|
|
52
|
my $does = Moo::Role->can("does_role"); |
67
|
210
|
|
|
210
|
|
1828
|
{ no warnings 'redefine'; *does = $does } |
|
210
|
|
|
|
|
496
|
|
|
210
|
|
|
|
|
31881
|
|
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
65
|
|
68
|
6
|
|
|
|
|
38
|
goto &$does; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
# duplicated in Moo::Role |
72
|
|
|
|
|
|
|
sub meta { |
73
|
60
|
|
|
60
|
0
|
90179
|
require Moo::HandleMoose::FakeMetaClass; |
74
|
60
|
|
66
|
|
|
407
|
my $class = ref($_[0])||$_[0]; |
75
|
60
|
|
|
|
|
690
|
bless({ name => $class }, 'Moo::HandleMoose::FakeMetaClass'); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |