Make reflect_dom_object take a &GlobalScope

This commit is contained in:
Anthony Ramine 2016-09-27 13:16:41 +02:00
parent 093b189b48
commit fcb59d3057
132 changed files with 488 additions and 407 deletions

View file

@ -12,6 +12,7 @@ use dom::bindings::js::Root;
use dom::bindings::reflector::{Reflector, reflect_dom_object};
use dom::bindings::str::{DOMString, USVString};
use dom::bindings::weakref::MutableWeakRef;
use dom::globalscope::GlobalScope;
use dom::url::URL;
use encoding::types::EncodingRef;
use url::form_urlencoded;
@ -35,7 +36,7 @@ impl URLSearchParams {
}
}
pub fn new(global: GlobalRef, url: Option<&URL>) -> Root<URLSearchParams> {
pub fn new(global: &GlobalScope, url: Option<&URL>) -> Root<URLSearchParams> {
reflect_dom_object(box URLSearchParams::new_inherited(url), global,
URLSearchParamsBinding::Wrap)
}
@ -44,7 +45,7 @@ impl URLSearchParams {
pub fn Constructor(global: GlobalRef, init: Option<USVStringOrURLSearchParams>) ->
Fallible<Root<URLSearchParams>> {
// Step 1.
let query = URLSearchParams::new(global, None);
let query = URLSearchParams::new(global.as_global_scope(), None);
match init {
Some(USVStringOrURLSearchParams::USVString(init)) => {
// Step 2.