changes made after tupshins reconstruction
[org.ibex.core.git] / src / org / xwt / XWT.java
index d792776..e5c443f 100644 (file)
@@ -23,7 +23,9 @@ public final class XWT extends JS.Cloneable {
             throw new JSExn("absolute URL " + str + " not permitted here");
         }
         // root-relative
-        JS ret = (JS)getAndTriggerTraps("");
+        //JS ret = (JS)getAndTriggerTraps("");
+        //FIXME
+        JS ret = rr;
         while(str.indexOf('.') != -1) {
             String path = str.substring(0, str.indexOf('.'));
             str = str.substring(str.indexOf('.') + 1);
@@ -338,14 +340,16 @@ public final class XWT extends JS.Cloneable {
         public JSScope getStatic() {
             try {
                 // FIXME background?
-                if (t == null) t = new Template(Stream.getInputStream(parent.get(parentkey + ".xwt")), xwt);
-                return t.getStatic();
+                if (t == null) t = Template.buildTemplate(Stream.getInputStream(parent.get(parentkey + ".xwt")), xwt);
+                return t.staticScope;
             } catch (Exception e) {
                 Log.error(this, e);
                 return null;
             }
         }
         public Object call(Object a, Object b, Object c, Object[] rest, int nargs) throws JSExn {
+            // GROSS hack
+            if (nargs == 9999) return t;
             if (nargs != 1) throw new JSExn("FIXME can only call with one arg");
             getStatic();
             t.apply((Box)a);