From fbb1f33faba482cff7976ddb80fb3f8f1cdaa161 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 21 Dec 2008 22:01:13 +1100 Subject: Use the RegExp global function rather than calling the constructor. --- common/content/commands.js | 2 +- common/content/events.js | 4 ++-- common/content/util.js | 2 +- vimperator/content/bookmarks.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/content/commands.js b/common/content/commands.js index 6e7bd58e..d2682d54 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -176,7 +176,7 @@ Command.prototype = { let matches = args.match(/(.*)<<\s*(\S+)$/); if (matches && matches[2]) { - commandline.inputMultiline(new RegExp("^" + matches[2] + "$", "m"), + commandline.inputMultiline(RegExp("^" + matches[2] + "$", "m"), function (args) { exec(matches[1] + "\n" + args); }); return; } diff --git a/common/content/events.js b/common/content/events.js index ef0d429c..7c7d486d 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -817,13 +817,13 @@ function Events() //{{{ if (!filter) return macros; - let re = new RegExp(filter); + let re = RegExp(filter); return ([macro, keys] for ([macro, keys] in macros) if (re.test(macro))); }, deleteMacros: function (filter) { - let re = new RegExp(filter); + let re = RegExp(filter); for (let [item,] in macros) { diff --git a/common/content/util.js b/common/content/util.js index 475ff3c1..41b9d3f3 100644 --- a/common/content/util.js +++ b/common/content/util.js @@ -475,7 +475,7 @@ const util = { //{{{ // and returns an array ['www.google.com/search?q=bla', 'www.osnews.com'] stringToURLArray: function stringToURLArray(str) { - let urls = str.split(new RegExp("\s*" + options["urlseparator"] + "\s*")); + let urls = str.split(RegExp("\s*" + options["urlseparator"] + "\s*")); return urls.map(function (url) { try diff --git a/vimperator/content/bookmarks.js b/vimperator/content/bookmarks.js index 2335eebc..277b5ccd 100644 --- a/vimperator/content/bookmarks.js +++ b/vimperator/content/bookmarks.js @@ -1003,7 +1003,7 @@ function QuickMarks() //{{{ remove: function remove(filter) { - var pattern = new RegExp("[" + filter.replace(/\s+/g, "") + "]"); + var pattern = RegExp("[" + filter.replace(/\s+/g, "") + "]"); for (let [qmark,] in qmarks) { -- cgit v1.2.3