* 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:
parent
fdce5dc09e
commit
cb03565e33
1 changed files with 9 additions and 0 deletions
|
@ -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 {
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue