File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -630,6 +630,18 @@ fn has_named_attribute(list: Option<&ExtendedAttributeList>, attribute: &str) ->
630
630
} )
631
631
}
632
632
633
+ fn has_ident_attribute ( list : Option < & ExtendedAttributeList > , ident : & str ) -> bool {
634
+ let list = match list {
635
+ Some ( list) => list,
636
+ None => return false ,
637
+ } ;
638
+ list. body . list . iter ( ) . any ( |attr| match attr {
639
+ ExtendedAttribute :: Ident ( id) => id. lhs_identifier . 0 == ident,
640
+ ExtendedAttribute :: IdentList ( id) => id. identifier . 0 == ident,
641
+ _ => false ,
642
+ } )
643
+ }
644
+
633
645
/// ChromeOnly is for things that are only exposed to privileged code in Firefox.
634
646
pub fn is_chrome_only ( ext_attrs : & Option < ExtendedAttributeList > ) -> bool {
635
647
has_named_attribute ( ext_attrs. as_ref ( ) , "ChromeOnly" )
@@ -646,7 +658,8 @@ pub fn is_structural(
646
658
container_attrs : Option < & ExtendedAttributeList > ,
647
659
) -> bool {
648
660
has_named_attribute ( item_attrs, "Unforgeable" ) ||
649
- has_named_attribute ( container_attrs, "Unforgeable" )
661
+ has_named_attribute ( container_attrs, "Unforgeable" ) ||
662
+ has_ident_attribute ( container_attrs, "Global" )
650
663
}
651
664
652
665
/// Whether a webidl object is marked as throwing.
You can’t perform that action at this time.
0 commit comments