From d896e79aeb1719ab2b7f53e6e1e6bb6a416de342 Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 7 Nov 2007 13:46:57 +0000 Subject: [PATCH] * 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. --- src/helma/scripting/rhino/HopObject.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/helma/scripting/rhino/HopObject.java b/src/helma/scripting/rhino/HopObject.java index b250d23a..42dbd598 100644 --- a/src/helma/scripting/rhino/HopObject.java +++ b/src/helma/scripting/rhino/HopObject.java @@ -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.