* Make sure we do not remove HopObject constructors if they aren't referenced during

global code compilation anymore. Fixes bug 464 <http://helma.org/bugs/show_bug.cgi?id=464>
This commit is contained in:
hns 2006-06-19 18:58:38 +00:00
parent 6a96d0c7a0
commit 83dd1e7c1f

View file

@ -903,10 +903,16 @@ public final class RhinoCore implements ScopeProvider {
// renewed in this compilation // renewed in this compilation
compiledProperties.removeAll(changedProperties); compiledProperties.removeAll(changedProperties);
boolean isGlobal = "global".equals(frameworkProto.getLowerCaseName());
Iterator it = compiledProperties.iterator(); Iterator it = compiledProperties.iterator();
while (it.hasNext()) { while (it.hasNext()) {
String key = (String) it.next(); String key = (String) it.next();
if (isGlobal && prototypes.containsKey(key.toLowerCase())) {
// avoid removing HopObject constructor
predefinedProperties.add(key);
continue;
}
try { try {
objProto.setAttributes(key, 0); objProto.setAttributes(key, 0);
objProto.delete(key); objProto.delete(key);