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;
|
Application app;
|
||||||
RhinoCore core;
|
RhinoCore core;
|
||||||
|
|
||||||
|
|
|
@ -88,10 +88,12 @@ public final class RhinoCore {
|
||||||
context.setOptimizationLevel(optLevel);
|
context.setOptimizationLevel(optLevel);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
DynamicGlobalObject g = new DynamicGlobalObject(this, app);
|
// create global object
|
||||||
g.init();
|
global = new DynamicGlobalObject(this, app);
|
||||||
|
global.init();
|
||||||
global = (DynamicGlobalObject) context.initStandardObjects(g);
|
// call the initStandardsObject in ImporterTopLevel so that
|
||||||
|
// importClass() and importPackage() are set up.
|
||||||
|
global.initStandardObjects(context, false);
|
||||||
|
|
||||||
pathProto = new PathWrapper(this);
|
pathProto = new PathWrapper(this);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue