add defaultView getter to HTMLDocument

This commit is contained in:
Karl Seguin
2025-05-16 20:33:28 +08:00
parent afd29fef81
commit f165131da8
5 changed files with 34 additions and 13 deletions

View File

@@ -1952,9 +1952,16 @@ fn Caller(comptime E: type, comptime State: type) type {
const params = @typeInfo(F).@"fn".params;
const param = params[index].type.?;
if (param != State) {
@compileError(std.fmt.comptimePrint("The {d} parameter to {s} must be a {s}. Got: {s}", .{ index, named_function.full_name, @typeName(State), @typeName(param) }));
if (param == State) {
return;
}
if (@typeInfo(State) == .pointer) {
if (param == *const @typeInfo(State).pointer.child) {
return;
}
}
@compileError(std.fmt.comptimePrint("The {d} parameter to {s} must be a {s}. Got: {s}", .{ index, named_function.full_name, @typeName(State), @typeName(param) }));
}
fn handleError(self: *Self, comptime Struct: type, comptime named_function: NamedFunction, err: anyerror, info: anytype) void {