File Coverage

blib/lib/Aspect/Point/Around.pm
Criterion Covered Total %
statement 25 25 100.0
branch 4 4 100.0
condition n/a
subroutine 8 8 100.0
pod 0 1 0.0
total 37 38 97.3


line stmt bran cond sub pod time code
1             package Aspect::Point::Around;
2             =pod
3              
4             =head1 NAME
5              
6             Aspect::Point - The Join Point context for "around" advice code
7              
8             =head1 SYNOPSIS
9              
10             =head1 METHODS
11              
12             =cut
13              
14 21     21   90 use strict;
  21         28  
  21         814  
15 21     21   84 use warnings;
  21         21  
  21         452  
16 21     21   78 use Aspect::Point ();
  21         20  
  21         994  
17              
18             our $VERSION = '0.97_06';
19             our @ISA = 'Aspect::Point';
20              
21 21     21   90 use constant type => 'around';
  21         24  
  21         4007  
22              
23             sub original {
24             $_[0]->{original};
25             }
26              
27             sub proceed {
28 33     33 0 1134 my $self = shift;
29              
30             return $self->return_value(
31             Sub::Uplevel::uplevel(
32             2,
33             $self->{original},
34 3         9 @{$self->{args}},
35             )
36 33 100       90 ) if $self->{wantarray};
37              
38             return $self->return_value(
39             scalar Sub::Uplevel::uplevel(
40             2,
41             $self->{original},
42 22         76 @{$self->{args}},
43             )
44 30 100       83 ) if defined $self->{wantarray};
45              
46             return Sub::Uplevel::uplevel(
47             2,
48             $self->{original},
49 8         10 @{$self->{args}},
  8         22  
50             );
51             }
52              
53             BEGIN {
54 21     21   639 *run_original = *proceed;
55             }
56              
57              
58              
59              
60              
61             ######################################################################
62             # Optional XS Acceleration
63              
64             BEGIN {
65 21     21   31 local $@;
66 21     21   1520 eval <<'END_PERL';
  21         95  
  21         446  
  21         154  
67             use Class::XSAccessor 1.08 {
68             replace => 1,
69             getters => {
70             'original' => 'original',
71             },
72             };
73             END_PERL
74             }
75              
76             1;
77              
78             =pod
79              
80             =head1 AUTHORS
81              
82             Adam Kennedy Eadamk@cpan.orgE
83              
84             Marcel GrEnauer Emarcel@cpan.orgE
85              
86             Ran Eilam Eeilara@cpan.orgE
87              
88             =head1 COPYRIGHT
89              
90             Copyright 2001 by Marcel GrEnauer
91              
92             Some parts copyright 2009 - 2011 Adam Kennedy.
93              
94             This library is free software; you can redistribute it and/or modify
95             it under the same terms as Perl itself.
96              
97             =cut