From 3cb7a162ad55d2fa284c38f447b5e2bc456ca40f Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Sun, 23 Jun 2013 00:08:17 +0200 Subject: [PATCH] Changed typeof(var) === "undefined" to var === undefined. This is a little shorter and easier to read. --- src/hints.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hints.js b/src/hints.js index 8a3466b..5ef5578 100644 --- a/src/hints.js +++ b/src/hints.js @@ -22,7 +22,7 @@ function VimbHints(mode, usage, bg, bgf, fg, style, maxHints) { /* document may be undefined for frames out of the same origin */ /* policy and will break the whole code - so we check this before */ - if (typeof(win.document) === 'undefined') { + if (win.document === undefined) { return; } var doc = win.document; @@ -124,7 +124,7 @@ function VimbHints(mode, usage, bg, bgf, fg, style, maxHints) { var i = _getHintIdByNum(focusNum); - if (typeof(hints[i + 1]) !== "undefined") { + if (hints[i + 1] !== undefined) { return _focus(hints[i + 1].num); } return _focus(hints[0].num); @@ -134,7 +134,7 @@ function VimbHints(mode, usage, bg, bgf, fg, style, maxHints) this.focusPrev = function() { var i = _getHintIdByNum(focusNum); - if (i !== 0 && typeof(hints[i - 1].num) !== "undefined") { + if (i !== 0 && hints[i - 1].num !== undefined) { return _focus(hints[i - 1].num); } return _focus(hints[hints.length - 1].num); @@ -325,7 +325,7 @@ function VimbHints(mode, usage, bg, bgf, fg, style, maxHints) function _getXpath(s) { var x, l; - if (typeof(s) === "undefined") { + if (s === undefined) { s = ""; } switch (mode) { -- 2.20.1