Make GlobalObject extend Rhino's ImporterTopLevel so we have
the importClass() and importPackage() functions.
This commit is contained in:
parent
81d0a86897
commit
736df12ef5
2 changed files with 7 additions and 5 deletions
|
@ -37,7 +37,7 @@ import java.io.*;
|
|||
/**
|
||||
*
|
||||
*/
|
||||
public class GlobalObject extends ScriptableObject {
|
||||
public class GlobalObject extends ImporterTopLevel {
|
||||
Application app;
|
||||
RhinoCore core;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue