1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 22:57:58 +01:00

use RegExp#test in preference to String#match

This commit is contained in:
Doug Kearns
2007-11-16 12:48:03 +00:00
parent fea5cceecc
commit f50bca0453
9 changed files with 44 additions and 45 deletions

View File

@@ -57,7 +57,7 @@ vimperator.Tabs = function () //{{{
position = spec;
else if (spec === "$")
return last;
else if (!spec.match(/^([+-]?\d+|)$/))
else if (!/^([+-]?\d+|)$/.test(spec))
{
// TODO: move error reporting to ex-command?
vimperator.echoerr("E488: Trailing characters");
@@ -65,7 +65,7 @@ vimperator.Tabs = function () //{{{
}
else
{
if (spec.match(/^([+-]\d+)$/)) // relative position +/-N
if (/^([+-]\d+)$/.test(spec)) // relative position +/-N
position += parseInt(spec, 10);
else // absolute position
position = parseInt(spec, 10);