Skip to content

Commit 28d5c68

Browse files
Use sendEvent in Runtime.executionContextCreated and expose it
Signed-off-by: Francis Bouvier <[email protected]>
1 parent 7a03562 commit 28d5c68

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/cdp/runtime.zig

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn enable(
5555
return result(alloc, id, null, null, sessionID);
5656
}
5757

58-
const AuxData = struct {
58+
pub const AuxData = struct {
5959
isDefault: bool = true,
6060
type: []const u8 = "default",
6161
frameId: []const u8 = cdp.FrameID,
@@ -69,15 +69,16 @@ const ExecutionContextDescription = struct {
6969
auxData: ?AuxData = null,
7070
};
7171

72-
fn executionContextCreated(
72+
pub fn executionContextCreated(
7373
alloc: std.mem.Allocator,
74+
ctx: *Ctx,
7475
id: u64,
7576
origin: []const u8,
7677
name: []const u8,
7778
uniqueID: []const u8,
7879
auxData: ?AuxData,
7980
sessionID: ?[]const u8,
80-
) ![]const u8 {
81+
) !void {
8182
const Params = struct {
8283
context: ExecutionContextDescription,
8384
};
@@ -90,7 +91,7 @@ fn executionContextCreated(
9091
.auxData = auxData,
9192
},
9293
};
93-
return try cdp.method(alloc, "Runtime.executionContextCreated", Params, params, sessionID);
94+
try cdp.sendEvent(alloc, ctx, "Runtime.executionContextCreated", Params, params, sessionID);
9495
}
9596

9697
fn runIfWaitingForDebugger(

0 commit comments

Comments
 (0)