Syntax error missing : after property id

809 views
Skip to first unread message

Nick Carrington

unread,
Jul 14, 2008, 5:52:55 AM7/14/08
to pactester
I'm testing a little pac file I made to switch proxies between the
company one (when I'm on the company network) or none, when I'm at
home. The browsers seem to be working, but pactester refuses to read
my file. I get:

c:\>pactester -u http://www.google.com -p c:\windows\myautoconfig.pac
JSERROR: c:\windows\myautoconfig.pac:3:
SyntaxError: missing : after property id
Could not parse pac file: c:\windows\myautoconfig.pac

My file looks like this (company name and ip address altered):

function FindProxyForURL(url, host) {
if (isInNet(myIpAddress(), "x.y.0.0", "255.255.0.0"))
{return "PROXY someproxy.mycompany.com";} else return {"DIRECT";}
}

What's wrong with my file, and why won't pactester parse it? I assume
the :3: in the error message refers to the line in the script, but I
can't see anything wrong there.

Thanks

Nick

Casey Deccio

unread,
Jul 14, 2008, 11:07:56 AM7/14/08
to pact...@googlegroups.com
On Mon, Jul 14, 2008 at 2:52 AM, Nick Carrington <nick.ca...@gmail.com> wrote:
My file looks like this (company name and ip address altered):

function FindProxyForURL(url, host) {
       if (isInNet(myIpAddress(), "x.y.0.0", "255.255.0.0"))
               {return "PROXY someproxy.mycompany.com";} else return {"DIRECT";}
}

Looks like you need to move your braces (around return):


function FindProxyForURL(url, host) {
       if (isInNet(myIpAddress(), "x.y.0.0", "255.255.0.0"))
               {return "PROXY someproxy.mycompany.com";} else { return "DIRECT";}
}

Regards,
Casey

Nick Carrington

unread,
Jul 14, 2008, 6:25:31 PM7/14/08
to pactester
Thanks Casey. That was indeed the problem. I spotted it once I looked
more closely. The perils of stealing code from the internet ... :)

Nick

On Jul 14, 4:07 pm, "Casey Deccio" <ca...@deccio.net> wrote:
> On Mon, Jul 14, 2008 at 2:52 AM, Nick Carrington <nick.carring...@gmail.com>
Reply all
Reply to author
Forward
0 new messages