use of com.github.anba.es6draft.runtime.objects.iteration.GeneratorPrototype in project es6draft by anba.
the class Realm method initializeIterationModule.
/**
* <h1>25 Control Abstraction Objects</h1>
*
* @param realm
* the realm instance
*/
private static void initializeIterationModule(Realm realm) {
EnumMap<Intrinsics, OrdinaryObject> intrinsics = realm.intrinsics;
// allocation phase
GeneratorFunctionConstructor generatorFunctionConstructor = new GeneratorFunctionConstructor(realm);
GeneratorPrototype generatorPrototype = new GeneratorPrototype(realm);
GeneratorFunctionPrototype generator = new GeneratorFunctionPrototype(realm);
// registration phase
intrinsics.put(Intrinsics.GeneratorFunction, generatorFunctionConstructor);
intrinsics.put(Intrinsics.GeneratorPrototype, generatorPrototype);
intrinsics.put(Intrinsics.Generator, generator);
// initialization phase
generatorFunctionConstructor.initialize(realm);
generatorPrototype.initialize(realm);
generator.initialize(realm);
if (realm.isEnabled(CompatibilityOption.LegacyGenerator)) {
OrdinaryObject legacyGeneratorPrototype = ObjectCreate(realm, Intrinsics.ObjectPrototype);
intrinsics.put(Intrinsics.LegacyGeneratorPrototype, legacyGeneratorPrototype);
}
}
Aggregations