private Template t = null;
public Object parentkey = null;
public Blessing parent = null;
+ private Hash cache = new Hash();
public Blessing(JS.Cloneable clonee, Ibex ibex, Blessing parent, Object parentkey) {
super(clonee); this.ibex = ibex; this.parentkey = parentkey; this.parent = parent; }
public Object get(Object key) throws JSExn {
- return key.equals("") ? ((Object)getStatic()) : (new Blessing((JS.Cloneable)clonee.get(key), ibex, this, key));
+ if (key.equals("")) return ((Object)getStatic());
+ if (cache.get(key) != null) return cache.get(key);
+ Object ret = new Blessing((JS.Cloneable)clonee.get(key), ibex, this, key);
+ cache.put(key, ret);
+ return ret;
}
public static Blessing getBlessing(Object o) {
if (!(o instanceof JS)) return null;
}
public JSScope getStatic() {
try {
- // FIXME background?
- System.out.println("parentkey.t == " + parentkey + ".t");
- if (t == null)
- t = Template.buildTemplate(parentkey + ".t", parent.get(parentkey + ".t"), ibex);
+ if (t == null) t = Template.buildTemplate(parentkey + ".t", parent.get(parentkey + ".t"), ibex);
return t.staticScope;
} catch (Exception e) {
Log.error(this, e);