Branch Coverage

lib/JavaScript/Embedded.pm
Criterion Covered Total %
branch 137 166 82.5


line true false branch
139 2 72 if ($timeout)
140 1 1 unless JavaScript::Embedded::Vm::duk_sv_is_number($timeout)
143 6 67 if ($max_memory)
144 1 5 unless JavaScript::Embedded::Vm::duk_sv_is_number($max_memory)
145 1 4 if $max_memory < 262144
191 2 44 if ($name =~ /\./)
197 0 2 if ($duk->peval_string($others) != 0)
202 0 2 if ($type != 6)
223 0 1 if ($duk->peval != 0)
236 0 6 if ($duk->peval != 0)
250 9 22 if ($duk->peval_string($string) != 0)
274 0 71 unless $duk
281 71 0 if ($self->{'pid'} and $self->{'pid'} == $$)
311 0 56 $^O eq 'MSWin32' ? :
346 101 177924 if (my $ref = ref $val) { }
347 1 100 if ($ref eq 'JavaScript::Embedded::NULL') { }
6 94 elsif ($BOOL_PACKAGES->{$ref}) { }
12 82 elsif ($ref eq 'ARRAY') { }
16 66 elsif ($ref eq 'HASH') { }
46 20 elsif ($ref eq 'CODE') { }
12 8 elsif ($ref eq 'JavaScript::Embedded::Object') { }
0 8 elsif ($ref eq 'JavaScript::Embedded::Function') { }
0 8 elsif ($ref eq 'JavaScript::Embedded::Pointer') { }
6 2 elsif ($ref eq 'JavaScript::Embedded::Buffer') { }
2 0 elsif ($ref eq 'SCALAR') { }
352 3 3 if ($val) { }
365 2 30 if ($$stash{$val->[$idx]}) { }
380 1 28 if ($v and $stash->{$v}) { }
407 5 1 defined $$val ? :
413 1 1 $$val ? :
421 3 177921 if (not defined $val) { }
177491 430 elsif (duk_sv_is_number($val)) { }
437 0 239 unless ($heapptr)
455 173 12164 if ($type == 1) { }
8507 3657 elsif ($type == 5) { }
2319 1338 elsif ($type == 4) { }
5 1333 elsif ($type == 7) { }
1288 45 elsif ($type == 6) { }
39 6 elsif ($type == 3) { }
3 3 elsif ($type == 2) { }
3 0 elsif ($type == 8) { }
474 444 844 if ($self->is_function($index))
483 5 4 if ($self->pcall_method($len) == 1)
495 0 844 if ($stash->{$heapptr}) { }
499 30 814 $isArray ? :
510 1309 4441 if ($self->get_type(-1) == 6) { }
512 63 1246 if ($stash->{$heapptr}) { }
525 133 5617 if ($isArray) { }
538 31 8 if ($bool == 1) { }
578 177481 108 unless ($heap)
617 21 177581 if ($err)
638 37 177612 if (my $error = $@)
639 22 15 if ($error =~ /^Duk::Error/i) { }
649 177612 0 defined $ret ? :
653 177612 37 defined $ret ? :
660 1 3 unless duk_sv_is_number($timeout)
668 0 2 unless duk_sv_is_number($max_memory)
669 1 1 if $max_memory < 262144
723 28 15 ${$_[0];} ? :
730 0 56 $use_boolean ? :
731 0 56 $use_boolean ? :
737 1 1 ${$_[0];} ? :
747 0 5 ${$_[0];} ? :
789 0 522 if $method eq "DESTROY"
798 17 234 unless $refcount
826 0 0 if $method eq "DESTROY"
847 0 522 if ($method eq "new")
852 0 0 if ($duk->pnew($len) != 0)
864 379 143 if ($type == 6 or $type == 7) { }
868 379 0 if ($duk->is_function(-1)) { }
871 377 2 if (@_) { }
873 3 374 if ref $_[0] eq "NOARGS"
904 136 379 if ($ref eq 'NEW') { }
0 379 elsif ($ref eq 'HEAP') { }
0 379 elsif ($ref eq 'DUK') { }
917 379 136 unless $isNew
919 211 332 if (ref $val eq 'CODE') { }
927 136 379 if ($isNew) { }
928 0 136 if ($duk->pnew($len) != 0)
933 0 379 if ($duk->pcall_method($len) != 0)
941 205 310 if ($type == 6 or $type == 7) { }
953 377 7 if $doCall
986 5 234 if ($duk->is_function(-1))