Call getNodeProperty() instead of getProperty() in NodeGet to avoid retrieving

prototype functions.

Fixed skinpath conversion to Java array.
This commit is contained in:
hns 2002-05-14 16:41:35 +00:00
parent 9dcf718733
commit a19a01d19b

View file

@ -198,7 +198,10 @@ public class HopExtension {
esv = thisObject.getProperty (i); esv = thisObject.getProperty (i);
} else { } else {
String name = arguments[0].toString (); String name = arguments[0].toString ();
esv = thisObject.getProperty (name, name.hashCode ()); // call esNodeProperty() method special to ESNode because we want to avoid
// retrieving prototype functions when calling hopobject.get().
ESNode esn = (ESNode) thisObject;
esv = esn.getNodeProperty (name);
} }
return (esv); return (esv);
} }
@ -581,12 +584,21 @@ public class HopExtension {
// if res.skinpath is set, transform it into an array of java objects // if res.skinpath is set, transform it into an array of java objects
// (strings for directory names and INodes for internal, db-stored skinsets) // (strings for directory names and INodes for internal, db-stored skinsets)
ResponseTrans res = fesi.getResponse(); ResponseTrans res = fesi.getResponse();
Object[] skinpath = new Object[0]; Object[] skinpath = res.getTranslatedSkinpath ();
if (res.skinpath != null && res.skinpath instanceof ArrayPrototype) { if (skinpath == null) {
ArrayPrototype array = (ArrayPrototype) res.skinpath; skinpath = new Object[0];
skinpath = new Object[array.size()]; Object rawSkinpath = res.getSkinpath ();
for (int i=0; i<skinpath.length; i++) if (rawSkinpath != null && rawSkinpath instanceof JSWrapper) {
skinpath[i] = array.getProperty(i).toJavaObject (); JSWrapper jsw = (JSWrapper) rawSkinpath;
ESObject eso = jsw.getESObject ();
if (eso instanceof ArrayPrototype) {
ArrayPrototype array = (ArrayPrototype) eso;
skinpath = new Object[array.size()];
for (int i=0; i<skinpath.length; i++)
skinpath[i] = array.getProperty(i).toJavaObject ();
}
}
res.setTranslatedSkinpath (skinpath);
} }
// ready... retrieve the skin and render it. // ready... retrieve the skin and render it.