Introduce GlobalScope::get_url

This commit is contained in:
Anthony Ramine 2016-10-02 14:29:01 +02:00
parent 092504b4e3
commit f38159b7d3
10 changed files with 39 additions and 39 deletions

View file

@ -52,14 +52,15 @@ impl EventSource {
pub fn Constructor(global: GlobalRef,
url_str: DOMString,
event_source_init: &EventSourceInit) -> Fallible<Root<EventSource>> {
let global_scope = global.as_global_scope();
// Steps 1-2
let base_url = global.get_url();
let base_url = global_scope.get_url();
let url = match base_url.join(&*url_str) {
Ok(u) => u,
Err(_) => return Err(Error::Syntax)
};
// Step 3
let event_source = EventSource::new(global.as_global_scope(), url, event_source_init.withCredentials);
let event_source = EventSource::new(global_scope, url, event_source_init.withCredentials);
// Step 4
// Step 5
// Step 6