Perlito5/CompileTime/Closure.pm untested

filter: Statementstmt 0.0% 0 / 2 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 8 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
apply
2.0
dump
2.0
CRAP 2.0
1  
2 package Perlito5::CompileTime::Closure;
3  
4 sub new {
5 my ($class, %args) = @_;
6 # coderef
7 # scope
8 # source_code
9 bless \%args, $class;
10 }
11  
12 sub apply {
13  
14 }
15  
16 sub dump {
17 # do { my $x = 123; sub { $x + $_[0] } }
18 }
19  
20 # TODO - problem with identifying shared variables in js,
21 # because it doesn't use "real" scalar references
22 #
23 # $ node perlito5.js -I src5/lib -e ' my $x = 123; my $v = \$x; my @x = ( $v, \$x ); print $_,"\n" for @x '
24 # SCALAR(0x5b143b76)
25 # SCALAR(0x5b143b77) -- different ref value
26 #
27 # $ perl -e ' use Data::Dumper; my $x = 123; my $v = \$x; my @x = ( $v, \$x ); print $_,"\n" for @x '
28 # SCALAR(0x7fc01902af60)
29 # SCALAR(0x7fc01902af60)
30 #