Introduce mutable/immutable variants of reflector() with named lifetimes, and kill unsafe casts.

This commit is contained in:
Bobby Holley 2013-10-10 11:49:17 +02:00
parent e6be738d97
commit c4bbc4cd37
24 changed files with 158 additions and 87 deletions

View file

@ -200,10 +200,14 @@ impl HTMLDocument {
}
impl Reflectable for HTMLDocument {
fn reflector(&mut self) -> &mut Reflector {
fn reflector<'a>(&'a self) -> &'a Reflector {
self.parent.reflector()
}
fn mut_reflector<'a>(&'a mut self) -> &'a mut Reflector {
self.parent.mut_reflector()
}
fn wrap_object_shared(@mut self, cx: *JSContext, scope: *JSObject) -> *JSObject {
let mut unused = false;
HTMLDocumentBinding::Wrap(cx, scope, self, &mut unused)