Call getNodeProperty() instead of getProperty() in NodeGet to avoid retrieving
prototype functions. Fixed skinpath conversion to Java array.
This commit is contained in:
parent
9dcf718733
commit
a19a01d19b
1 changed files with 19 additions and 7 deletions
|
@ -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.
|
||||||
|
|
Loading…
Add table
Reference in a new issue