X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fxwt%2FTemplate.java;h=4cbf5e46a745777fc2007085fa82b9cdf1f07cb1;hp=79de777bb6a1fe8abb7c2c5c1e62db646720d786;hb=a060cc5025b58e8d3e319aefa6ae44fe7c6182ad;hpb=c087a8da3dc056d869ae757dabba8cd36b7cc4fb diff --git a/src/org/xwt/Template.java b/src/org/xwt/Template.java index 79de777..4cbf5e4 100644 --- a/src/org/xwt/Template.java +++ b/src/org/xwt/Template.java @@ -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); }