diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-04 00:05:20 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-04 00:05:20 +0000 |
commit | c6ba2ce4faac672e685ee3ac3765c818cbe4dc90 (patch) | |
tree | ec9e7809c1816d0d558df905edd617a9b0887b94 /net/proxy | |
parent | eed9b070b545c0ae905cc8e5d32ff7c3a58b477c (diff) | |
download | chromium_src-c6ba2ce4faac672e685ee3ac3765c818cbe4dc90.zip chromium_src-c6ba2ce4faac672e685ee3ac3765c818cbe4dc90.tar.gz chromium_src-c6ba2ce4faac672e685ee3ac3765c818cbe4dc90.tar.bz2 |
Fix error being thrown in isInNet() PAC js.
Mozilla is using notation which treats regexp like a function:
var regex = /foo/;
var result = regex("str");
However v8 does not allow this (nor does IE), so we rewrite it in standard form:
var regex = /foo/;
var result = regex.exec("str")
Also finishes off the tests in pac_library_unittest.js. I didn't test every single permutation of dateRange() and timeRange() as there are way too many; but did hit most common flavors.
BUG=2764
Review URL: http://codereview.chromium.org/40006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10843 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy')
-rw-r--r-- | net/proxy/proxy_resolver_script.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/proxy/proxy_resolver_script.h b/net/proxy/proxy_resolver_script.h index ddcb66b..5b19924 100644 --- a/net/proxy/proxy_resolver_script.h +++ b/net/proxy/proxy_resolver_script.h @@ -49,6 +49,7 @@ // sed -e 's/^\s*$/""/g' | // sed -e 's/"\s*[+]\s*$/"/g' | // sed -e 's/"$/" \\/g' | +// sed -e 's/\/(ipaddr);/\/.exec(ipaddr);/g' | // grep -v '^var pacUtils =' #define PROXY_RESOLVER_SCRIPT \ "function dnsDomainIs(host, domain) {\n" \ @@ -70,7 +71,7 @@ "}\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" \ |