[bun.js] Support mode and flags as integer args in fs.openSync (instead of only object)

This commit is contained in:
Jarred Sumner
2022-04-02 05:12:43 -07:00
parent e6b70c3e01
commit c73fcb0731

View File

@@ -985,6 +985,12 @@ const Arguments = struct {
if (val.getIfPropertyExists(ctx.ptr(), "mode")) |mode_| {
mode = JSC.Node.modeFromJS(ctx, mode_, exception) orelse mode;
}
} else if (!val.isEmpty()) {
flags = FileSystemFlags.fromJS(ctx, val, exception) orelse flags;
if (arguments.nextEat()) |next| {
mode = JSC.Node.modeFromJS(ctx, next, exception) orelse mode;
}
}
}