line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moose::Meta::Class::Immutable::Trait; |
2
|
|
|
|
|
|
|
our $VERSION = '2.2203'; |
3
|
|
|
|
|
|
|
|
4
|
391
|
|
|
391
|
|
2540
|
use strict; |
|
391
|
|
|
|
|
791
|
|
|
391
|
|
|
|
|
10666
|
|
5
|
391
|
|
|
391
|
|
1841
|
use warnings; |
|
391
|
|
|
|
|
749
|
|
|
391
|
|
|
|
|
8308
|
|
6
|
|
|
|
|
|
|
|
7
|
391
|
|
|
391
|
|
1762
|
use Class::MOP; |
|
391
|
|
|
|
|
803
|
|
|
391
|
|
|
|
|
8346
|
|
8
|
391
|
|
|
391
|
|
1851
|
use Scalar::Util qw( blessed ); |
|
391
|
|
|
|
|
782
|
|
|
391
|
|
|
|
|
18024
|
|
9
|
|
|
|
|
|
|
|
10
|
391
|
|
|
391
|
|
2323
|
use parent 'Class::MOP::Class::Immutable::Trait'; |
|
391
|
|
|
|
|
878
|
|
|
391
|
|
|
|
|
2198
|
|
11
|
|
|
|
|
|
|
|
12
|
391
|
|
|
391
|
|
25727
|
use Moose::Util 'throw_exception'; |
|
391
|
|
|
|
|
959
|
|
|
391
|
|
|
|
|
2412
|
|
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
0
|
0
|
0
|
sub add_role { $_[1]->_immutable_cannot_call } |
|
1
|
|
|
1
|
|
5
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub calculate_all_roles { |
17
|
0
|
|
|
0
|
0
|
0
|
my $orig = shift; |
|
15
|
|
|
15
|
|
28
|
|
18
|
0
|
|
|
|
|
0
|
my $self = shift; |
|
15
|
|
|
|
|
20
|
|
19
|
0
|
|
0
|
|
|
0
|
@{ $self->{__immutable}{calculate_all_roles} ||= [ $self->$orig ] }; |
|
0
|
|
100
|
|
|
0
|
|
|
15
|
|
|
|
|
22
|
|
|
15
|
|
|
|
|
70
|
|
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub calculate_all_roles_with_inheritance { |
23
|
0
|
|
|
0
|
0
|
0
|
my $orig = shift; |
|
12
|
|
|
12
|
|
19
|
|
24
|
0
|
|
|
|
|
0
|
my $self = shift; |
|
12
|
|
|
|
|
19
|
|
25
|
0
|
|
0
|
|
|
0
|
@{ $self->{__immutable}{calculate_all_roles_with_inheritance} ||= [ $self->$orig ] }; |
|
0
|
|
50
|
|
|
0
|
|
|
12
|
|
|
|
|
20
|
|
|
12
|
|
|
|
|
64
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub does_role { |
29
|
0
|
|
|
0
|
0
|
0
|
shift; |
|
85
|
|
|
85
|
|
114
|
|
30
|
0
|
|
|
|
|
0
|
my $self = shift; |
|
85
|
|
|
|
|
109
|
|
31
|
0
|
|
|
|
|
0
|
my $role = shift; |
|
85
|
|
|
|
|
123
|
|
32
|
|
|
|
|
|
|
|
33
|
0
|
0
|
|
|
|
0
|
(defined $role) |
|
85
|
100
|
|
|
|
154
|
|
34
|
|
|
|
|
|
|
|| throw_exception( RoleNameRequired => class_name => $self->name ); |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
0
|
|
|
0
|
$self->{__immutable}{does_role} ||= { map { $_->name => 1 } $self->calculate_all_roles_with_inheritance }; |
|
0
|
|
100
|
|
|
0
|
|
|
84
|
|
|
|
|
257
|
|
|
15
|
|
|
|
|
111
|
|
37
|
|
|
|
|
|
|
|
38
|
0
|
0
|
|
|
|
0
|
my $name = blessed $role ? $role->name : $role; |
|
84
|
100
|
|
|
|
256
|
|
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
0
|
return $self->{__immutable}{does_role}{$name}; |
|
84
|
|
|
|
|
444
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# ABSTRACT: Implements immutability for metaclass objects |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=pod |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=encoding UTF-8 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 NAME |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Moose::Meta::Class::Immutable::Trait - Implements immutability for metaclass objects |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 VERSION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
version 2.2203 |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 DESCRIPTION |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
This class makes some Moose-specific metaclass methods immutable. This |
64
|
|
|
|
|
|
|
is deep guts. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 BUGS |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
See L<Moose/BUGS> for details on reporting bugs. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 AUTHORS |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=over 4 |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=item * |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Stevan Little <stevan@cpan.org> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=item * |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item * |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Jesse Luehrs <doy@cpan.org> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item * |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Shawn M Moore <sartak@cpan.org> |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item * |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org> |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item * |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Karen Etheridge <ether@cpan.org> |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item * |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Florian Ragwitz <rafl@debian.org> |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item * |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Hans Dieter Pearcey <hdp@cpan.org> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item * |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Chris Prather <chris@prather.org> |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=item * |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Matt S Trout <mstrout@cpan.org> |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=back |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
This software is copyright (c) 2006 by Infinity Interactive, Inc. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
121
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=cut |