From 40a89f9f9305a9ccbd1a440ecc6e8463798d8697 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Sat, 25 Sep 2010 18:42:50 +0200 Subject: Make jslint more happy. --- lib/bzpage.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/bzpage.js b/lib/bzpage.js index 5a1751a..537a3f6 100644 --- a/lib/bzpage.js +++ b/lib/bzpage.js @@ -490,8 +490,12 @@ BZPage.prototype.createNewButton = function createNewButton (location, after, pk originalLocation.parentNode.insertBefore(this.doc .createTextNode("\u00A0"), originalLocation); } - } catch (e if e instanceof TypeError) { - console.error("cannot find originalLocation element with id " + location); + } catch (e) { + if (e instanceof TypeError) { + console.error("cannot find originalLocation element with id " + location); + } else { + throw e; + } } }; @@ -573,7 +577,7 @@ BZPage.prototype.parseMailto = function parseMailto(aElement) { // if (emailStr === undefined) { var params = util.getParamsFromURL("https://" + this.hostname + "/" + hrefStr); - emailStr = decodeURI(params['login']); + emailStr = decodeURI(params.login); } return emailStr; } @@ -668,7 +672,7 @@ BZPage.prototype.selectOptionByLabel = function selectOptionByLabel(id, label, f var sel = this.doc.getElementById(id); var labelRE = new RegExp(label.trim()); var ourOption = Array.filter(sel.options, function (op) { - return op.textContent.trim() == label; + return op.textContent.trim() === label; }, this); if (ourOption[0]) { -- cgit