aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/location.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/location.rs')
-rw-r--r--components/script/dom/location.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/components/script/dom/location.rs b/components/script/dom/location.rs
index 550af503d53..ba835ada146 100644
--- a/components/script/dom/location.rs
+++ b/components/script/dom/location.rs
@@ -4,6 +4,7 @@
use dom::bindings::codegen::Bindings::LocationBinding;
use dom::bindings::codegen::Bindings::LocationBinding::LocationMethods;
+use dom::bindings::error::{Error, ErrorResult};
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, Root};
use dom::bindings::reflector::{Reflector, reflect_dom_object};
@@ -46,12 +47,15 @@ impl Location {
impl LocationMethods for Location {
// https://html.spec.whatwg.org/multipage/#dom-location-assign
- fn Assign(&self, url: USVString) {
+ fn Assign(&self, url: USVString) -> ErrorResult {
// TODO: per spec, we should use the _API base URL_ specified by the
// _entry settings object_.
let base_url = self.window.get_url();
if let Ok(url) = base_url.join(&url.0) {
self.window.load_url(url, false, None);
+ Ok(())
+ } else {
+ Err(Error::Syntax)
}
}