From d9a43d5a82ad4173ffdc27e6a234087a3ac9ea14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 24 Sep 2024 09:37:55 +0200 Subject: [PATCH] Provide a description for unitialized values in JS_ToStringInternal After 56da486312e655a2488bda74a284558682e93fda 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. --- quickjs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/quickjs.c b/quickjs.c index 1086202cf..b6ed12aef 100644 --- a/quickjs.c +++ b/quickjs.c @@ -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]"); }