add indexed_get to namednodemap

This commit is contained in:
Karl Seguin committed 2025-04-19 21:28:16 +08:00
1 parent 66ec087416
commit 42bc80e5b5
1 file changed
+7
+7
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