Search in sources :

Example 1 with LazilyLoadedCtor

use of org.mozilla.javascript.LazilyLoadedCtor in project scriptographer by scriptographer.

the class TopLevel method initStandardObjects.

public void initStandardObjects(Context cx, boolean sealed) {
    super.initStandardObjects(cx, sealed);
    for (int i = 0; i != topPackages.length; i += 2) new LazilyLoadedCtor(this, topPackages[i], topPackages[i + 1], false);
    // define some global functions and objects:
    String[] names = { "print", "evaluate" };
    defineFunctionProperties(names, TopLevel.class, ScriptableObject.DONTENUM);
    ScriptableObject objProto = (ScriptableObject) getObjectPrototype(this);
    objProto.defineFunctionProperties(new String[] { "dontEnum", "toJava", "print", "evaluate" }, TopLevel.class, DONTENUM);
}
Also used : ScriptableObject(org.mozilla.javascript.ScriptableObject) LazilyLoadedCtor(org.mozilla.javascript.LazilyLoadedCtor)

Aggregations

LazilyLoadedCtor (org.mozilla.javascript.LazilyLoadedCtor)1 ScriptableObject (org.mozilla.javascript.ScriptableObject)1