summaryrefslogtreecommitdiff
path: root/run-test262.c
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2025-05-05 15:59:04 +0200
committerFabrice Bellard <fabrice@bellard.org>2025-05-05 15:59:04 +0200
commit0a6160d7b3290710daf2dbeaba73d4d50e93b684 (patch)
treeb4966d7b811806532b268fce6d48a1a58aac3ba4 /run-test262.c
parent11d076fac6691da27df021872cdb12ec44d022e6 (diff)
downloadquickjs-0a6160d7b3290710daf2dbeaba73d4d50e93b684.tar.gz
quickjs-0a6160d7b3290710daf2dbeaba73d4d50e93b684.zip
avoid relying on 'FILE *' in JS_PrintValue() API
Diffstat (limited to 'run-test262.c')
-rw-r--r--run-test262.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/run-test262.c b/run-test262.c
index d1fa4f3..3da79a0 100644
--- a/run-test262.c
+++ b/run-test262.c
@@ -372,6 +372,12 @@ static void enumerate_tests(const char *path)
namelist_cmp_indirect);
}
+static void js_print_value_write(void *opaque, const char *buf, size_t len)
+{
+ FILE *fo = opaque;
+ fwrite(buf, 1, len, fo);
+}
+
static JSValue js_print(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
@@ -397,7 +403,7 @@ static JSValue js_print(JSContext *ctx, JSValueConst this_val,
fwrite(str, 1, len, outfile);
JS_FreeCString(ctx, str);
} else {
- JS_PrintValue(ctx, outfile, v, NULL);
+ JS_PrintValue(ctx, js_print_value_write, outfile, v, NULL);
}
}
fputc('\n', outfile);