aboutsummaryrefslogtreecommitdiffstats
path: root/components/plugins/reflector.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/plugins/reflector.rs')
-rw-r--r--components/plugins/reflector.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/components/plugins/reflector.rs b/components/plugins/reflector.rs
index 4e6f69ed2d3..04e22fa826c 100644
--- a/components/plugins/reflector.rs
+++ b/components/plugins/reflector.rs
@@ -24,12 +24,17 @@ pub fn expand_reflector(cx: &mut ExtCtxt, span: Span, _: &MetaItem, annotatable:
fn reflector<'a>(&'a self) -> &'a ::dom::bindings::reflector::Reflector {
&self.$field_name
}
+ }
+ );
+ let impl_item_mut = quote_item!(cx,
+ impl ::dom::bindings::reflector::MutReflectable for $struct_name {
fn init_reflector(&mut self, obj: *mut ::js::jsapi::JSObject) {
self.$field_name.set_jsobject(obj);
}
}
);
- impl_item.map(|it| push(Annotatable::Item(it)))
+ impl_item.map(|it| push(Annotatable::Item(it)));
+ impl_item_mut.map(|it| push(Annotatable::Item(it)))
},
// Or just call it on the first field (supertype).
None => {
@@ -39,12 +44,17 @@ pub fn expand_reflector(cx: &mut ExtCtxt, span: Span, _: &MetaItem, annotatable:
fn reflector<'a>(&'a self) -> &'a ::dom::bindings::reflector::Reflector {
self.$field_name.reflector()
}
+ }
+ );
+ let impl_item_mut = quote_item!(cx,
+ impl ::dom::bindings::reflector::MutReflectable for $struct_name {
fn init_reflector(&mut self, obj: *mut ::js::jsapi::JSObject) {
self.$field_name.init_reflector(obj);
}
}
);
- impl_item.map(|it| push(Annotatable::Item(it)))
+ impl_item.map(|it| push(Annotatable::Item(it)));
+ impl_item_mut.map(|it| push(Annotatable::Item(it)))
}
};