* @param content the JavaScript content
* @param url the URL to be retrieved
* @return semicolon-separated result
*/
public static String evaluate(final String content, final URL url) {
final Context cx = ContextFactory.getGlobal().enterContext();
try {
final ProxyAutoConfig config = new ProxyAutoConfig();
final Scriptable scope = cx.initStandardObjects();
config.defineMethod("isPlainHostName", scope);
config.defineMethod("dnsDomainIs", scope);
config.defineMethod("localHostOrDomainIs", scope);
config.defineMethod("isResolvable", scope);
config.defineMethod("isInNet", scope);
config.defineMethod("dnsResolve", scope);
config.defineMethod("myIpAddress", scope);
config.defineMethod("dnsDomainLevels", scope);
config.defineMethod("shExpMatch", scope);
config.defineMethod("weekdayRange", scope);
config.defineMethod("dateRange", scope);
config.defineMethod("timeRange", scope);
cx.evaluateString(scope, "var ProxyConfig = function() {}; ProxyConfig.bindings = {}", "<init>", 1, null);
cx.evaluateString(scope, content, "<Proxy Auto-Config>", 1, null);
final Object functionArgs[] = {url.toExternalForm(), url.getHost()};
final Object fObj = scope.get("FindProxyForURL", scope);
final NativeFunction f = (NativeFunction) fObj;
final Object result = f.call(cx, scope, scope, functionArgs);