mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Return the empty string as appropriate for location.{search,hash}.
This commit is contained in:
parent
e8d89ca464
commit
d853db2c69
1 changed files with 3 additions and 1 deletions
|
@ -43,6 +43,7 @@ impl<'a> LocationMethods for JSRef<'a, Location> {
|
|||
fn Search(&self) -> DOMString {
|
||||
match self.page.get_url().query {
|
||||
None => "".to_string(),
|
||||
Some(ref query) if query.as_slice() == "" => "".to_string(),
|
||||
Some(ref query) => "?".to_string().append(query.as_slice())
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +51,8 @@ impl<'a> LocationMethods for JSRef<'a, Location> {
|
|||
fn Hash(&self) -> DOMString {
|
||||
match self.page.get_url().fragment {
|
||||
None => "".to_string(),
|
||||
Some(ref query) => "#".to_string().append(query.as_slice())
|
||||
Some(ref hash) if hash.as_slice() == "" => "".to_string(),
|
||||
Some(ref hash) => "#".to_string().append(hash.as_slice())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue