From c087a8da3dc056d869ae757dabba8cd36b7cc4fb Mon Sep 17 00:00:00 2001 From: megacz Date: Fri, 30 Jan 2004 07:42:18 +0000 Subject: [PATCH] 2003/11/29 03:06:08 darcs-hash:20040130074218-2ba56-4287acc3d049c2762eb4039b7326b4101ccb7506.gz --- src/org/xwt/Box.java | 25 ++++++++++++++++++++++--- src/org/xwt/Font.java | 15 ++++++++------- src/org/xwt/HTTP.java | 2 +- src/org/xwt/Main.java | 2 +- 4 files changed, 32 insertions(+), 12 deletions(-) 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; + } + } } diff --git a/src/org/xwt/Font.java b/src/org/xwt/Font.java index 0de8204..e14727f 100644 --- a/src/org/xwt/Font.java +++ b/src/org/xwt/Font.java @@ -71,13 +71,14 @@ public class Font { } } - if (encounteredUnrenderedGlyph && callback != null) Scheduler.add(new Scheduler.Task() { public void perform() { - for(int i=0; i