2003/06/13 04:19:28
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:01:05 +0000 (07:01 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:01:05 +0000 (07:01 +0000)
darcs-hash:20040130070105-2ba56-fc858a943985d99db30b05c99f98a5bf95387a93.gz

src/org/xwt/Box.java

index c53ccc4..c01cdde 100644 (file)
@@ -1062,7 +1062,7 @@ public final class Box extends JS.Scope {
     public Object get(int i) {
         if (redirect == null) return null;
         if (redirect != this) return redirect.get(i);
-        return i >= numChildren() ? null : getChild(i);
+        return i >= numChildren() || i < 0 ? null : getChild(i);
     }
 
     /**
@@ -1072,6 +1072,7 @@ public final class Box extends JS.Scope {
      *  WARNING: O(n) runtime, unless i == numChildren()
      */
     public void put(int i, Object value) {
+       if (i < 0) return;
 
         if (value != null && !(value instanceof Box)) {
             if (Log.on) Log.log(this, "attempt to set a numerical property on a box to anything other than a box at " + Context.getCurrentSourceNameAndLine());