window: implement a debug() function

In order to ease debug log in js world
This commit is contained in:
Pierre Tachoire
2024-11-28 16:31:30 +01:00
parent 8f7a8c0ee1
commit 58ca323918

View File

@@ -28,6 +28,8 @@ const EventTarget = @import("../dom/event_target.zig").EventTarget;
const storage = @import("../storage/storage.zig");
const log = std.log.scoped(.window);
// https://dom.spec.whatwg.org/#interface-window-extensions
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#window
pub const Window = struct {
@@ -66,6 +68,10 @@ pub const Window = struct {
return self;
}
pub fn _debug(_: *Window, str: []const u8) void {
log.debug("{s}", .{str});
}
pub fn get_self(self: *Window) *Window {
return self;
}