* 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:
parent
12423bb9a7
commit
d896e79aeb
1 changed files with 17 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue