Skip to content

Commit 58ca323

Browse files
committed
window: implement a debug() function
In order to ease debug log in js world
1 parent 8f7a8c0 commit 58ca323

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/html/window.zig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ const EventTarget = @import("../dom/event_target.zig").EventTarget;
2828

2929
const storage = @import("../storage/storage.zig");
3030

31+
const log = std.log.scoped(.window);
32+
3133
// https://dom.spec.whatwg.org/#interface-window-extensions
3234
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#window
3335
pub const Window = struct {
@@ -66,6 +68,10 @@ pub const Window = struct {
6668
return self;
6769
}
6870

71+
pub fn _debug(_: *Window, str: []const u8) void {
72+
log.debug("{s}", .{str});
73+
}
74+
6975
pub fn get_self(self: *Window) *Window {
7076
return self;
7177
}

0 commit comments

Comments
 (0)