X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FBox.java;h=2adac175272d9f7f9daf6b848d3a695cc5736578;hb=c087a8da3dc056d869ae757dabba8cd36b7cc4fb;hp=ebd3d8592dbe6c0717ca4add374691621445bda9;hpb=3da47c535468eb52df828f9625b636978312bd07;p=org.ibex.core.git diff --git a/src/org/xwt/Box.java b/src/org/xwt/Box.java index ebd3d85..2adac17 100644 --- a/src/org/xwt/Box.java +++ b/src/org/xwt/Box.java @@ -364,7 +364,7 @@ public final class Box extends JSScope { public Enumeration keys() { throw new Error("you cannot apply for..in to a " + this.getClass().getName()); } protected boolean isTrappable() { return true; } - public Object get(Object name) { + public Object get(Object name) throws JSExn { if (name instanceof Number) return redirect == null ? null : redirect == this ? getChild(toInt(name)) : redirect.get(name); @@ -412,7 +412,7 @@ public final class Box extends JSScope { throw new Error("unreachable"); // unreachable } - public void put(Object name, Object value) { + public void put(Object name, Object value) throws JSExn { if (name instanceof Number) { put(toInt(name), value); return; } //#switch(name) case "text": CHECKSET_STRING(text); MARK_RESIZE; dirty(); @@ -670,7 +670,7 @@ public final class Box extends JSScope { putAndTriggerTraps("childremoved", b); } - public void put(int i, Object value) { + public void put(int i, Object value) throws JSExn { if (i < 0) return; if (value != null && !(value instanceof Box)) { @@ -727,6 +727,25 @@ public final class Box extends JSScope { } } + + public final void putAndTriggerTraps(Object key, Object value) { + try { + super.putAndTriggerTraps(key, value); + } catch (JSExn jse) { + Log.logJS("attempt to put value " + value + " to key " + key + " on a box triggered a trap which threw:"); + Log.logJS(jse); + } + } + + public final Object getAndTriggerTraps(Object key) { + try { + return super.getAndTriggerTraps(key); + } catch (JSExn jse) { + Log.logJS("attempt to get key " + key + " on a box triggered a trap which threw:"); + Log.logJS(jse); + return null; + } + } }