From f0475e89c5065d91e58bcb3e512fa972fd7874e5 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Mon, 9 Jan 2023 02:28:14 -0800 Subject: Handle 0 in isCell --- src/bun.js/bindings/bindings.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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 { -- cgit v1.2.3