コード例 #1
0
ファイル: JavaAdapter.java プロジェクト: sq001/aurora-project
 public static void init(Context cx, Scriptable scope, boolean sealed) {
   JavaAdapter obj = new JavaAdapter();
   IdFunctionObject ctor =
       new IdFunctionObject(obj, FTAG, Id_JavaAdapter, "JavaAdapter", 1, scope);
   ctor.markAsConstructor(null);
   if (sealed) {
     ctor.sealObject();
   }
   ctor.exportAsScopeProperty();
 }
コード例 #2
0
  public final IdFunctionObject exportAsJSClass(
      int maxPrototypeId, Scriptable scope, boolean sealed) {
    // Set scope and prototype unless this is top level scope itself
    if (scope != this && scope != null) {
      setParentScope(scope);
      setPrototype(getObjectPrototype(scope));
    }

    activatePrototypeMap(maxPrototypeId);
    IdFunctionObject ctor = prototypeValues.createPrecachedConstructor();
    if (sealed) {
      sealObject();
    }
    fillConstructorProperties(ctor);
    if (sealed) {
      ctor.sealObject();
    }
    ctor.exportAsScopeProperty();
    return ctor;
  }