Branch Coverage

blib/lib/JE/Code.pm
Criterion Covered Total %
branch 351 414 84.7


line true false branch
43 23 328 if $@
47 5 323 $JE::Parser::_parser ? :
61 0 328 if $ENV{'YES_I_WANT_JE_TO_OPTIMISE'} and $ENV{'YES_I_WANT_JE_TO_OPTIMISE'} ne 2
86 0 0 unless $$code{'cache'}
87 0 0 if ref $_ eq 'JE::Code'
89 0 0 unless $$code{'vars'}
90 0 0 if ref $_ and ref $$_[4] eq 'JE::Code'
93 0 0 unless defined $old
100 0 0 if $r =~ /^(?:ARRAY\z|JE::Code::)/
102 0 0 if $r eq 'JE::Boolean'
104 0 0 if $r eq 'JE::Number'
106 0 0 if $r eq 'JE::String'
108 0 0 if $r eq 'JE::Null'
109 0 0 if $r eq 'JE::Object::RegExp'
142 2 2204 if (not defined our $ops and my $max_ops = $global->max_ops)
147 1991 213 defined $_[0] ? :
186 0 2204 $$code{'psrc'} ? :
0 2204 $$code{'sub'} ? :
193 288 228 unless $code_type == 2
198 0 0 if ($JE::Code::Statement::_label) { }
207 0 0 if ($JE::Code::Statement::_label) { }
225 46 1824 if defined $rv and tainted $taint and $rv->can('taint')
228 2165 22 if (ref $@ eq '' and $@ eq '') { }
229 327 1854 unless defined $rv
241 31 282 @_ ? :
242 26 287 @_ ? :
243 18 295 if $msg =~ /\n\z/
244 1 285 unless defined(my $file = ($code || (return $msg))->{'file'}) or defined $pos
247 134 151 unless defined $first_line
248 283 2 if (defined $pos) { }
262 276 36 if ref $msg
266 18 18 if ($msg =~ /^Can't\ locate\ object\ method\ "(?:c(?:all|onstruct)|apply|invoke_with)"/x)
310 371 12854 if $type eq 'empty' or $type eq 'function'
315 28 12826 if ($type eq 'labelled')
317 14 14 if ($$stm[-1][1] =~ /^(?:do|while|for|switch)\z/)
326 0 6 if defined $returned
333 12 1 if (not defined $_label or first sub { $_ eq $_label; } , @labels) { }
342 9501 3325 if ($type eq 'statements')
348 0 21757 if $_ eq 'empty'
349 18145 1584 if defined($returned = $_->eval)
356 607 2718 if ($type eq 'var')
357 455 198 if (@$_ == 2)
359 25 429 if ref $ret eq 'JE::LValue'
364 212 2506 if ($type eq 'if')
368 62 148 if ($$stm[2]->eval->to_boolean->value) { }
369 62 0 unless $$stm[3] eq 'empty'
372 19 129 if exists $$stm[4] and $$stm[4] ne 'empty'
376 28 140 if defined $returned
379 408 2098 if ($type =~ /^(?:do|while|for|switch)\z/)
399 26 396 if ($type eq 'do') { }
23 373 elsif ($type eq 'while') { }
40 333 elsif ($type eq 'for' and $$stm[3] eq 'in') { }
317 16 elsif ($type eq 'for') { }
401 31 0 ref $$stm[2] ? :
3 13 if defined($returned = ref $$stm[2] ? $$stm[2]->eval : undef)
407 2 22 if ($_label and not first(sub { $_ eq $_label; } , @labels))
416 55 0 ref $$stm[3] ? :
33 8 if defined($returned = ref $$stm[3] ? $$stm[3]->eval : undef)
421 2 47 if ($_label and not first(sub { $_ eq $_label; } , @labels))
430 17 23 if ($$left_side[1] eq 'var')
436 30 10 if ref $obj eq 'JE::LValue'
437 0 40 if ref($obj) =~ /^JE::(?:Undefined|Null)\z/
442 0 5229 if ($_label and not first(sub { $_ eq $_label; } , @labels))
448 2 5227 unless defined $obj->prop($_)
451 28 5199 ref $left_side ? :
455 5227 0 ref $$stm[5] ? :
25 5202 if defined($returned = ref $$stm[5] ? $$stm[5]->eval : undef)
462 0 40 if ($_label and not first(sub { $_ eq $_label; } , @labels))
471 3054 112 ref $$stm[3] ? :
479 4 2853 if ($_label and not first(sub { $_ eq $_label; } , @labels))
488 2911 0 ref $$stm[5] ? :
1309 1536 if defined($returned = ref $$stm[5] ? $$stm[5]->eval : undef)
505 0 16 if ref $given eq 'JE::LValue'
515 10 24 if ($$stm[$n] eq 'default')
520 4 20 if ('JE::Code::Expression::in==='->($given, $$stm[$n]->eval))
535 10 6 if (defined $default)
545 398 4 if (not $_label or first sub { $_ eq $_label; } , @labels) { }
554 20 2078 if ($type eq 'continue')
556 12 8 exists $$stm[2] ? :
559 65 2013 if ($type eq 'break')
561 10 55 exists $$stm[2] ? :
564 1666 347 if ($type eq 'return')
566 1664 2 if (exists $$stm[2]) { }
567 90 1573 if ref($JE::Code::return = $$stm[2]->eval) eq 'JE::LValue'
572 14 333 if ($type eq 'with')
577 3 11 if defined $returned
580 17 316 if ($type eq 'throw')
582 17 0 if (exists $$stm[2])
583 2 15 if ref($excep = $$stm[2]->eval) eq 'JE::LValue'
586 17 0 defined $excep ? :
588 316 0 if ($type eq 'try')
610 26 0 unless defined $result
615 290 0 if (ref $@ || $@ ne '' and not ref $$stm[3])
644 290 0 unless defined $result
652 6 310 if ($#$stm == 3 or $#$stm == 5)
655 0 290 if defined $exception and ref $exception || $exception ne ''
657 306 10 if defined $result
658 0 316 if $propagate
665 168 605 if (ref $_) { }
672 0 168 if (ref $$_[4] eq 'JE::Code') { }
750 6 203 unless ref(my $term = shift()) eq 'JE::LValue'
753 197 6 defined $base ? :
763 1 165 if ref $term eq 'JE::LValue' and ref $term->base eq ''
792 6 32 $num != $num || abs $num == 9**9**9 ? :
797 13 25 if $num >= 2147483648
814 6 1 $num && $num == $num ? :
43 7 $denom ? :
825 4 38 $num == $num && abs $denom == 9**9**9 ? :
4 42 $num + 1 == $num ? :
835 19494 307 if ($x->typeof eq 'string' or $y->typeof eq 'string')
852 108 789 $num != $num || abs $num == 9**9**9 ? :
856 377 520 if $num >= 2147483648
859 108 789 $shift_by != $shift_by || abs $shift_by == 9**9**9 ? :
865 326 571 if $ret >= 2147483648
876 101 796 $num != $num || abs $num == 9**9**9 ? :
880 377 520 if $num >= 2147483648
883 101 796 $shift_by != $shift_by || abs $shift_by == 9**9**9 ? :
894 101 796 $num != $num || abs $num == 9**9**9 ? :
900 101 796 $shift_by != $shift_by || abs $shift_by == 9**9**9 ? :
910 10 1531 $x->typeof eq 'string' && $y->typeof eq 'string' ? :
918 10 70 $x->typeof eq 'string' && $y->typeof eq 'string' ? :
926 10 1564 $x->typeof eq 'string' && $y->typeof eq 'string' ? :
934 10 62 $x->typeof eq 'string' && $y->typeof eq 'string' ? :
942 2 214 if $func->primitive
946 1 213 if $func->typeof ne 'function'
950 5 208 if $obj->primitive
953 2 206 if not defined $proto_id or $proto_id->primitive
966 1 308 if $obj->primitive
975 2578 146 if $xt eq $yt
978 8 138 if $xi eq 'null'
981 40 98 if $xi eq 'undef'
984 6 92 if $yi eq 'null'
987 10 82 if $yi eq 'undef'
991 12 70 if ($xt eq 'boolean') { }
8 62 elsif ($yt eq 'boolean') { }
1000 12 70 if ($xt eq 'string' || $xt eq 'number' and not $y->primitive) { }
42 28 elsif ($yt eq 'string' || $yt eq 'number' and not $x->primitive) { }
1006 48 0 if $xt eq 'number' and $yt eq 'string' || $yt eq 'number' or $yt eq 'number' and $xt eq 'string' || $xt eq 'number'
1013 20 0 if $xt eq 'string' and $yt eq 'string'
1037 108 791 $num != $num || abs $num == 9**9**9 ? :
1041 377 522 if $num >= 2147483648
1044 108 791 $num2 != $num2 || abs $num2 == 9**9**9 ? :
1048 377 522 if $num2 >= 2147483648
1056 108 791 $num != $num || abs $num == 9**9**9 ? :
1060 377 522 if $num >= 2147483648
1063 108 791 $num2 != $num2 || abs $num2 == 9**9**9 ? :
1067 377 522 if $num2 >= 2147483648
1075 108 792 $num != $num || abs $num == 9**9**9 ? :
1079 377 523 if $num >= 2147483648
1082 108 792 $num2 != $num2 || abs $num2 == 9**9**9 ? :
1086 377 523 if $num2 >= 2147483648
1134 113 194518 if $JE::Code::counting
1143 72832 121798 if ($type eq 'expr')
1145 72434 398 if (@$expr == 3) { }
1151 37 1325 if ref $result eq 'JE::LValue'
1154 114 284 ref $result eq 'JE::LValue' ? :
1158 7465 114331 if ($type eq 'assign')
1172 561 6904 @copy >= 3 && (ref ${$copy[-2];} || ${$copy[-2];} =~ /^(?:[tfu]|[si0-9])/) ? :
1189 561 6903 if @qc_terms
1194 164 6762 if length $_ > 1
1197 5268 1658 if ref $val eq 'JE::LValue'
1198 0 6926 if tainted $JE::Code::taint and $val->can('taint')
1201 1 6925 if (my $err = $@)
1202 0 1 if UNIVERSAL::isa($err, 'JE::Object::Error')
1211 553 6912 unless (@ops)
1212 35 518 if ref $val eq 'JE::LValue'
1216 32141 82192 if ($type eq 'lassoc')
1224 485 40813 if ($op eq '&&') { }
110 40705 elsif ($op eq '||') { }
1225 458 27 if $result->to_boolean->[0]
1227 13 472 if ref $result eq 'JE::LValue'
1231 25 85 unless $result->to_boolean->[0]
1233 59 51 if ref $result eq 'JE::LValue'
1237 16807 23896 if ref $result eq 'JE::LValue'
1247 12091 70101 if ($type eq 'prefix')
1257 145 69954 if ($type eq 'postfix')
1268 1120 68836 if ($type eq 'new')
1269 0 2 $_->can('taint') ? :
0 950 tainted $JE::Code::taint ? :
950 172 @$expr == 4 ? :
1278 62929 5907 if ($type eq 'member/call')
1281 46975 22267 if (ref $_ eq 'JE::Code::Subscript') { }
1282 45630 1345 if ref $obj eq 'JE::LValue'
1287 0 0 $_->can('taint') ? :
0 22267 tainted $JE::Code::taint ? :
1307 5260 647 if ($type eq 'array')
1310 15614 20611 if (ref $$expr[$_] eq 'comma') { }
1311 134 15480 if ref $$expr[$_ - 1] eq 'comma' or $_ == 2
1316 714 19897 if ref $ary[-1] eq 'JE::LValue'
1328 463 184 if ($type eq 'hash')
1336 24 70 if ref $value eq 'JE::LValue'
1341 184 0 if ($type eq 'func')
1346 177 7 ref $$expr[2] ? :
1348 7 177 $name ? :
1357 7 177 defined $name ? :
1363 7 177 if ($name)
1377 125685 175104 if ref $term eq 'JE::Code::Expression'
1379 0 46785 ref $term eq 'ARRAY' ? :
0 20338 $term eq 'n' ? :
0 20338 $term eq 'f' ? :
0 20338 $term eq 't' ? :
99762 20338 $term =~ /^i/ ? :
7796 120100 $term =~ /^s/ ? :
423 127896 $term eq 'this' ? :
46785 128319 ref $term ? :
1403 40919 6058 ref $val ? :
1425 5548 35320 ref $val eq 'JE::LValue' ? :