diff options
author | 2023-01-09 02:28:14 -0800 | |
---|---|---|
committer | 2023-01-09 02:28:14 -0800 | |
commit | f0475e89c5065d91e58bcb3e512fa972fd7874e5 (patch) | |
tree | 461c51d1f463ce5930546b8f249cb0dc231cbc4a | |
parent | cb75b4799fbb0bf71da062f5d285b8c8ca31ae00 (diff) | |
download | bun-f0475e89c5065d91e58bcb3e512fa972fd7874e5.tar.gz bun-f0475e89c5065d91e58bcb3e512fa972fd7874e5.tar.zst bun-f0475e89c5065d91e58bcb3e512fa972fd7874e5.zip |
Handle 0 in isCell
-rw-r--r-- | src/bun.js/bindings/bindings.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bun.js/bindings/bindings.zig b/src/bun.js/bindings/bindings.zig index 415c48612..1afb5a588 100644 --- a/src/bun.js/bindings/bindings.zig +++ b/src/bun.js/bindings/bindings.zig @@ -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 { |