diff options
Diffstat (limited to 'lib/bzpage.js')
-rw-r--r-- | lib/bzpage.js | 12 |
1 files 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]) { |