mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 18:27:57 +01:00
prefer comparison with the undefined literal rather than using typeof and
comparing against "undefined"
This commit is contained in:
@@ -1506,7 +1506,7 @@ function set(args, special)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var no = true; if (matches[1] == undefined) no = false;
|
var no = true; if (matches[1] === undefined) no = false;
|
||||||
var opt = matches[2];
|
var opt = matches[2];
|
||||||
var option = get_option(opt);
|
var option = get_option(opt);
|
||||||
if (!option)
|
if (!option)
|
||||||
@@ -1516,10 +1516,10 @@ function set(args, special)
|
|||||||
}
|
}
|
||||||
|
|
||||||
var get = false; if (matches[3] == "?" ||
|
var get = false; if (matches[3] == "?" ||
|
||||||
(option[TYPE] != 'boolean' && matches[4] == undefined)) get = true;
|
(option[TYPE] != 'boolean' && matches[4] === undefined)) get = true;
|
||||||
var reset = false; if (matches[3] == "&") reset = true;
|
var reset = false; if (matches[3] == "&") reset = true;
|
||||||
var oper = matches[5];
|
var oper = matches[5];
|
||||||
var val = matches[6]; if (val == undefined) val = "";
|
var val = matches[6]; if (val === undefined) val = "";
|
||||||
|
|
||||||
// reset a variable to its default value.
|
// reset a variable to its default value.
|
||||||
if (reset)
|
if (reset)
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ function Vimperator() //{{{1
|
|||||||
if (typeof(extended) === "number")
|
if (typeof(extended) === "number")
|
||||||
extended_mode = extended;
|
extended_mode = extended;
|
||||||
|
|
||||||
if (typeof(silent) == "undefined" || !silent)
|
if (!silent)
|
||||||
showMode();
|
showMode();
|
||||||
}
|
}
|
||||||
// returns true if "whichmode" is found in either the main or
|
// returns true if "whichmode" is found in either the main or
|
||||||
@@ -739,7 +739,7 @@ function Tabs() //{{{1
|
|||||||
var length = getBrowser().mTabs.length;
|
var length = getBrowser().mTabs.length;
|
||||||
var last = length - 1;
|
var last = length - 1;
|
||||||
|
|
||||||
if (typeof(spec) === "undefined" || spec === "")
|
if (spec === undefined || spec === "")
|
||||||
return position;
|
return position;
|
||||||
|
|
||||||
if (typeof(spec) === "number")
|
if (typeof(spec) === "number")
|
||||||
|
|||||||
Reference in New Issue
Block a user