Bug 646509 - Proxy autoconfig shouldn't try to call regular expressions but rather should use .exec(). rs=js-pit
authorJeff Walden <jwalden@mit.edu>
Fri, 08 Apr 2011 11:45:11 -0700
changeset 67673 272a7b90280dd5771684342f73f6c6e23893f90d
parent 67672 4f957dd3f9f79e175d7cb78faaf59a4e74fc10bd
child 67674 ce528cff2f8f96bba6a3df8ef3897bab32395989
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjs-pit
bugs646509
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 646509 - Proxy autoconfig shouldn't try to call regular expressions but rather should use .exec(). rs=js-pit
netwerk/base/src/nsProxyAutoConfig.js
--- a/netwerk/base/src/nsProxyAutoConfig.js
+++ b/netwerk/base/src/nsProxyAutoConfig.js
@@ -147,17 +147,17 @@ var pacUtils =
 "    var result = ((bytes[0] & 0xff) << 24) |\n"+
 "                 ((bytes[1] & 0xff) << 16) |\n"+
 "                 ((bytes[2] & 0xff) <<  8) |\n"+
 "                  (bytes[3] & 0xff);\n"+
 "    return result;\n"+
 "}\n"+
 
 "function isInNet(ipaddr, pattern, maskstr) {\n"+
-"    var test = /^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/(ipaddr);\n"+
+"    var test = /^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/.exec(ipaddr);\n"+
 "    if (test == null) {\n"+
 "        ipaddr = dnsResolve(ipaddr);\n"+
 "        if (ipaddr == null)\n"+
 "            return false;\n"+
 "    } else if (test[1] > 255 || test[2] > 255 || \n"+
 "               test[3] > 255 || test[4] > 255) {\n"+
 "        return false;    // not an IP address\n"+
 "    }\n"+