X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FBox.java;h=f04c3c2bc07b8d4453723565bf550f7289433f9b;hb=a5badea1a13725a5ab1294c9b2e6ac9ea8be82c1;hp=30ec605227850e02e9bbbf7327d54e45023b0d43;hpb=63506fabf6112011cce9d0e615142512c7359317;p=org.ibex.core.git diff --git a/src/org/xwt/Box.java b/src/org/xwt/Box.java index 30ec605..f04c3c2 100644 --- a/src/org/xwt/Box.java +++ b/src/org/xwt/Box.java @@ -1163,6 +1163,7 @@ public final class Box extends JS.Scope { public Object get(Object name_, boolean ignoretraps) { if (name_ instanceof Number) return get(((Number)name_).intValue()); + if (!(name_ instanceof String)) return null; String name = (String)name_; if (name.equals("")) return null; @@ -1182,7 +1183,7 @@ public final class Box extends JS.Scope { SpecialBoxProperty gph = (SpecialBoxProperty)SpecialBoxProperty.specialBoxProperties.get(name); if (gph != null) return gph.get(this); - Object ret = super.get((Object)name); + Object ret = super.get(name); if (name.startsWith("$") && ret == null) if (Log.on) Log.logJS(this, "WARNING: attempt to access " + name + ", but no child with id=\"" + name.substring(1) + "\" found"); return ret; @@ -1203,7 +1204,8 @@ public final class Box extends JS.Scope { public void put(Object name, Object value, boolean ignoretraps) { put(name, value, ignoretraps, null); } public void put(Object name_, Object value, boolean ignoretraps, RootProxy rp) { if (name_ instanceof Number) { put(((Number)name_).intValue(), value); return; } - String name = (String)name_; + if (!(name_ instanceof String)) { super.put(name_,value); return; } + String name = name_.toString(); if (name == null) return; // FIXME, shouldn't be necessary if (name.startsWith("xwt_")) { if (Log.on) Log.logJS(this, "attempt to set reserved property " + name); @@ -1249,7 +1251,7 @@ public final class Box extends JS.Scope { return; } - super.put((Object)name, value); + super.put(name, value); // a bit of a hack, since titlebar is the only 'special' property stored in JSObject if (getParent() == null && surface != null) { @@ -1416,6 +1418,9 @@ public final class Box extends JS.Scope { public Object get(Object name) { return box.get(name); } public void put(Object name, Object value) { box.put(name, value, false, this); } public Object[] keys() { return box.keys(); } + public Object callMethod(Object method, JS.Array args, boolean justChecking) { + return box.callMethod(method,args,justChecking); + } } @@ -1501,7 +1506,11 @@ public final class Box extends JS.Scope { return this; } + // This is the name returned by typeof() by JS + public String typeName() { + return "box"; + } + } -