mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
Add ability to specify dump flags with an env variable
Useful for CI for example.
This commit is contained in:
parent
89d9305582
commit
da591954a8
1 changed files with 4 additions and 0 deletions
4
qjs.c
4
qjs.c
|
@ -321,6 +321,7 @@ int main(int argc, char **argv)
|
||||||
struct trace_malloc_data trace_data = { NULL };
|
struct trace_malloc_data trace_data = { NULL };
|
||||||
int optind;
|
int optind;
|
||||||
char *expr = NULL;
|
char *expr = NULL;
|
||||||
|
char *dump_flags_str = NULL;
|
||||||
int interactive = 0;
|
int interactive = 0;
|
||||||
int dump_memory = 0;
|
int dump_memory = 0;
|
||||||
int dump_flags = 0;
|
int dump_flags = 0;
|
||||||
|
@ -337,6 +338,9 @@ int main(int argc, char **argv)
|
||||||
argv0 = (JSCFunctionListEntry)JS_PROP_STRING_DEF("argv0", argv[0],
|
argv0 = (JSCFunctionListEntry)JS_PROP_STRING_DEF("argv0", argv[0],
|
||||||
JS_PROP_C_W_E);
|
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
|
/* cannot use getopt because we want to pass the command line to
|
||||||
the script */
|
the script */
|
||||||
optind = 1;
|
optind = 1;
|
||||||
|
|
Loading…
Reference in a new issue