Extract mutability out of Reflectable trait.

This commit is contained in:
Josh Matthews 2016-08-23 15:51:44 -04:00 committed by Ms2ger
parent bba3eefde8
commit 8653450b6e
5 changed files with 24 additions and 6 deletions

View file

@ -73,11 +73,15 @@ impl Reflector {
pub trait Reflectable {
/// Returns the receiver's reflector.
fn reflector(&self) -> &Reflector;
/// Initializes the Reflector
fn init_reflector(&mut self, obj: *mut JSObject);
/// Returns the global object of the realm that the Reflectable was created in.
fn global(&self) -> GlobalRoot where Self: Sized {
global_root_from_reflector(self)
}
}
/// A trait to initialize the `Reflector` for a DOM object.
pub trait MutReflectable: Reflectable {
/// Initializes the Reflector
fn init_reflector(&mut self, obj: *mut JSObject);
}