Skip to content

Commit 9c83b26

Browse files
committed
persist the detail if provided
1 parent 10fc056 commit 9c83b26

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/browser/events/custom_event.zig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub const CustomEvent = struct {
6464
event_type: []const u8,
6565
can_bubble: bool,
6666
cancelable: bool,
67-
detail: ?JsObject,
67+
maybe_detail: ?JsObject,
6868
) !void {
6969
// This function can only be called after the constructor has called.
7070
// So we assume proto is initialized already by constructor.
@@ -73,7 +73,9 @@ pub const CustomEvent = struct {
7373
self.proto.cancelable = cancelable;
7474
self.proto.is_initialised = true;
7575
// Detail is stored separately.
76-
self.detail = detail;
76+
if (maybe_detail) |detail| {
77+
self.detail = try detail.persist();
78+
}
7779
}
7880
};
7981

0 commit comments

Comments
 (0)