mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
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:
parent
647e32c047
commit
d9a43d5a82
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
return js_dtoa(ctx, JS_VALUE_GET_FLOAT64(val), 0, JS_DTOA_TOSTRING);
|
||||||
case JS_TAG_BIG_INT:
|
case JS_TAG_BIG_INT:
|
||||||
return js_bigint_to_string(ctx, val);
|
return js_bigint_to_string(ctx, val);
|
||||||
|
case JS_TAG_UNINITIALIZED:
|
||||||
|
return js_new_string8(ctx, "[uninitialized]");
|
||||||
default:
|
default:
|
||||||
return js_new_string8(ctx, "[unsupported type]");
|
return js_new_string8(ctx, "[unsupported type]");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue