line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Base::XS; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
90348
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
115
|
|
4
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
102
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
73
|
use 5.010; |
|
3
|
|
|
|
|
13
|
|
|
3
|
|
|
|
|
526
|
|
7
|
|
|
|
|
|
|
require feature; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = 0.07; |
10
|
|
|
|
|
|
|
require XSLoader; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
XSLoader::load('Mojo::Base::XS', $VERSION); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $base_infected; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub import { |
17
|
4
|
|
|
4
|
|
550
|
my $class = shift; |
18
|
4
|
|
100
|
|
|
27
|
my $flag = shift || ''; |
19
|
|
|
|
|
|
|
|
20
|
4
|
100
|
|
|
|
16
|
if ($flag eq '-infect') { |
21
|
1
|
50
|
|
|
|
3
|
return if $base_infected++; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Check if no Mojo::Base loaded |
24
|
1
|
50
|
|
|
|
12
|
if (UNIVERSAL::can('Mojo::Base', 'new')) { |
25
|
0
|
|
|
|
|
0
|
require Carp; |
26
|
0
|
|
|
|
|
0
|
Carp::croak( |
27
|
|
|
|
|
|
|
"You must load Mojo::Base::XS before loading Mojo::Base"); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# Load and monkey-patch Mojo::Base |
31
|
1
|
|
|
|
|
525
|
require Mojo::Base; |
32
|
|
|
|
|
|
|
|
33
|
3
|
|
|
3
|
|
15
|
no strict 'refs'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
131
|
|
34
|
3
|
|
|
3
|
|
15
|
no warnings 'redefine'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
211
|
|
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
0
|
newxs_attr('Mojo::Base::attr'); |
37
|
0
|
|
|
|
|
0
|
newxs_constructor('Mojo::Base::new'); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
else { |
40
|
3
|
|
|
|
|
7
|
my $caller = caller; |
41
|
|
|
|
|
|
|
|
42
|
3
|
|
|
3
|
|
15
|
no strict 'refs'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
79
|
|
43
|
3
|
|
|
3
|
|
14
|
no warnings 'redefine'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
453
|
|
44
|
|
|
|
|
|
|
|
45
|
3
|
|
|
|
|
29
|
newxs_attr($caller . '::attr'); |
46
|
3
|
|
|
|
|
17
|
newxs_constructor($caller . '::new'); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# TODO: turn this into XS code |
49
|
3
|
|
|
1
|
|
14
|
*{"${caller}::has"} = sub { attr($caller, @_) }; |
|
3
|
|
|
|
|
439
|
|
|
1
|
|
|
|
|
36
|
|
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |