2003/06/16 07:58:56
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:01:11 +0000 (07:01 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:01:11 +0000 (07:01 +0000)
darcs-hash:20040130070111-2ba56-fe3251c82ce8db917d2ce9a5844fef387757cb63.gz

src/org/xwt/Box.java
src/org/xwt/ByteStream.java
src/org/xwt/HTTP.java
src/org/xwt/Main.java

index c1984c9..738d102 100644 (file)
@@ -100,7 +100,7 @@ public final class Box extends JS.Scope {
     static Hash imageToNameMap = new Hash();
 
     /** the empty object, used for get-traps */
-    private static Array emptyobj = new Array();
+    private static JS.Array emptyobj = new JS.Array();
 
 
     // Instance Data: Templates ////////////////////////////////////////////////////////
@@ -269,7 +269,7 @@ public final class Box extends JS.Scope {
     /** a trivial private class to serve as the box.indexof function object */
     private class IndexOf extends JS.Callable {
         public IndexOf() { this.setSeal(true); }
-        public Object call(Array args) throws JS.Exn {
+        public Object call(JS.Array args) throws JS.Exn {
             if (args.length() != 1 || args.elementAt(0) == null || !(args.elementAt(0) instanceof Box)) return new Integer(-1);
             Box b = (Box)args.elementAt(0);
             if (b.getParent() != Box.this) {
@@ -461,9 +461,9 @@ public final class Box extends JS.Scope {
                             if (clear && callback != null) {
                                 clear = false;
                                 ThreadMessage.newthread(new JS.Callable() {
-                                        public Object call(Array args_) throws JS.Exn {
+                                        public Object call(JS.Array args_) throws JS.Exn {
                                             try {
-                                               Array args = new Array();
+                                               JS.Array args = new JS.Array();
                                                args.addElement(new Double(bytesDownloaded));
                                                args.addElement(new Double(contentLength));
                                                callback.call(args);
@@ -1218,7 +1218,7 @@ public final class Box extends JS.Scope {
         if (!ignoretraps && traps != null) {
             Trap t = (Trap)traps.get(name);
             if (t != null) {
-                Array arg = new Array();
+                JS.Array arg = new JS.Array();
                arg.addElement(value);
                 t.perform(arg);
                 arg.setElementAt(null, 0);
@@ -1237,18 +1237,21 @@ public final class Box extends JS.Scope {
 
         if (name.charAt(0) == '_') {
             if (value != null && !(value instanceof JS.Callable)) {
-                if (Log.on) Log.log(this, "attempt to put a non-function value (" + value + ") to " +
+                if (Log.on) Log.log(this, "attempt to put a non function value (" + value + ") to " +
+                                   name + " at " + Context.getCurrentSourceNameAndLine());
+           } else if (value != null && !(value instanceof JS.CompiledFunction)) {
+                if (Log.on) Log.log(this, "attempt to put a non-compiled function value (" + value + ") to " +
                                    name + " at " + Context.getCurrentSourceNameAndLine());
             } else if (name.charAt(1) == '_') {
                 name = name.substring(2).intern();
                 Trap t = Trap.getTrap(this, name);
                 if (t != null) t.delete();
-                if (value != null) Trap.addTrap(this, name, ((CompiledFunction)value), true, rp);
+                if (value != null) Trap.addTrap(this, name, ((JS.CompiledFunction)value), true, rp);
             } else {
                 name = name.substring(1).intern();
                 Trap t = Trap.getTrap(this, name);
                 if (t != null) t.delete();
-                if (value != null) Trap.addTrap(this, name, ((CompiledFunction)value), false, rp);
+                if (value != null) Trap.addTrap(this, name, ((JS.CompiledFunction)value), false, rp);
             }
             return;
         }
index f1e6fcb..866b7ba 100644 (file)
@@ -102,14 +102,14 @@ public class ByteStream extends JS.Obj {
     }
 
     private final JS.Callable getDOM = new JS.Callable() {
-            public Object call(Array args) throws JS.Exn {
+            public Object call(JS.Array args) throws JS.Exn {
                 if (args.length() != 0) return null;
                 return new XMLHelper().doParse();
             }
         };
 
     private final JS.Callable getUTF = new JS.Callable() {
-            public Object call(Array args) throws JS.Exn {
+            public Object call(JS.Array args) throws JS.Exn {
                 if (args.length() != 0) return null;
                 try {
                     CharArrayWriter caw = new CharArrayWriter();
index d4d2249..3356c39 100644 (file)
@@ -179,7 +179,7 @@ public class HTTP {
         if (Platform.detectProxy() == null) throw new HTTPException("could not resolve hostname \"" + host + "\" and no proxy configured");
         if (Log.on) Log.log(this, "  could not resolve host " + host + "; using xmlrpc.xwt.org to ensure security");
         try {
-           Array args = new Array();
+           JS.Array args = new JS.Array();
            args.addElement(host);
             Object ret = new XMLRPC("http://xmlrpc.xwt.org/RPC2/", "dns.resolve").call(args);
             if (ret == null || !(ret instanceof String)) throw new Exception("    xmlrpc.xwt.org returned non-String: " + ret);
@@ -285,7 +285,7 @@ public class HTTP {
         if (Log.verbose) Log.log(this, "evaluating PAC script");
         String pac = null;
         try {
-           org.xwt.js.Array args = new org.xwt.js.Array();
+           org.xwt.js.JS.Array args = new org.xwt.js.JS.Array();
            args.addElement(url.toString());
            args.addElement(url.getHost());
             Object obj = pacFunc.call(args);
index fa86392..fdf15ec 100644 (file)
@@ -102,7 +102,7 @@ public class Main {
             if (Log.on) Log.log(Main.class, "instantiating " + initialTemplate);
             final String initialTemplate_f = initialTemplate;
             ThreadMessage.newthread(new JS.Callable() {
-                    public Object call(Array args) throws JS.Exn {
+                    public Object call(JS.Array args) throws JS.Exn {
                         new Box(initialTemplate_f, null);
                        doneInitializing = true;
                        if (Surface.allSurfaces.size() == 0) {