diff options
Diffstat (limited to 'components/script/dom/bindings/global.rs')
-rw-r--r-- | components/script/dom/bindings/global.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/components/script/dom/bindings/global.rs b/components/script/dom/bindings/global.rs index af4cd59a86f..54efb11250d 100644 --- a/components/script/dom/bindings/global.rs +++ b/components/script/dom/bindings/global.rs @@ -271,14 +271,6 @@ impl<'a> GlobalRef<'a> { } } - /// Returns the receiver's reflector. - pub fn reflector(&self) -> &Reflector { - match *self { - GlobalRef::Window(ref window) => window.reflector(), - GlobalRef::Worker(ref worker) => worker.reflector(), - } - } - /// Returns a wrapper for runnables to ensure they are cancelled if the global /// is being destroyed. pub fn get_runnable_wrapper(&self) -> RunnableWrapper { @@ -297,6 +289,15 @@ impl<'a> GlobalRef<'a> { } } +impl<'a> Reflectable for GlobalRef<'a> { + fn reflector(&self) -> &Reflector { + match *self { + GlobalRef::Window(ref window) => window.reflector(), + GlobalRef::Worker(ref worker) => worker.reflector(), + } + } +} + impl GlobalRoot { /// Obtain a safe reference to the global object that cannot outlive the /// lifetime of this root. |