More regexp fixes for mozilla5 compatibility.
authorFlorian Quèze <florian@instantbird.org>
Wed, 06 Jul 2011 13:03:49 +0200
changeset 14627 79ad9743bfb5bf5f5d31f8cd010e8d2336103dcc
parent 14626 0ad8bc35a7e1f07247e283c0b4b73d0e6ff3cf09
child 14628 238a49b87b4e18ebf67eb3b0a9f452380603b907
push id9778
push userflorian@queze.net
push dateSun, 12 Jan 2014 18:25:45 +0000
treeherdercomm-central@f81a23bfefcd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
More regexp fixes for mozilla5 compatibility.
im/content/joinchat.js
purple/purplexpcom/src/imCommands.js
--- a/im/content/joinchat.js
+++ b/im/content/joinchat.js
@@ -73,17 +73,17 @@ var joinChat = {
       protoId == "prpl-irc" || protoId == "prpl-jabber" ||
       protoId == "prpl-gtalk";
 
     for (let field in getIter(acc.getChatRoomFields())) {
       let row = document.createElement("row");
 
       let label = document.createElement("label");
       let text = field.label;
-      let match = /_(.)/(text);
+      let match = /_(.)/.exec(text);
       if (match) {
         label.setAttribute("accesskey", match[1]);
         text = text.replace(/_/, "");
       }
       label.setAttribute("value", text);
       label.setAttribute("control", "field-" + field.identifier);
       row.appendChild(label);
 
--- a/purple/purplexpcom/src/imCommands.js
+++ b/purple/purplexpcom/src/imCommands.js
@@ -211,17 +211,17 @@ CommandsService.prototype = {
     return cmdArray.sort(function(a, b) b.priority - a.priority);
   },
   executeCommand: function (aMessage, aConversation) {
     if (!aMessage)
       throw Cr.NS_ERROR_INVALID_ARG;
 
     let matchResult;
     if (aMessage[0] != "/" ||
-        !(matchResult = /^\/([a-z]+)(?: |$)([\s\S]*)/(aMessage)))
+        !(matchResult = /^\/([a-z]+)(?: |$)([\s\S]*)/.exec(aMessage)))
       return false;
 
     let [, name, args] = matchResult;
 
     let cmdArray = this._findCommands(aConversation, name);
     if (!cmdArray.length)
       return false;