Make GlobalObject extend Rhino's ImporterTopLevel so we have

the importClass() and importPackage() functions.
This commit is contained in:
hns 2004-02-10 12:46:17 +00:00
parent 81d0a86897
commit 736df12ef5
2 changed files with 7 additions and 5 deletions

View file

@ -37,7 +37,7 @@ import java.io.*;
/**
*
*/
public class GlobalObject extends ScriptableObject {
public class GlobalObject extends ImporterTopLevel {
Application app;
RhinoCore core;

View file

@ -88,10 +88,12 @@ public final class RhinoCore {
context.setOptimizationLevel(optLevel);
try {
DynamicGlobalObject g = new DynamicGlobalObject(this, app);
g.init();
global = (DynamicGlobalObject) context.initStandardObjects(g);
// create global object
global = new DynamicGlobalObject(this, app);
global.init();
// call the initStandardsObject in ImporterTopLevel so that
// importClass() and importPackage() are set up.
global.initStandardObjects(context, false);
pathProto = new PathWrapper(this);