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;
}
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;
}
* @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();
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);
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);
}