2003/11/17 01:53:25
[org.ibex.core.git] / src / org / xwt / Template.java
index 4cd3851..bd57bf9 100644 (file)
@@ -62,7 +62,7 @@ public class Template {
             new TemplateHelper().parseit(r.getInputStream(), r.t);
             return r.t;
         } catch (Exception e) {
-            if (Log.on) Log.log(r.t.fileName, e);
+            if (Log.on) Log.log(r.t == null ? "null" : r.t.fileName, e);
             return null;
         }
     }
@@ -70,7 +70,8 @@ public class Template {
     public static Res resolveStringToResource(String str, XWT xwt, boolean permitAbsolute) {
         // URL
         if (str.indexOf("://") != -1) {
-            if (permitAbsolute) return Res.fromString(str);
+            // FIXME
+            //if (permitAbsolute) return Res.fromString(str);
             Log.log(Template.class, "absolute URL " + str + " not permitted here");
             return null;
         }
@@ -97,7 +98,7 @@ public class Template {
         if (staticscript == null) return staticJSScope;
         JSFunction temp = staticscript;
         staticscript = null;
-        temp.cloneWithNewParentJSScope(staticJSScope).call(new JSArray());
+        temp.cloneWithNewParentJSScope(staticJSScope).call(null, null, null, null, 0);
         return staticJSScope;
     }
     
@@ -121,10 +122,10 @@ public class Template {
         for (int i=0; children != null && i<children.size(); i++) {
             Box kid = new BoxTree();
             ((Template)children.elementAt(i)).apply(kid, xwt, pis);
-            b.putAndTriggerJSTraps(JSObj.N(b.numchildren), kid);
+            b.putAndTriggerJSTraps(JS.N(b.numchildren), kid);
         }
 
-        if (script != null) script.cloneWithNewParentJSScope(pis).call(new JSArray());
+        if (script != null) script.cloneWithNewParentJSScope(pis).call(null, null, null, null, 0);
 
         for(int i=0; keys != null && i<keys.length; i++)
             if (vals[i] instanceof String && ((String)vals[i]).charAt(0) == '$') b.putAndTriggerJSTraps(keys[i], pis.get(vals[i]));