fixed a bug that didn't let primitive values returned by a bean pass through

because of a classcastexception.
This commit is contained in:
stefanp 2002-07-31 15:57:25 +00:00
parent c5e1c05dfb
commit a4a0405241

View file

@ -32,6 +32,7 @@ public class ESBeanWrapper extends ESWrapper {
public ESValue getProperty(String propertyName, int hash) throws EcmaScriptException { public ESValue getProperty(String propertyName, int hash) throws EcmaScriptException {
try { try {
ESValue val = super.getProperty (propertyName, hash); ESValue val = super.getProperty (propertyName, hash);
if (val instanceof ESWrapper) {
Object theObject = ((ESWrapper)val).getJavaObject (); Object theObject = ((ESWrapper)val).getJavaObject ();
if (val instanceof ESWrapper && theObject instanceof INode) { if (val instanceof ESWrapper && theObject instanceof INode) {
return eval.getNodeWrapper ((INode) theObject); return eval.getNodeWrapper ((INode) theObject);
@ -40,9 +41,9 @@ public class ESBeanWrapper extends ESWrapper {
if (theObject instanceof SystemProperties && super.getJavaObject () instanceof ApplicationBean) if (theObject instanceof SystemProperties && super.getJavaObject () instanceof ApplicationBean)
wrapper.setReadonly(true); wrapper.setReadonly(true);
return wrapper; return wrapper;
} else {
return val;
} }
}
return val;
} catch (Exception rte) { } catch (Exception rte) {
return ESNull.theNull; return ESNull.theNull;
} }