Branch Coverage

QuickJS.xs
Criterion Covered Total %
branch 151 202 74.7


line true false branch
149 1265 12 for(int i = 0; i < tab_atom_count; i++) {
158 1264 1 if (val_sv) {
167 1 1264 if (!val_sv) break;
172 1 12 if (*err_svp) {
188 20 5 if (len) {
190 129 19 for (uint32_t i=0; i
195 128 1 if (val_sv) av_store( av, i, val_sv );
199 1 128 if (!val_sv) break;
203 1 24 if (*err_svp) {
240 5 7 RETVAL = boolSV(JS_VALUE_GET_BOOL(jsval));
249 10 58 if (JS_IsFunction(ctx, jsval)) {
270 25 33 else if (JS_IsArray(ctx, jsval)) {
277 2 31 if (JS_IsInstanceOf(ctx, jsval, ctxdata->regexp_jsvalue)) {
280 2 29 else if (JS_IsInstanceOf(ctx, jsval, ctxdata->date_jsvalue)) {
283 16 13 else if (JS_IsInstanceOf(ctx, jsval, ctxdata->promise_jsvalue)) {
297 4 0 if (typename) {
316 15 13 if (ctxdata->svs_count == 1) {
345 9 1 if (!error2) break;
350 0 1 if (tries > _MAX_ERRSV_TO_JS_TRIES) {
377 20 22 for (int a=0; a
380 2 18 if (error_sv) {
381 1 2 while (--a >= 0) {
389 22 2 if (!error_sv) {
392 20 2 if (from_perl) {
397 17 3 if (!error_sv) return to_js;
415 1252 121 SvGETMAGIC(value);
0 1252 SvGETMAGIC(value);
417 1144 229 switch ( exs_sv_type(value) ) {
1086 58 switch ( exs_sv_type(value) ) {
1086 0 switch ( exs_sv_type(value) ) {
31 1055 switch ( exs_sv_type(value) ) {
31 0 switch ( exs_sv_type(value) ) {
4 27 switch ( exs_sv_type(value) ) {
4 0 switch ( exs_sv_type(value) ) {
435 0 0 if (val_uv > IV_MAX) {
436 0 0 return JS_NewFloat64(ctx, val_uv);
439 0 0 return JS_NewInt64(ctx, (int64_t) val_uv);
456 10 48 if (sv_isobject(value)) {
457 2 8 if (sv_derived_from(value, PERL_BOOLEAN_CLASS)) {
460 3 5 else if (sv_derived_from(value, PQJS_JSOBJECT_CLASS)) {
463 2 1 if (LIKELY(pqjs->ctx == ctx)) {
491 7 0 JS_SetPropertyStr(ctx, jsarray, "length", JS_NewUint32(ctx, 1 + av_len(av)));
493 5 6 for (int32_t i=0; i <= av_len(av); i++) {
500 1 4 if (*error_svp) {
518 1259 9 while ( (hvent = hv_iternext(hv)) ) {
526 1 1258 if (*error_svp) {
609 14 222 if (JS_IsException(jsret)) {
620 16 220 if (err) croak_sv(err);
628 31 23 if (--ctxdata->refcount == 0) {
635 12 31 for (U32 i=0; isvs_count; i++) {
639 0 31 if (ctxdata->ran_js_std_init_handlers) {
659 1 7 if (module_base_path) {
704 20 13 for (int32_t i=0; i
709 2 18 if (error) {
710 0 2 while (--i >= 0) {
731 0 5 if (JS_IsException(val)) {
733 0 0 if (errsv) {
783 0 42 if (PL_dirty && pqjs->pid == getpid()) {
0 0 if (PL_dirty && pqjs->pid == getpid()) {
787 1 41 if (pqjs->module_base_path) Safefree(pqjs->module_base_path);
798 4 4 if (SvOK(max_stack_size_sv)) {
802 4 2 if (SvOK(memory_limit_sv)) {
806 4 0 if (SvOK(gc_threshold_sv)) {
825 4 0 if (!pqjs->added_std) {
833 1 0 if (!pqjs->added_os) {
839 1 0 if (!ctxdata->ran_js_std_init_handlers) {
851 1 0 if (!pqjs->added_helpers) {
872 0 1 if (pqjs->module_base_path) {
884 0 1 if (!SvOK(path_sv)) croak("Give a path! (Did you want unset_module_base?)");
892 0 1 if (pqjs->module_base_path) {
915 0 42 if (items < 2) croak("Need at least 1 key/value pair.");
917 0 42 if (!(items % 2)) croak("Need an even list of key/value pairs.");
930 47 40 for (int i=0; i < valscount; i++) {
939 2 45 if (error) {
940 0 2 while (i-- > 0) {
954 45 40 for (int i=0; i < valscount; i++) {
1036 30 0 switch (exs_sv_type(num_sv)) {
30 0 switch (exs_sv_type(num_sv)) {
30 0 switch (exs_sv_type(num_sv)) {
15 15 switch (exs_sv_type(num_sv)) {
15 0 switch (exs_sv_type(num_sv)) {
0 15 switch (exs_sv_type(num_sv)) {
0 0 switch (exs_sv_type(num_sv)) {
15 15 switch (exs_sv_type(num_sv)) {
1042 15 0 if (nvval > IV_MAX || nvval < IV_MIN) {
0 15 if (nvval > IV_MAX || nvval < IV_MIN) {
1107 1 58 if (items > 1) {
1113 1 0 if (error) {
1126 0 0 for (uint32_t i=0; i
1163 2 2 JSAtom prop = JS_NewAtom(ctx, ix ? "test" : "exec");
1206 0 8 if (err) croak_sv(err);
1220 0 12 if (PL_dirty && pqjs->pid == getpid()) {
0 0 if (PL_dirty && pqjs->pid == getpid()) {
1254 0 4 if (err) croak_sv(err);
1269 1 9 if (error) croak_sv(error);
1274 1 8 if (error) {
1283 8 8 for (uint32_t i=0; i
1315 0 5 if (error) {
1331 10 5 for (uint32_t i=0; i
1350 0 2 if (error) croak_sv(error);
1352 1 1 JSAtom method_name = JS_NewAtom(pqjs->ctx, ix ? "finally" : "catch");