mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 17:27:57 +01:00
always specify the radix arg when calling parseInt rather than rely on it
'guessing' correctly
This commit is contained in:
@@ -402,7 +402,7 @@ vimperator.Buffer = function() //{{{
|
||||
|
||||
var match;
|
||||
if (match = buffer.match(/^(\d+):?/))
|
||||
return vimperator.tabs.select(parseInt(match[1]) - 1, false); // make it zero-based
|
||||
return vimperator.tabs.select(parseInt(match[1], 10) - 1, false); // make it zero-based
|
||||
|
||||
var matches = [];
|
||||
var lower_buffer = buffer.toLowerCase();
|
||||
|
||||
@@ -207,7 +207,7 @@ vimperator.Commands = function() //{{{
|
||||
|
||||
// parse count
|
||||
if (matches[0])
|
||||
matches[0] = parseInt(matches[0]);
|
||||
matches[0] = parseInt(matches[0], 10);
|
||||
else
|
||||
matches[0] = -1;
|
||||
|
||||
@@ -1301,7 +1301,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
else if (type == "number")
|
||||
{
|
||||
var num = parseInt(val, 10);
|
||||
var num = parseInt(val);
|
||||
if (isNaN(num))
|
||||
vimperator.echoerr("E521: Number required after =: " + option.name + "=" + val);
|
||||
else
|
||||
@@ -1483,7 +1483,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
else if (/^\d+$/.test(args))
|
||||
{
|
||||
var index = parseInt(args) - 1;
|
||||
var index = parseInt(args, 10) - 1;
|
||||
if (index < vimperator.tabs.count())
|
||||
vimperator.tabs.select(index, true);
|
||||
else
|
||||
|
||||
@@ -67,9 +67,9 @@ vimperator.Tabs = function() //{{{
|
||||
else
|
||||
{
|
||||
if (spec.match(/^([+-]\d+)$/)) // relative position +/-N
|
||||
position += parseInt(spec);
|
||||
position += parseInt(spec, 10);
|
||||
else // absolute position
|
||||
position = parseInt(spec);
|
||||
position = parseInt(spec, 10);
|
||||
}
|
||||
|
||||
if (position > last)
|
||||
|
||||
@@ -708,7 +708,7 @@ vimperator.CommandLine = function() //{{{
|
||||
case "<LeftMouse>":
|
||||
if (event.originalTarget.className == "hl-URL buffer-list")
|
||||
{
|
||||
vimperator.tabs.select(parseInt(event.originalTarget.parentNode.parentNode.firstChild.textContent) - 1);
|
||||
vimperator.tabs.select(parseInt(event.originalTarget.parentNode.parentNode.firstChild.textContent, 10) - 1);
|
||||
close_window = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ const vimperator = (function() //{{{
|
||||
// Number
|
||||
else if (match = string.match(/^(\d+)$/))
|
||||
{
|
||||
return parseInt(match[1]);
|
||||
return parseInt(match[1], 10);
|
||||
}
|
||||
|
||||
var reference = this.variableReference(string);
|
||||
|
||||
Reference in New Issue
Block a user