Add support for the "x" flag in std.open()

This commit is contained in:
Saúl Ibarra Corretgé 2024-12-03 09:36:28 +01:00
parent 92577d33ff
commit 4968ef6e90

View file

@ -1024,7 +1024,7 @@ static JSValue js_std_open(JSContext *ctx, JSValue this_val,
mode = JS_ToCString(ctx, argv[1]);
if (!mode)
goto fail;
if (mode[strspn(mode, "rwa+b")] != '\0') {
if (mode[strspn(mode, "rwa+bx")] != '\0') {
JS_ThrowTypeError(ctx, "invalid file mode");
goto fail;
}