Set parent scope rather than prototype for temporary global prototype.
This should solve the problems described in bug 390 where global functions were called on the temporary prototype in some cases.
This commit is contained in:
parent
35791bf5fb
commit
da007f9506
1 changed files with 5 additions and 2 deletions
|
@ -886,8 +886,11 @@ public final class RhinoCore {
|
|||
public void prepareCompilation() {
|
||||
if ("global".equals(frameworkProto.getLowerCaseName())) {
|
||||
tmpObjProto = new GlobalObject(RhinoCore.this, app);
|
||||
tmpObjProto.setPrototype(global);
|
||||
tmpObjProto.setParentScope(null);
|
||||
// setting the prototype to global does not seem to be the right
|
||||
// thing to do. that and not using a GlobalObject instance
|
||||
// as temporary object proto resulted in bug 390.
|
||||
tmpObjProto.setPrototype(null);
|
||||
tmpObjProto.setParentScope(global);
|
||||
} else {
|
||||
tmpObjProto = new HopObject(frameworkProto.getName());
|
||||
tmpObjProto.setPrototype(objProto);
|
||||
|
|
Loading…
Add table
Reference in a new issue