diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2015-10-25 11:11:23 +0100 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2015-11-11 14:19:30 +0100 |
commit | b290a3161d8ac85c7bcc3f9d7c0ae5a6fa379607 (patch) | |
tree | da710987c0be55080eb995b986d12c5a03a32049 /components/script/dom/window.rs | |
parent | aa105d89b4031d98376ac804e31e287f3bf21bb8 (diff) | |
download | servo-b290a3161d8ac85c7bcc3f9d7c0ae5a6fa379607.tar.gz servo-b290a3161d8ac85c7bcc3f9d7c0ae5a6fa379607.zip |
Clean up the conversion routines
Functions returning `Root<T>` are prefixed by "root_" and the ones returning
`*const T` by "native_".
Functions taking `*mut JSObject` are now suffixed by "_from_object" and the ones
taking `&T` by "_from_reflector".
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r-- | components/script/dom/window.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 4da6bd76645..c7f0af1b234 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -12,8 +12,7 @@ use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::codegen::Bindings::WindowBinding::{ScrollBehavior, ScrollToOptions}; use dom::bindings::codegen::Bindings::WindowBinding::{self, FrameRequestCallback, WindowMethods}; use dom::bindings::error::{Error, Fallible, report_pending_exception}; -use dom::bindings::global::GlobalRef; -use dom::bindings::global::global_object_for_js_object; +use dom::bindings::global::{GlobalRef, global_root_from_reflector}; use dom::bindings::inheritance::Castable; use dom::bindings::js::RootedReference; use dom::bindings::js::{JS, MutNullableHeap, Root}; @@ -766,8 +765,7 @@ impl<'a, T: Reflectable> ScriptHelpers for &'a T { #[allow(unsafe_code)] fn evaluate_script_on_global_with_result(self, code: &str, filename: &str, rval: MutableHandleValue) { - let this = self.reflector().get_jsobject(); - let global = global_object_for_js_object(this.get()); + let global = global_root_from_reflector(self); let cx = global.r().get_cx(); let _ar = JSAutoRequest::new(cx); let globalhandle = global.r().reflector().get_jsobject(); |