Bug 646444 - bug 582717 make regular expressions not callable [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Wed, 30 Mar 2011 18:50:01 +0200
changeset 2950 bba3e2c500dfa3dca5e3b9c0bca704b854a80ba2
parent 2949 d853ebaf4533eeb4408edd678081229894f9def1
child 2951 3f9373ef450e77a723bc681e343e8e01f0136ae3
push id2487
push uservnicolas@mozilla.com
push dateWed, 30 Mar 2011 16:50:54 +0000
reviewersmfinkle
bugs646444, 582717
Bug 646444 - bug 582717 make regular expressions not callable [r=mfinkle]
chrome/content/bindings/browser.xml
--- a/chrome/content/bindings/browser.xml
+++ b/chrome/content/bindings/browser.xml
@@ -172,20 +172,20 @@
                   (docURI.schemeIs("http") || docURI.schemeIs("https")));
         ]]></body>
       </method>
 
       <method name="_getLinkType">
         <parameter name="aLink" />
         <body><![CDATA[
           let type = "";
-          if (/\bicon\b/i(aLink.rel)) {
+          if (/\bicon\b/i.test(aLink.rel)) {
             type = "icon";
           }
-          else if (/\bsearch\b/i(aLink.rel) && aLink.type && aLink.title) {
+          else if (/\bsearch\b/i.test(aLink.rel) && aLink.type && aLink.title) {
             let linkType = aLink.type.replace(/^\s+|\s*(?:;.*)?$/g, "").toLowerCase();
             if (linkType == "application/opensearchdescription+xml" && /^(?:https?|ftp):/i.test(aLink.href)) {
               type = "search";
             }
           }
 
           return type;
         ]]></body>