Skip to content

Commit d9a43d5

Browse files
committed
Provide a description for unitialized values in JS_ToStringInternal
After 56da486 it's possible existing code relied on the current exception not being null to dump it, and the dumped value just said "[unsupported type]". This change provides a more descriptive value.
1 parent 647e32c commit d9a43d5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

quickjs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11574,6 +11574,8 @@ JSValue JS_ToStringInternal(JSContext *ctx, JSValue val, BOOL is_ToPropertyKey)
1157411574
return js_dtoa(ctx, JS_VALUE_GET_FLOAT64(val), 0, JS_DTOA_TOSTRING);
1157511575
case JS_TAG_BIG_INT:
1157611576
return js_bigint_to_string(ctx, val);
11577+
case JS_TAG_UNINITIALIZED:
11578+
return js_new_string8(ctx, "[uninitialized]");
1157711579
default:
1157811580
return js_new_string8(ctx, "[unsupported type]");
1157911581
}

0 commit comments

Comments
 (0)