zig: prefer .jsUndefined() over .undefined for JSValue (#20332)

This commit is contained in:
Meghan Denny
2025-06-12 12:18:46 -08:00
committed by GitHub
parent d6590c4bfa
commit dedd433cbf
84 changed files with 569 additions and 574 deletions

View File

@@ -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();
}
};