fix error messaging
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user