2003/11/29 03:06:09
[org.ibex.core.git] / src / org / xwt / Template.java
index 79de777..4cbf5e4 100644 (file)
@@ -70,7 +70,11 @@ public class Template {
     public static Res resolveStringToResource(String str, XWT xwt, boolean permitAbsolute) {
         // URL
         if (str.indexOf("://") != -1) {
-            if (permitAbsolute) return (Res)xwt.callMethod("res.url", str, null, null, null, 1);
+            try {
+                if (permitAbsolute) return (Res)xwt.callMethod("res.url", str, null, null, null, 1);
+            } catch (JSExn jse) {
+                throw new Error("this should never happen");
+            }
             Log.log(Template.class, "absolute URL " + str + " not permitted here");
             return null;
         }
@@ -102,7 +106,11 @@ public class Template {
         if (staticscript == null) return staticJSScope;
         JSFunction temp = staticscript;
         staticscript = null;
-        temp.cloneWithNewParentScope(staticJSScope).call(null, null, null, null, 0);
+        try {
+            temp.cloneWithNewParentScope(staticJSScope).call(null, null, null, null, 0);
+        } catch (JSExn jse) {
+            throw new Error("this should never happen");
+        }
         return staticJSScope;
     }
     
@@ -110,8 +118,8 @@ public class Template {
      *  @param pboxes a vector of all box parents on which to put $-references
      *  @param ptemplates a vector of the fileNames to recieve private references on the pboxes
      */
-    void apply(Box b, XWT xwt) { apply(b, xwt, null); }
-    void apply(Box b, XWT xwt, PerInstantiationJSScope parentPis) {
+    void apply(Box b, XWT xwt) throws JSExn { apply(b, xwt, null); }
+    void apply(Box b, XWT xwt, PerInstantiationJSScope parentPis) throws JSExn {
 
         getStatic();
 
@@ -357,7 +365,7 @@ public class Template {
         XWT xwt = null;
         PerInstantiationJSScope parentBoxPis = null;
         JSScope myStatic = null;
-        void putDollar(String key, Box target) {
+        void putDollar(String key, Box target) throws JSExn {
             if (parentBoxPis != null) parentBoxPis.putDollar(key, target);
             declare("$" + key);
             put("$" + key, target);
@@ -368,13 +376,13 @@ public class Template {
             this.xwt = xwt;
             this.myStatic = myStatic;
         }
-        public Object get(Object key) {
+        public Object get(Object key) throws JSExn {
             if (super.has(key)) return super.get(key);
             if (key.equals("xwt")) return xwt;
             if (key.equals("static")) return myStatic;
             return super.get(key);
         }
-        public void put(Object key, Object val) {
+        public void put(Object key, Object val) throws JSExn {
             if (super.has(key)) super.put(key, val);
             else super.put(key, val);
         }