2003/06/16 07:58:57
[org.ibex.core.git] / src / org / xwt / Proxy.java
index 6067464..0f86f33 100644 (file)
@@ -114,15 +114,15 @@ public class Proxy {
                 if (Log.on) Log.log(Proxy.class, script);
             }
 
-           JS.Callable scr = JS.parse("PAC script at " + url, 0, new StringReader(script), proxyAutoConfigRootScope);
-            scr.call(new org.xwt.js.Array());
+           JS.CompiledFunction scr = JS.parse("PAC script at " + url, 0, new StringReader(script));
+            scr.call(new JS.Array(), proxyAutoConfigRootScope);
             return (JS.Callable)proxyAutoConfigRootScope.get("FindProxyForURL");
         } catch (Exception e) {
             if (Log.on) {
                 Log.log(Platform.class, "WPAD detection failed due to:");
                 if (e instanceof JS.Exn) {
                    try {
-                       org.xwt.js.Array arr = new org.xwt.js.Array();
+                       org.xwt.js.JS.Array arr = new org.xwt.js.JS.Array();
                        arr.addElement(((JS.Exn)e).getObject());
                        // FIXME
                        //XWT.recursivePrintObject.call();
@@ -202,19 +202,19 @@ public class Proxy {
             };
         
         private static final JS.Callable isPlainHostName = new JS.Callable() {
-                public Object call(org.xwt.js.Array args) throws JS.Exn {
+                public Object call(org.xwt.js.JS.Array args) throws JS.Exn {
                     return (args.elementAt(0).toString().indexOf('.') == -1) ? Boolean.TRUE : Boolean.FALSE;
                 }
             };
         
         private static final JS.Callable dnsDomainIs = new JS.Callable() {
-                public Object call(org.xwt.js.Array args) throws JS.Exn {
+                public Object call(org.xwt.js.JS.Array args) throws JS.Exn {
                     return (args.elementAt(0).toString().endsWith(args.elementAt(1).toString())) ? Boolean.TRUE : Boolean.FALSE;
                 }
             };
         
         private static final JS.Callable localHostOrDomainIs = new JS.Callable() {
-                public Object call(org.xwt.js.Array args) throws JS.Exn {
+                public Object call(org.xwt.js.JS.Array args) throws JS.Exn {
                     return (args.elementAt(0).toString().equals(args.elementAt(1).toString()) || 
                             (args.elementAt(0).toString().indexOf('.') == -1 && args.elementAt(1).toString().startsWith(args.elementAt(0).toString()))) ?
                         Boolean.TRUE : Boolean.FALSE;
@@ -222,7 +222,7 @@ public class Proxy {
             };
         
         private static final JS.Callable isResolvable = new JS.Callable() {
-                public Object call(org.xwt.js.Array args) throws JS.Exn {
+                public Object call(org.xwt.js.JS.Array args) throws JS.Exn {
                     try {
                         return (InetAddress.getByName(args.elementAt(0).toString()) != null) ? Boolean.TRUE : Boolean.FALSE;
                     } catch (UnknownHostException e) {
@@ -232,7 +232,7 @@ public class Proxy {
             };
         
         private static final JS.Callable isInNet = new JS.Callable() {
-                public Object call(org.xwt.js.Array args) throws JS.Exn {
+                public Object call(org.xwt.js.JS.Array args) throws JS.Exn {
                     if (args.length() != 3) return Boolean.FALSE;
                     try {
                         byte[] host = InetAddress.getByName(args.elementAt(0).toString()).getAddress();
@@ -250,7 +250,7 @@ public class Proxy {
             };
         
         private static final JS.Callable dnsResolve = new JS.Callable() {
-                public Object call(org.xwt.js.Array args) throws JS.Exn {
+                public Object call(org.xwt.js.JS.Array args) throws JS.Exn {
                     try {
                         return InetAddress.getByName(args.elementAt(0).toString()).getHostAddress();
                     } catch (UnknownHostException e) {
@@ -260,7 +260,7 @@ public class Proxy {
             };
         
         private static final JS.Callable myIpAddress = new JS.Callable() {
-                public Object call(org.xwt.js.Array args) throws JS.Exn {
+                public Object call(org.xwt.js.JS.Array args) throws JS.Exn {
                     try {
                         return InetAddress.getLocalHost().getHostAddress();
                     } catch (UnknownHostException e) {
@@ -271,7 +271,7 @@ public class Proxy {
             };
         
         private static final JS.Callable dnsDomainLevels = new JS.Callable() {
-                public Object call(org.xwt.js.Array args) throws JS.Exn {
+                public Object call(org.xwt.js.JS.Array args) throws JS.Exn {
                     String s = args.elementAt(0).toString();
                     int i = 0;
                     while((i = s.indexOf('.', i)) != -1) i++;
@@ -289,7 +289,7 @@ public class Proxy {
         }
         
         private static final JS.Callable shExpMatch = new JS.Callable() {
-                public Object call(org.xwt.js.Array args) throws JS.Exn {
+                public Object call(org.xwt.js.JS.Array args) throws JS.Exn {
                     StringTokenizer st = new StringTokenizer(args.elementAt(1).toString(), "*", false);
                     String[] arr = new String[st.countTokens()];
                     String s = args.elementAt(0).toString();
@@ -301,7 +301,7 @@ public class Proxy {
         public static String[] days = { "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" };
         
         private static final JS.Callable weekdayRange = new JS.Callable() {
-                public Object call(org.xwt.js.Array args) throws JS.Exn {
+                public Object call(org.xwt.js.JS.Array args) throws JS.Exn {
                     TimeZone tz = (args.length() < 3 || args.elementAt(2) == null || !args.elementAt(2).equals("GMT")) ? TimeZone.getTimeZone("UTC") : TimeZone.getDefault();
                     Calendar c = new GregorianCalendar();
                     c.setTimeZone(tz);
@@ -327,13 +327,13 @@ public class Proxy {
             };
         
         private static final JS.Callable dateRange = new JS.Callable() {
-                public Object call(org.xwt.js.Array args) throws JS.Exn {
+                public Object call(org.xwt.js.JS.Array args) throws JS.Exn {
                     throw new JS.Exn("XWT does not support dateRange() in PAC scripts");
                 }
             };
         
         private static final JS.Callable timeRange = new JS.Callable() {
-                public Object call(org.xwt.js.Array args) throws JS.Exn {
+                public Object call(org.xwt.js.JS.Array args) throws JS.Exn {
                     throw new JS.Exn("XWT does not support timeRange() in PAC scripts");
                 }
             };