use of com.github.anba.es6draft.runtime.objects.reflect.RealmConstructor 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);
}
Aggregations