Skip to content

automatic configuration evaluation error #61

@bergmannm

Description

@bergmannm

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions