* Set parent scope to shared global for static HopObject functions.

Fixes http://helma.org/bugs/show_bug.cgi?id=507
This commit is contained in:
hns 2007-04-17 21:38:20 +00:00
parent fdce5dc09e
commit cb03565e33

View file

@ -118,6 +118,15 @@ public class HopObjectCtor extends FunctionObject {
return super.get(name, start);
}
public void put(String name, Scriptable start, Object value) {
if (value instanceof Function) {
// reset static function's parent scope, needed because of the way we compile
// prototype code, using the prototype objects as scope
((Function) value).setParentScope(core.global);
}
super.put(name, start, value);
}
class GetById extends BaseFunction {
/**