update qjs to always import std and os
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run

This commit is contained in:
The Ghost of FOSS' Past 2024-10-25 12:23:19 -05:00
parent c0f750ef9e
commit edfcece1ae

6
qjs.c
View file

@ -487,14 +487,14 @@ int main(int argc, char **argv)
#endif #endif
js_std_add_helpers(ctx, argc - optind, argv + optind); js_std_add_helpers(ctx, argc - optind, argv + optind);
/* make 'std' and 'os' visible to non module code */ /* make 'std' and 'os' visible to all code */
if (load_std) { //if (load_std) {
const char *str = "import * as std from 'std';\n" const char *str = "import * as std from 'std';\n"
"import * as os from 'os';\n" "import * as os from 'os';\n"
"globalThis.std = std;\n" "globalThis.std = std;\n"
"globalThis.os = os;\n"; "globalThis.os = os;\n";
eval_buf(ctx, str, strlen(str), "<input>", JS_EVAL_TYPE_MODULE); eval_buf(ctx, str, strlen(str), "<input>", JS_EVAL_TYPE_MODULE);
} //}
for(i = 0; i < include_count; i++) { for(i = 0; i < include_count; i++) {