use of com.github.anba.es6draft.runtime.objects.reflect.SystemObject 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.getRuntimeContext().isEnabled(CompatibilityOption.Realm) || realm.getRuntimeContext().isEnabled(CompatibilityOption.FrozenRealm)) {
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.getRuntimeContext().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.getRuntimeContext().isEnabled(CompatibilityOption.WeakReference)) {
WeakRefPrototype weakReferencePrototype = new WeakRefPrototype(realm);
intrinsics.put(Intrinsics.WeakRefPrototype, weakReferencePrototype);
weakReferencePrototype.initialize(realm);
}
if (realm.getRuntimeContext().isEnabled(CompatibilityOption.System) || realm.getRuntimeContext().isEnabled(CompatibilityOption.SystemGlobal) || realm.getRuntimeContext().isEnabled(CompatibilityOption.WeakReference) || realm.getRuntimeContext().isEnabled(CompatibilityOption.ErrorStacks)) {
SystemObject systemObject = new SystemObject(realm);
intrinsics.put(Intrinsics.System, systemObject);
systemObject.initialize(realm);
}
reflect.initialize(realm);
}
Aggregations