From: Timo Tijhof Date: Thu, 15 Jun 2017 20:25:45 +0000 (+0100) Subject: mediawiki.storage: Document 'null' return from get() X-Git-Tag: 1.31.0-rc.0~2962 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=d18df9bf58365ba7e4723058145fb9704c4c432f;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 {