Browse Source

[js] type js.Browser.getLocalStorage return value as Null<Storage>

Dan Korostelev 5 years ago
parent
commit
bf9f750b80
1 changed files with 2 additions and 2 deletions
  1. 2 2
      std/js/Browser.hx

+ 2 - 2
std/js/Browser.hx

@@ -72,7 +72,7 @@ class Browser {
 	public static var supported(get, never):Bool;
 	public static var supported(get, never):Bool;
 
 
 	static function get_supported()
 	static function get_supported()
-		return 
+		return
 			js.Syntax.typeof(window) != "undefined" &&
 			js.Syntax.typeof(window) != "undefined" &&
 			js.Syntax.typeof(window.location) != "undefined" &&
 			js.Syntax.typeof(window.location) != "undefined" &&
 			js.Syntax.typeof(window.location.protocol) == "string";
 			js.Syntax.typeof(window.location.protocol) == "string";
@@ -80,7 +80,7 @@ class Browser {
 	 * Safely gets the browser's local storage, or returns null if localStorage is unsupported or
 	 * Safely gets the browser's local storage, or returns null if localStorage is unsupported or
 	 * disabled.
 	 * disabled.
 	 */
 	 */
-	public static function getLocalStorage():Storage {
+	public static function getLocalStorage():Null<Storage> {
 		try {
 		try {
 			var s = window.localStorage;
 			var s = window.localStorage;
 			s.getItem("");
 			s.getItem("");