Skip to content

Commit

Permalink
Provide a description for unitialized values in JS_ToStringInternal
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
saghul committed Sep 24, 2024
1 parent 647e32c commit d9a43d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -11574,6 +11574,8 @@ JSValue JS_ToStringInternal(JSContext *ctx, JSValue val, BOOL is_ToPropertyKey)
return js_dtoa(ctx, JS_VALUE_GET_FLOAT64(val), 0, JS_DTOA_TOSTRING);
case JS_TAG_BIG_INT:
return js_bigint_to_string(ctx, val);
case JS_TAG_UNINITIALIZED:
return js_new_string8(ctx, "[uninitialized]");
default:
return js_new_string8(ctx, "[unsupported type]");
}
Expand Down

0 comments on commit d9a43d5

Please sign in to comment.