line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package UR::Role::MethodModifier::After; |
2
|
1
|
|
|
1
|
|
89
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
44
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = "0.46"; # UR $VERSION; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
4
|
use UR; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
8
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
UR::Object::Type->define( |
10
|
|
|
|
|
|
|
class_name => 'UR::Role::MethodModifier::After', |
11
|
|
|
|
|
|
|
is => 'UR::Role::MethodModifier', |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
0
|
3
|
sub type { 'after' } |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub create_wrapper_sub { |
17
|
1
|
|
|
1
|
0
|
2
|
my($self, $original_sub) = @_; |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
|
|
5
|
my $after = $self->code; |
20
|
|
|
|
|
|
|
return sub { |
21
|
3
|
|
|
3
|
|
2425
|
my @rv; |
|
|
|
|
3
|
|
|
|
22
|
3
|
|
|
|
|
4
|
my $wantarray = wantarray; |
23
|
3
|
100
|
|
|
|
10
|
if ($wantarray) { |
|
|
100
|
|
|
|
|
|
24
|
1
|
|
|
|
|
3
|
@rv = $original_sub->(@_); |
25
|
|
|
|
|
|
|
} elsif (defined $wantarray) { |
26
|
1
|
|
|
|
|
3
|
$rv[0] = $original_sub->(@_); |
27
|
|
|
|
|
|
|
} else { |
28
|
1
|
|
|
|
|
4
|
$original_sub->(@_); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
3
|
100
|
|
|
|
25
|
if ($wantarray) { |
|
|
100
|
|
|
|
|
|
32
|
1
|
|
|
|
|
5
|
() = $after->(\@rv, @_); |
33
|
|
|
|
|
|
|
} elsif (defined $wantarray) { |
34
|
1
|
|
|
|
|
4
|
my $i = $after->($rv[0], @_); |
35
|
|
|
|
|
|
|
} else { |
36
|
1
|
|
|
|
|
3
|
$after->(undef, @_); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
3
|
100
|
|
|
|
25
|
if ($wantarray) { |
|
|
100
|
|
|
|
|
|
40
|
1
|
|
|
|
|
3
|
return @rv; |
41
|
|
|
|
|
|
|
} elsif (defined $wantarray) { |
42
|
1
|
|
|
|
|
2
|
return $rv[0]; |
43
|
|
|
|
|
|
|
} else { |
44
|
1
|
|
|
|
|
2
|
return; |
45
|
|
|
|
|
|
|
} |
46
|
1
|
|
|
|
|
8
|
}; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |