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

@ -7,8 +7,6 @@ use script_task::page_from_context;
use js::jsapi::{JSContext, JSObject};
use std::cast;
pub struct WindowProxy {
reflector_: Reflector
}
@ -35,8 +33,12 @@ impl BindingObject for WindowProxy {
}
impl Reflectable for WindowProxy {
fn reflector(&mut self) -> &mut Reflector {
unsafe { cast::transmute(self.reflector_) }
fn reflector<'a>(&'a self) -> &'a Reflector {
&self.reflector_
}
fn mut_reflector<'a>(&'a mut self) -> &'a mut Reflector {
&mut self.reflector_
}
fn wrap_object_shared(@mut self, _cx: *JSContext, _scope: *JSObject) -> *JSObject {