Search in sources :

Example 1 with GeneratorFunctionPrototype

use of com.github.anba.es6draft.runtime.objects.iteration.GeneratorFunctionPrototype 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);
    }
}
Also used : AsyncGeneratorPrototype(com.github.anba.es6draft.runtime.objects.async.iteration.AsyncGeneratorPrototype) GeneratorPrototype(com.github.anba.es6draft.runtime.objects.iteration.GeneratorPrototype) AsyncGeneratorFunctionConstructor(com.github.anba.es6draft.runtime.objects.async.iteration.AsyncGeneratorFunctionConstructor) GeneratorFunctionConstructor(com.github.anba.es6draft.runtime.objects.iteration.GeneratorFunctionConstructor) Intrinsics(com.github.anba.es6draft.runtime.types.Intrinsics) OrdinaryObject(com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject) GeneratorFunctionPrototype(com.github.anba.es6draft.runtime.objects.iteration.GeneratorFunctionPrototype) AsyncGeneratorFunctionPrototype(com.github.anba.es6draft.runtime.objects.async.iteration.AsyncGeneratorFunctionPrototype)

Aggregations

AsyncGeneratorFunctionConstructor (com.github.anba.es6draft.runtime.objects.async.iteration.AsyncGeneratorFunctionConstructor)1 AsyncGeneratorFunctionPrototype (com.github.anba.es6draft.runtime.objects.async.iteration.AsyncGeneratorFunctionPrototype)1 AsyncGeneratorPrototype (com.github.anba.es6draft.runtime.objects.async.iteration.AsyncGeneratorPrototype)1 GeneratorFunctionConstructor (com.github.anba.es6draft.runtime.objects.iteration.GeneratorFunctionConstructor)1 GeneratorFunctionPrototype (com.github.anba.es6draft.runtime.objects.iteration.GeneratorFunctionPrototype)1 GeneratorPrototype (com.github.anba.es6draft.runtime.objects.iteration.GeneratorPrototype)1 Intrinsics (com.github.anba.es6draft.runtime.types.Intrinsics)1 OrdinaryObject (com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject)1