fix error messaging

This commit is contained in:
2026-01-23 11:28:06 -06:00
parent e6838338fc
commit b7615bb801
3 changed files with 11 additions and 615 deletions

View File

@@ -28,9 +28,8 @@ static JSValue js_json_decode(JSContext *ctx, JSValueConst this_val, int argc, J
if (!JS_IsString(argv[0])) {
JSValue err = JS_NewError(ctx);
JS_DefinePropertyValueStr(ctx, err, "message",
JS_NewString(ctx, "couldn't parse text: not a string"),
JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
JS_SetPropertyStr(ctx, err, "message",
JS_NewString(ctx, "couldn't parse text: not a string"));
return JS_Throw(ctx, err);
}