2003/06/16 07:58:57
[org.ibex.core.git] / src / org / xwt / Template.java
index 63a9daa..4ac78db 100644 (file)
@@ -73,10 +73,10 @@ public class Template {
     private boolean changed = false;
 
     /** the script on the static node of this template, null if it has already been executed */
-    private CompiledFunction staticscript = null;
+    private JS.CompiledFunction staticscript = null;
 
     /** the script on this node */
-    private CompiledFunction script = null;
+    private JS.CompiledFunction script = null;
 
     /** during XML parsing, this holds the list of currently-parsed children; null otherwise */
     private Vec childvect = new Vec();
@@ -206,9 +206,7 @@ public class Template {
         if (redirect != null && !"self".equals(redirect)) redir = (Box)b.get("$" + redirect);
 
         if (script != null) try {
-            script.cloneWithNewParentScope(b).call(new Array());
-        } catch (IOException e) {
-           throw new Error("this should never happen");
+            script.call(new JS.Array(), b);
         } catch (JS.Exn e) {
             if (Log.on) Log.log(this, "WARNING: uncaught ecmascript exception: " + e.getMessage());
         }
@@ -240,7 +238,7 @@ public class Template {
 
         if (callback != null)
             try {
-               Array args = new Array();
+               JS.Array args = new JS.Array();
                args.addElement(new Double(numerator));
                args.addElement(new Double(denominator));
                 callback.call(args);
@@ -286,7 +284,7 @@ public class Template {
 
         if (callback != null)
             try {
-               Array args = new Array();
+               JS.Array args = new JS.Array();
                args.addElement(new Double(1.0));
                args.addElement(new Double(1.0));
                 callback.call(args);
@@ -365,7 +363,7 @@ public class Template {
         if (staticscript != null) try { 
             JS.Scope s = Static.createStatic(nodeName, false);
             if (staticscript != null) {
-                CompiledFunction temp = staticscript;
+                JS.CompiledFunction temp = staticscript;
                 staticscript = null;
 
                // we layer a transparent scope over the Static so that we can catch requests for the xwt object
@@ -376,10 +374,8 @@ public class Template {
                            if ("xwt".equals(key)) return XWT.singleton; else return super.get(key);
                        } };
 
-               temp.cloneWithNewParentScope(varScope).call(null);
+               temp.call(new JS.Array(), varScope);
             }
-        } catch (IOException e) {
-           throw new Error("this should never happen");
         } catch (JS.Exn e) {
             if (Log.on) Log.log(this, "WARNING: uncaught ecmascript exception: " + e.getMessage());
         }
@@ -654,10 +650,10 @@ public class Template {
             }
         }
 
-        private CompiledFunction genscript(boolean isstatic) {
-            CompiledFunction thisscript = null;
+        private JS.CompiledFunction genscript(boolean isstatic) {
+            JS.CompiledFunction thisscript = null;
             try {
-                thisscript = JS.parse(t.nodeName + (isstatic ? "._" : ""), t.content_start, new StringReader(t.content.toString()), null);
+                thisscript = JS.parse(t.nodeName + (isstatic ? "._" : ""), t.content_start, new StringReader(t.content.toString()));
             } catch (JS.Exn ee) {
                 if (Log.on) Log.log(this, "  ERROR: " + ee.getMessage());
                 thisscript = null;