diff --git a/content/buffers.js b/content/buffers.js index b541af67..38f74cee 100644 --- a/content/buffers.js +++ b/content/buffers.js @@ -448,7 +448,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(); diff --git a/content/commands.js b/content/commands.js index 0670079c..24e25edb 100644 --- a/content/commands.js +++ b/content/commands.js @@ -363,7 +363,7 @@ vimperator.Commands = function() //{{{ } break; case OPTION_INT: - arg = parseInt(arg); + arg = parseInt(arg, 10); if (isNaN(arg)) { vimperator.echoerr("Numeric argument required for integer option: " + optname); @@ -499,7 +499,7 @@ vimperator.Commands = function() //{{{ // parse count if (matches[0]) - matches[0] = parseInt(matches[0]); + matches[0] = parseInt(matches[0], 10); else matches[0] = -1; @@ -1812,7 +1812,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 @@ -2150,14 +2150,14 @@ vimperator.Commands = function() //{{{ } else if (/^\d+$/.test(args)) { - level = parseInt(args); + level = parseInt(args, 10); } else if (/^[+-]\d+$/.test(args)) { if (special) - level = vimperator.buffer.fullZoom + parseInt(args); + level = vimperator.buffer.fullZoom + parseInt(args, 10); else - level = vimperator.buffer.textZoom + parseInt(args); + level = vimperator.buffer.textZoom + parseInt(args, 10); // relative args shouldn't take us out of range if (level < 1) diff --git a/content/tabs.js b/content/tabs.js index 220523d3..33e38fb4 100644 --- a/content/tabs.js +++ b/content/tabs.js @@ -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) diff --git a/content/ui.js b/content/ui.js index 336daade..ebe91ffb 100644 --- a/content/ui.js +++ b/content/ui.js @@ -699,7 +699,7 @@ vimperator.CommandLine = function() //{{{ case "": 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; } diff --git a/content/vimperator.js b/content/vimperator.js index fc3c265d..59343aaa 100644 --- a/content/vimperator.js +++ b/content/vimperator.js @@ -195,7 +195,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);