line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JavaScript::Writer::Block; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
5
|
1
|
|
|
1
|
|
14
|
use v5.8.0; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
8674
|
|
6
|
1
|
|
|
1
|
|
15
|
use base 'Class::Accessor::Fast'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
296
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw[ body ]); |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
8
|
use overload '""' => \&as_string; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
15
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.0.1'; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
923
|
use JavaScript::Writer; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new { |
17
|
|
|
|
|
|
|
my $class = shift; |
18
|
|
|
|
|
|
|
my $self = bless {}, $class; |
19
|
|
|
|
|
|
|
return $self; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub as_string { |
23
|
|
|
|
|
|
|
my $self = shift; |
24
|
|
|
|
|
|
|
my $sub = $self->body; |
25
|
|
|
|
|
|
|
my $body = sub { |
26
|
|
|
|
|
|
|
my ($js) = @_; |
27
|
|
|
|
|
|
|
$sub->($js); |
28
|
|
|
|
|
|
|
return $js; |
29
|
|
|
|
|
|
|
}->(JavaScript::Writer->new); |
30
|
|
|
|
|
|
|
return "{${body}}"; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |