Fix delete() to call super.delete() and handling of subnodeRelation property

to call the subnodeRelation methods on the wrapped node.
This commit is contained in:
hns 2003-07-15 16:17:10 +00:00
parent b6fb19c935
commit 28c6810fb0

View file

@ -460,6 +460,11 @@ public class HopObject extends ScriptableObject {
if (node == null) { if (node == null) {
super.put(name, start, value); super.put(name, start, value);
} else { } else {
if ("subnodeRelation".equals(name)) {
node.setSubnodeRelation(value == null ? null : value.toString());
}
if (value instanceof NativeJavaObject) { if (value instanceof NativeJavaObject) {
value = ((NativeJavaObject) value).unwrap(); value = ((NativeJavaObject) value).unwrap();
} }
@ -528,6 +533,7 @@ public class HopObject extends ScriptableObject {
* @param name ... * @param name ...
*/ */
public void delete(String name) { public void delete(String name) {
super.delete(name);
if ((node != null)) { if ((node != null)) {
node.unset(name); node.unset(name);
} }
@ -563,6 +569,10 @@ public class HopObject extends ScriptableObject {
return getInternalProperty(name); return getInternalProperty(name);
} }
if ("subnodeRelation".equals(name)) {
return node.getSubnodeRelation();
}
IProperty p = node.get(name); IProperty p = node.get(name);
if (p != null) { if (p != null) {