Search in sources :

Example 1 with LoaderConstructor

use of com.github.anba.es6draft.runtime.objects.reflect.LoaderConstructor in project es6draft by anba.

the class Realm method initializeReflectModule.

/**
     * <h1>26 Reflection</h1>
     * 
     * @param realm
     *            the realm instance
     */
private static void initializeReflectModule(Realm realm) {
    EnumMap<Intrinsics, OrdinaryObject> intrinsics = realm.intrinsics;
    // allocation phase
    ProxyConstructor proxy = new ProxyConstructor(realm);
    ReflectObject reflect = new ReflectObject(realm);
    // registration phase
    intrinsics.put(Intrinsics.Proxy, proxy);
    intrinsics.put(Intrinsics.Reflect, reflect);
    // initialization phase
    proxy.initialize(realm);
    if (realm.isEnabled(CompatibilityOption.Realm)) {
        RealmConstructor realmConstructor = new RealmConstructor(realm);
        RealmPrototype realmPrototype = new RealmPrototype(realm);
        intrinsics.put(Intrinsics.Realm, realmConstructor);
        intrinsics.put(Intrinsics.RealmPrototype, realmPrototype);
        realmConstructor.initialize(realm);
        realmPrototype.initialize(realm);
    }
    if (realm.isEnabled(CompatibilityOption.Loader)) {
        LoaderConstructor loaderConstructor = new LoaderConstructor(realm);
        LoaderPrototype loaderPrototype = new LoaderPrototype(realm);
        intrinsics.put(Intrinsics.Loader, loaderConstructor);
        intrinsics.put(Intrinsics.LoaderPrototype, loaderPrototype);
        loaderConstructor.initialize(realm);
        loaderPrototype.initialize(realm);
    }
    if (realm.isEnabled(CompatibilityOption.System) || realm.isEnabled(CompatibilityOption.SystemGlobal)) {
        SystemObject systemObject = new SystemObject(realm);
        intrinsics.put(Intrinsics.System, systemObject);
        systemObject.initialize(realm);
    }
    reflect.initialize(realm);
}
Also used : RealmConstructor(com.github.anba.es6draft.runtime.objects.reflect.RealmConstructor) Intrinsics(com.github.anba.es6draft.runtime.types.Intrinsics) OrdinaryObject(com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject) LoaderPrototype(com.github.anba.es6draft.runtime.objects.reflect.LoaderPrototype) ReflectObject(com.github.anba.es6draft.runtime.objects.reflect.ReflectObject) SystemObject(com.github.anba.es6draft.runtime.objects.reflect.SystemObject) LoaderConstructor(com.github.anba.es6draft.runtime.objects.reflect.LoaderConstructor) RealmPrototype(com.github.anba.es6draft.runtime.objects.reflect.RealmPrototype) ProxyConstructor(com.github.anba.es6draft.runtime.objects.reflect.ProxyConstructor)

Aggregations

LoaderConstructor (com.github.anba.es6draft.runtime.objects.reflect.LoaderConstructor)1 LoaderPrototype (com.github.anba.es6draft.runtime.objects.reflect.LoaderPrototype)1 ProxyConstructor (com.github.anba.es6draft.runtime.objects.reflect.ProxyConstructor)1 RealmConstructor (com.github.anba.es6draft.runtime.objects.reflect.RealmConstructor)1 RealmPrototype (com.github.anba.es6draft.runtime.objects.reflect.RealmPrototype)1 ReflectObject (com.github.anba.es6draft.runtime.objects.reflect.ReflectObject)1 SystemObject (com.github.anba.es6draft.runtime.objects.reflect.SystemObject)1 Intrinsics (com.github.anba.es6draft.runtime.types.Intrinsics)1 OrdinaryObject (com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject)1