Elide : for zero-length Exception.__str__()

This commit is contained in:
K. Lange 2022-07-03 23:20:00 +09:00
parent de0af11361
commit f86887b40a

View File

@ -249,7 +249,7 @@ static void dumpInnerException(KrkValue exception, int depth) {
/* Stringify it. */
KrkValue result = krk_callDirect(krk_getType(exception)->_tostr, 1);
if (!IS_STRING(result)) {
if (!IS_STRING(result) || AS_STRING(result)->length == 0) {
fprintf(stderr, "\n");
} else {
fprintf(stderr, ": %s\n", AS_CSTRING(result));