* Do not allow constructor property to be defined as constant on HopObjects,

as we need the constructor to be resettable in Helma with Rhino 1.7.
This commit is contained in:
hns 2007-11-07 13:46:57 +00:00
parent 12423bb9a7
commit d896e79aeb

View file

@ -111,6 +111,23 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
return className;
}
/**
* Overwritten to not define constructor property as constant -
* we need to have the constructor property resettable in Helma.
* @param propertyName the property name
* @param value the proeprty value
* @param attributes the property attributs
*/
public void defineProperty(String propertyName, Object value,
int attributes)
{
if ("constructor".equals(propertyName))
put(propertyName, this, value);
else
super.defineProperty(propertyName, value, attributes);
}
/**
* Return a primitive representation for this object.
* FIXME: We always return a string representation.