add indexed_get to namednodemap

This commit is contained in:
Karl Seguin
2025-04-19 21:28:16 +08:00
parent 66ec087416
commit 42bc80e5b5

View File

@@ -70,6 +70,13 @@ pub const NamedNodeMap = struct {
) !*parser.Attribute {
return try parser.namedNodeMapRemoveNamedItemNS(self, namespace, localname);
}
pub fn indexed_get(self: *parser.NamedNodeMap, index: u32, has_value: *bool) !*parser.Attribute {
return (try NamedNodeMap._item(self, index)) orelse {
has_value.* = false;
return undefined;
};
}
};
// Tests