diff --git a/quickjs-libc.c b/quickjs-libc.c index c24b6d5..c29de43 100644 --- a/quickjs-libc.c +++ b/quickjs-libc.c @@ -3691,7 +3691,8 @@ static JSValue js_worker_ctor(JSContext *ctx, JSValueConst new_target, /* module name */ filename = JS_ToCString(ctx, argv[0]); - if (!filename) + struct stat buffer; + if (!filename || stat(filename, &buffer) != 0) goto fail; args = malloc(sizeof(*args));