From e03e40ff13fdde7b350e54bbbf771941fac5a19e Mon Sep 17 00:00:00 2001 From: Shane Tomlinson <stomlinson@mozilla.com> Date: Tue, 1 May 2012 14:00:10 +0100 Subject: [PATCH] Fix the global variable introduced and other JSHint errors. issue #1521 --- resources/static/shared/storage.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/resources/static/shared/storage.js b/resources/static/shared/storage.js index 48c9785b0..2233ea73c 100644 --- a/resources/static/shared/storage.js +++ b/resources/static/shared/storage.js @@ -3,12 +3,14 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ BrowserID.Storage = (function() { + "use strict"; var jwk, - ONE_DAY_IN_MS = (1000 * 60 * 60 * 24); + ONE_DAY_IN_MS = (1000 * 60 * 60 * 24), + storage; try { - var storage = localStorage; + storage = localStorage; } catch(e) { // Fx with cookies disabled will except while trying to access @@ -224,7 +226,7 @@ BrowserID.Storage = (function() { if (lastState !== currentState) { callback(); lastState = currentState; - }; + } } // IE8 does not have addEventListener, nor does it support storage events. @@ -362,7 +364,7 @@ BrowserID.Storage = (function() { function clearUsersComputerOwnershipStatus(userid) { try { - allInfo = JSON.parse(storage.usersComputer); + var allInfo = JSON.parse(storage.usersComputer); if (typeof allInfo !== 'object') throw 'bogus'; var userInfo = allInfo[userid]; -- GitLab