mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Add inheritance-checking lint
This commit is contained in:
parent
7d65673561
commit
d761877ef6
9 changed files with 139 additions and 21 deletions
|
@ -14,12 +14,20 @@ use syntax::parse::token::InternedString;
|
|||
|
||||
pub fn expand_dom_struct(_: &mut ExtCtxt, _: Span, _: &MetaItem, item: P<Item>) -> P<Item> {
|
||||
let mut item2 = (*item).clone();
|
||||
item2.attrs.push(attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item(InternedString::new("must_root"))));
|
||||
item2.attrs.push(attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item(InternedString::new("privatize"))));
|
||||
item2.attrs.push(attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item(InternedString::new("jstraceable"))));
|
||||
{
|
||||
let add_attr = |s| {
|
||||
item2.attrs.push(attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item(InternedString::new(s))));
|
||||
};
|
||||
add_attr("must_root");
|
||||
add_attr("privatize");
|
||||
add_attr("jstraceable");
|
||||
|
||||
// The following attribute is only for internal usage
|
||||
item2.attrs.push(attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item(InternedString::new("_generate_reflector"))));
|
||||
// The following attributes are only for internal usage
|
||||
add_attr("_generate_reflector");
|
||||
// #[dom_struct] gets consumed, so this lets us keep around a residue
|
||||
// Do NOT register a modifier/decorator on this attribute
|
||||
add_attr("_dom_struct_marker");
|
||||
}
|
||||
P(item2)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue