line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
1657
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
2
|
1
|
|
|
1
|
|
7
|
use warnings FATAL => 'all'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package HTML::Tested::JavaScript::Variable; |
5
|
1
|
|
|
1
|
|
7
|
use base 'HTML::Tested::Value'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4028
|
|
6
|
|
|
|
|
|
|
use HTML::Tested::JavaScript::Serializer; |
7
|
|
|
|
|
|
|
use JSON::XS; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub encode_value { |
10
|
|
|
|
|
|
|
my ($self, $val) = @_; |
11
|
|
|
|
|
|
|
no warnings 'numeric'; |
12
|
|
|
|
|
|
|
my $d = $val + 0; |
13
|
|
|
|
|
|
|
return JSON::XS->new->allow_nonref->encode($val eq $d ? $d + 0 : $val); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub value_to_string { |
17
|
|
|
|
|
|
|
my ($self, $name, $val) = @_; |
18
|
|
|
|
|
|
|
return HTML::Tested::JavaScript::Serializer::Wrap($name, $val); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
1; |