From d18df9bf58365ba7e4723058145fb9704c4c432f Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Thu, 15 Jun 2017 21:25:45 +0100 Subject: [PATCH] mediawiki.storage: Document 'null' return from get() Follows-up 7daab75414d. Forgot to document the full return scope of HTML Storage#get, which is 'string or null'. We may want to consider changing the 'false' return to 'null', so that the concept of "localStorage disabled" is entirely hidden behind the regular return values (null in case of #get). Change-Id: I6bed62457d2e64831ec8241e16f7e8c85c6531a4 --- resources/src/mediawiki/mediawiki.storage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/src/mediawiki/mediawiki.storage.js b/resources/src/mediawiki/mediawiki.storage.js index 95c77f8704..84e146a73f 100644 --- a/resources/src/mediawiki/mediawiki.storage.js +++ b/resources/src/mediawiki/mediawiki.storage.js @@ -32,7 +32,8 @@ * Retrieve value from device storage. * * @param {string} key Key of item to retrieve - * @return {string|boolean} False when localStorage not available, otherwise string + * @return {string|null|boolean} String value, null if no value exists, or false + * if localStorage is not available. */ SafeStorage.prototype.get = function ( key ) { try { -- 2.20.1