pretty json

This commit is contained in:
2026-02-15 22:28:44 -06:00
parent 7fc4a205f6
commit dc440587ff
24 changed files with 159462 additions and 877405 deletions

View File

@@ -1428,7 +1428,7 @@ TEST(stringify_json_object) {
obj_ref.val = JS_NewObject(ctx);
JSValue v1 = JS_NewInt32(ctx, 1);
JS_SetPropertyStr(ctx, obj_ref.val, "a", v1);
JSValue str = JS_JSONStringify(ctx, obj_ref.val, JS_NULL, JS_NULL);
JSValue str = JS_JSONStringify(ctx, obj_ref.val, JS_NULL, JS_NULL, 0);
JS_PopGCRef(ctx, &obj_ref);
ASSERT(JS_IsText(str));
const char *s = JS_ToCString(ctx, str);
@@ -1444,7 +1444,7 @@ TEST(stringify_json_array) {
arr_ref.val = JS_NewArray(ctx);
JS_ArrayPush(ctx, &arr_ref.val, JS_NewInt32(ctx, 1));
JS_ArrayPush(ctx, &arr_ref.val, JS_NewInt32(ctx, 2));
JSValue str = JS_JSONStringify(ctx, arr_ref.val, JS_NULL, JS_NULL);
JSValue str = JS_JSONStringify(ctx, arr_ref.val, JS_NULL, JS_NULL, 0);
JS_PopGCRef(ctx, &arr_ref);
ASSERT(JS_IsText(str));
const char *s = JS_ToCString(ctx, str);