From da591954a8c5488b3410e8a440b8db9a82b619c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 6 Sep 2024 23:23:41 +0200 Subject: [PATCH] Add ability to specify dump flags with an env variable Useful for CI for example. --- qjs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qjs.c b/qjs.c index acf929a..3ab74ab 100644 --- a/qjs.c +++ b/qjs.c @@ -321,6 +321,7 @@ int main(int argc, char **argv) struct trace_malloc_data trace_data = { NULL }; int optind; char *expr = NULL; + char *dump_flags_str = NULL; int interactive = 0; int dump_memory = 0; int dump_flags = 0; @@ -337,6 +338,9 @@ int main(int argc, char **argv) argv0 = (JSCFunctionListEntry)JS_PROP_STRING_DEF("argv0", argv[0], JS_PROP_C_W_E); + dump_flags_str = getenv("QJS_DUMP_FLAGS"); + dump_flags = dump_flags_str ? strtol(dump_flags_str, NULL, 16) : 0; + /* cannot use getopt because we want to pass the command line to the script */ optind = 1;