Provide a description for unitialized values in JS_ToStringInternal

After 56da486312 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.
This commit is contained in:
Saúl Ibarra Corretgé 2024-09-24 09:37:55 +02:00
parent 647e32c047
commit d9a43d5a82

View file

@ -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]");
}