Hi,
I'm getting errors when evaluating PAC script.
Caused by: jdk.nashorn.internal.runtime.ParserException: :8:2 Expected an operand but found else
else return "PROXY proxy:3128";
^
at jdk.nashorn.internal.parser.AbstractParser.error(AbstractParser.java:294)
at jdk.nashorn.internal.parser.AbstractParser.error(AbstractParser.java:279)
It's caused by semicolons before else , nashorn scripting engine doesn't like that.
` function FindProxyForURL(url, host)
{
if (shExpMatch(host, "deploy.abc.eu") ||
shExpMatch(host, "asp.abc.eu")
)
return "PROXY proxy:3128";
else if (dnsDomainIs(host, "localhost") ||
dnsDomainIs(host, "127.0.0.1"))
return "DIRECT";
else
return "PROXY proxy:3128";
}`
Rhino scripting engine ( https://mvnrepository.com/artifact/org.mozilla/rhino/1.7.10 ) can evaluate this script correctly, what do you think about using it instead of nashorn ?
Hi,
I'm getting errors when evaluating PAC script.
Caused by: jdk.nashorn.internal.runtime.ParserException: :8:2 Expected an operand but found else
else return "PROXY proxy:3128";
^
at jdk.nashorn.internal.parser.AbstractParser.error(AbstractParser.java:294)
at jdk.nashorn.internal.parser.AbstractParser.error(AbstractParser.java:279)
It's caused by semicolons before else , nashorn scripting engine doesn't like that.
` function FindProxyForURL(url, host)
{
if (shExpMatch(host, "deploy.abc.eu") ||
shExpMatch(host, "asp.abc.eu")
)
Rhino scripting engine ( https://mvnrepository.com/artifact/org.mozilla/rhino/1.7.10 ) can evaluate this script correctly, what do you think about using it instead of nashorn ?