Skip to content

Commit 3328529

Browse files
gh-78: Fix MAP boolean representation.
1 parent 60343f9 commit 3328529

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/interpreter.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,11 @@ int value_truthiness(Value v) {
599599
}
600600
return 0;
601601
}
602+
case VAL_MAP: {
603+
Map* m = v.as.map;
604+
if (!m) return 0;
605+
return m->count > 0;
606+
}
602607
default:
603608
return 0;
604609
}

0 commit comments

Comments
 (0)