forked from oven-sh/bun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Debugger.zig
33 lines (31 loc) · 1.46 KB
/
Debugger.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const bun = @import("root").bun;
const JSC = bun.JSC;
pub const Debugger = struct {
pub const AsyncCallType = enum(u8) {
DOMTimer = 1,
EventListener = 2,
PostMessage = 3,
RequestAnimationFrame = 4,
Microtask = 5,
};
extern fn Debugger__didScheduleAsyncCall(*JSC.JSGlobalObject, AsyncCallType, u64, bool) void;
extern fn Debugger__didCancelAsyncCall(*JSC.JSGlobalObject, AsyncCallType, u64) void;
extern fn Debugger__didDispatchAsyncCall(*JSC.JSGlobalObject, AsyncCallType, u64) void;
extern fn Debugger__willDispatchAsyncCall(*JSC.JSGlobalObject, AsyncCallType, u64) void;
pub fn didScheduleAsyncCall(globalObject: *JSC.JSGlobalObject, call: AsyncCallType, id: u64, single_shot: bool) void {
JSC.markBinding(@src());
Debugger__didScheduleAsyncCall(globalObject, call, id, single_shot);
}
pub fn didCancelAsyncCall(globalObject: *JSC.JSGlobalObject, call: AsyncCallType, id: u64) void {
JSC.markBinding(@src());
Debugger__didCancelAsyncCall(globalObject, call, id);
}
pub fn didDispatchAsyncCall(globalObject: *JSC.JSGlobalObject, call: AsyncCallType, id: u64) void {
JSC.markBinding(@src());
Debugger__didDispatchAsyncCall(globalObject, call, id);
}
pub fn willDispatchAsyncCall(globalObject: *JSC.JSGlobalObject, call: AsyncCallType, id: u64) void {
JSC.markBinding(@src());
Debugger__willDispatchAsyncCall(globalObject, call, id);
}
};