Search in sources :

Example 1 with BigIntConstructor

use of com.github.anba.es6draft.runtime.objects.bigint.BigIntConstructor in project es6draft by anba.

the class Realm method initializeBigIntModule.

/**
 * <h1>Extension: BigInt</h1>
 *
 * @param realm
 *            the realm instance
 */
private static void initializeBigIntModule(Realm realm) {
    EnumMap<Intrinsics, OrdinaryObject> intrinsics = realm.intrinsics;
    // allocation phase
    BigIntConstructor bigIntConstructor = new BigIntConstructor(realm);
    BigIntPrototype bigIntPrototype = new BigIntPrototype(realm);
    TypedArrayConstructor int64ArrayConstructor = new TypedArrayConstructor(realm, ElementType.BigInt64);
    TypedArrayPrototype int64ArrayPrototype = new TypedArrayPrototype(realm, ElementType.BigInt64);
    TypedArrayConstructor uint64ArrayConstructor = new TypedArrayConstructor(realm, ElementType.BigUint64);
    TypedArrayPrototype uint64ArrayPrototype = new TypedArrayPrototype(realm, ElementType.BigUint64);
    // registration phase
    intrinsics.put(Intrinsics.BigInt, bigIntConstructor);
    intrinsics.put(Intrinsics.BigIntPrototype, bigIntPrototype);
    intrinsics.put(Intrinsics.BigInt64Array, int64ArrayConstructor);
    intrinsics.put(Intrinsics.BigInt64ArrayPrototype, int64ArrayPrototype);
    intrinsics.put(Intrinsics.BigUint64Array, uint64ArrayConstructor);
    intrinsics.put(Intrinsics.BigUint64ArrayPrototype, uint64ArrayPrototype);
    // initialization phase
    bigIntConstructor.initialize(realm);
    bigIntPrototype.initialize(realm);
    int64ArrayConstructor.initialize(realm);
    int64ArrayPrototype.initialize(realm);
    uint64ArrayConstructor.initialize(realm);
    uint64ArrayPrototype.initialize(realm);
}
Also used : TypedArrayPrototype(com.github.anba.es6draft.runtime.objects.binary.TypedArrayPrototype) BigIntPrototype(com.github.anba.es6draft.runtime.objects.bigint.BigIntPrototype) TypedArrayConstructor(com.github.anba.es6draft.runtime.objects.binary.TypedArrayConstructor) Intrinsics(com.github.anba.es6draft.runtime.types.Intrinsics) BigIntConstructor(com.github.anba.es6draft.runtime.objects.bigint.BigIntConstructor) OrdinaryObject(com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject)

Aggregations

BigIntConstructor (com.github.anba.es6draft.runtime.objects.bigint.BigIntConstructor)1 BigIntPrototype (com.github.anba.es6draft.runtime.objects.bigint.BigIntPrototype)1 TypedArrayConstructor (com.github.anba.es6draft.runtime.objects.binary.TypedArrayConstructor)1 TypedArrayPrototype (com.github.anba.es6draft.runtime.objects.binary.TypedArrayPrototype)1 Intrinsics (com.github.anba.es6draft.runtime.types.Intrinsics)1 OrdinaryObject (com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject)1