diff options
author | 2022-03-23 01:46:47 -0700 | |
---|---|---|
committer | 2022-03-23 01:46:47 -0700 | |
commit | 5e5f0bd2930a0e1a2f897ba6e857be05e8ca04f2 (patch) | |
tree | c7b707280cba036f57ba2888bde6034845cb0448 /src/io | |
parent | 9974142eef9909866128951f64f4beb8a9617db7 (diff) | |
download | bun-5e5f0bd2930a0e1a2f897ba6e857be05e8ca04f2.tar.gz bun-5e5f0bd2930a0e1a2f897ba6e857be05e8ca04f2.tar.zst bun-5e5f0bd2930a0e1a2f897ba6e857be05e8ca04f2.zip |
[bun.js] Implement Bun.write()
Diffstat (limited to 'src/io')
-rw-r--r-- | src/io/io_linux.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/io/io_linux.zig b/src/io/io_linux.zig index 559d2289d..fa4566b83 100644 --- a/src/io/io_linux.zig +++ b/src/io/io_linux.zig @@ -427,8 +427,12 @@ pub const errno_map: [135]Errno = brk: { break :brk errors; }; pub fn asError(err: anytype) Errno { - return switch (err) { - 1...errno_map.len => errno_map[@intCast(u8, err)], + const errnum = if (@typeInfo(@TypeOf(err)) == .Enum) + @enumToInt(err) + else + err; + return switch (errnum) { + 1...errno_map.len => errno_map[@intCast(u8, errnum)], else => error.Unexpected, }; } |