Skip to content

Commit 21d6bad

Browse files
authored
Merge pull request #761 from zetashift/fix/#746
Fixup Location#origin and Location#reload
2 parents b2034ed + f5baadf commit 21d6bad

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

api-reports/2_12.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -15709,11 +15709,11 @@ Location[JT] var hash: String
1570915709
Location[JT] var host: String
1571015710
Location[JT] var hostname: String
1571115711
Location[JT] var href: String
15712-
Location[JT] def origin: js.UndefOr[String]
15712+
Location[JT] def origin: String
1571315713
Location[JT] var pathname: String
1571415714
Location[JT] var port: String
1571515715
Location[JT] var protocol: String
15716-
Location[JT] def reload(flag: Boolean?): Unit
15716+
Location[JT] def reload(): Unit
1571715717
Location[JT] def replace(url: String): Unit
1571815718
Location[JT] var search: String
1571915719
MIMEType[JT]

api-reports/2_13.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -15709,11 +15709,11 @@ Location[JT] var hash: String
1570915709
Location[JT] var host: String
1571015710
Location[JT] var hostname: String
1571115711
Location[JT] var href: String
15712-
Location[JT] def origin: js.UndefOr[String]
15712+
Location[JT] def origin: String
1571315713
Location[JT] var pathname: String
1571415714
Location[JT] var port: String
1571515715
Location[JT] var protocol: String
15716-
Location[JT] def reload(flag: Boolean?): Unit
15716+
Location[JT] def reload(): Unit
1571715717
Location[JT] def replace(url: String): Unit
1571815718
Location[JT] var search: String
1571915719
MIMEType[JT]

dom/src/main/scala/org/scalajs/dom/Location.scala

+5-7
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,14 @@ trait Location extends js.Object {
4343
* URL, that is, for http and https, the scheme followed by '://', followed by the domain, followed by ':', followed
4444
* by the port (the default port, 80 and 443 respectively, if explicitly specified). For URL using file: scheme, the
4545
* value is browser dependant.
46-
*
47-
* This property also does not exist consistently on IE, even as new as IE11, hence it must be UndefOr.
4846
*/
49-
def origin: js.UndefOr[String] = js.native
47+
def origin: String = js.native
5048

51-
/** The Location.reload()method Reloads the resource from the current URL. Its optional unique parameter is a Boolean,
52-
* which, when it is true, causes the page to always be reloaded from the server. If it is false or not specified,
53-
* the browser may reload the page from its cache.
49+
/** Reloads the resource from the current URL, like the Refresh button. The reload may be blocked and a SECURITY_ERROR
50+
* DOMException thrown. This happens if the origin of the script calling location.reload() differs from the origin of
51+
* the page that owns the Location object.
5452
*/
55-
def reload(flag: Boolean = js.native): Unit = js.native
53+
def reload(): Unit = js.native
5654

5755
/** The Location.replace()method replaces the current resource with the one at the provided URL. The difference from
5856
* the assign() method is that after using replace() the current page will not be saved in session History, meaning

0 commit comments

Comments
 (0)