mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 19:08:50 +00:00
zig: prefer .jsUndefined() over .undefined for JSValue (#20332)
This commit is contained in:
@@ -939,13 +939,13 @@ pub const upgrade_js_bindings = struct {
|
||||
/// For testing upgrades when the temp directory has an open handle without FILE_SHARE_DELETE.
|
||||
/// Windows only
|
||||
pub fn jsOpenTempDirWithoutSharingDelete(_: *JSC.JSGlobalObject, _: *JSC.CallFrame) bun.JSError!bun.JSC.JSValue {
|
||||
if (comptime !Environment.isWindows) return .undefined;
|
||||
if (comptime !Environment.isWindows) return .jsUndefined();
|
||||
const w = std.os.windows;
|
||||
|
||||
var buf: bun.WPathBuffer = undefined;
|
||||
const tmpdir_path = fs.FileSystem.RealFS.getDefaultTempDir();
|
||||
const path = switch (bun.sys.normalizePathWindows(u8, bun.invalid_fd, tmpdir_path, &buf, .{})) {
|
||||
.err => return .undefined,
|
||||
.err => return .jsUndefined(),
|
||||
.result => |norm| norm,
|
||||
};
|
||||
|
||||
@@ -989,17 +989,17 @@ pub const upgrade_js_bindings = struct {
|
||||
else => {},
|
||||
}
|
||||
|
||||
return .undefined;
|
||||
return .jsUndefined();
|
||||
}
|
||||
|
||||
pub fn jsCloseTempDirHandle(_: *JSC.JSGlobalObject, _: *JSC.CallFrame) bun.JSError!JSValue {
|
||||
if (comptime !Environment.isWindows) return .undefined;
|
||||
if (comptime !Environment.isWindows) return .jsUndefined();
|
||||
|
||||
if (tempdir_fd) |fd| {
|
||||
fd.close();
|
||||
}
|
||||
|
||||
return .undefined;
|
||||
return .jsUndefined();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user