mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 04:18:58 +00:00
Handle 0 in isCell
This commit is contained in:
@@ -3139,7 +3139,10 @@ pub const JSValue = enum(JSValueReprInt) {
|
||||
}
|
||||
|
||||
pub inline fn isCell(this: JSValue) bool {
|
||||
return (@bitCast(u64, @enumToInt(this)) & FFI.NotCellMask) == 0;
|
||||
return switch (this) {
|
||||
.zero, .undefined, .null, .true, .false => false,
|
||||
else => (@bitCast(u64, @enumToInt(this)) & FFI.NotCellMask) == 0,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn asCell(this: JSValue) *JSCell {
|
||||
|
||||
Reference in New Issue
Block a user