mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
Handle segfault when console.log'ing stuff that should never make it to console.log in the first place
This commit is contained in:
@@ -1231,6 +1231,15 @@ pub const ZigConsoleClient = struct {
|
||||
.cell = js_type,
|
||||
};
|
||||
|
||||
// Cell is the "unknown" type
|
||||
// if we call JSObjectGetPrivate, it can segfault
|
||||
if (js_type == .Cell) {
|
||||
return .{
|
||||
.tag = .NativeCode,
|
||||
.cell = js_type,
|
||||
};
|
||||
}
|
||||
|
||||
if (CAPI.JSObjectGetPrivate(value.asObjectRef()) != null)
|
||||
return .{
|
||||
.tag = .Private,
|
||||
|
||||
Reference in New Issue
Block a user