use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class Properties method createValue.
private static void createValue(Realm realm, OrdinaryObject target, ValueLayout layout) {
Object value = resolveValue(realm, layout.rawValue);
defineProperty(target, layout, valueProperty(layout, value));
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject 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);
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class Realm method initializeObservableModule.
/**
* <h1>Extension: Observable</h1>
*
* @param realm
* the realm instance
*/
private static void initializeObservableModule(Realm realm) {
EnumMap<Intrinsics, OrdinaryObject> intrinsics = realm.intrinsics;
// allocation phase
ObservableConstructor observableConstructor = new ObservableConstructor(realm);
ObservablePrototype observablePrototype = new ObservablePrototype(realm);
SubscriptionPrototype subscriptionPrototype = new SubscriptionPrototype(realm);
SubscriptionObserverPrototype subscriptionObserverPrototype = new SubscriptionObserverPrototype(realm);
// registration phase
intrinsics.put(Intrinsics.Observable, observableConstructor);
intrinsics.put(Intrinsics.ObservablePrototype, observablePrototype);
intrinsics.put(Intrinsics.SubscriptionPrototype, subscriptionPrototype);
intrinsics.put(Intrinsics.SubscriptionObserverPrototype, subscriptionObserverPrototype);
// initialization phase
observableConstructor.initialize(realm);
observablePrototype.initialize(realm);
subscriptionPrototype.initialize(realm);
subscriptionObserverPrototype.initialize(realm);
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class Realm method initializeFundamentalObjects.
/**
* <h1>19.1 Object Objects - 19.2 Function Objects</h1>
*
* Fundamental built-in objects which must be initialized early
*
* @param realm
* the realm instance
*/
private static void initializeFundamentalObjects(Realm realm) {
EnumMap<Intrinsics, OrdinaryObject> intrinsics = realm.intrinsics;
// allocation phase
ObjectConstructor objectConstructor = new ObjectConstructor(realm);
ObjectPrototype objectPrototype = new ObjectPrototype(realm);
FunctionConstructor functionConstructor = new FunctionConstructor(realm);
FunctionPrototype functionPrototype = new FunctionPrototype(realm);
// registration phase
intrinsics.put(Intrinsics.Object, objectConstructor);
intrinsics.put(Intrinsics.ObjectPrototype, objectPrototype);
intrinsics.put(Intrinsics.Function, functionConstructor);
intrinsics.put(Intrinsics.FunctionPrototype, functionPrototype);
// Create [[ThrowTypeError]] function before initializing intrinsics.
realm.throwTypeError = new TypeErrorThrower(realm);
// Also stored in intrinsics table.
intrinsics.put(Intrinsics.ThrowTypeError, realm.throwTypeError);
// initialization phase
objectConstructor.initialize(realm);
objectPrototype.initialize(realm);
functionConstructor.initialize(realm);
functionPrototype.initialize(realm);
AddRestrictedFunctionProperties(functionPrototype, realm);
// Object.prototype.toString is also an intrinsic
Object objectPrototypeToString = objectPrototype.lookupOwnProperty("toString").getValue();
intrinsics.put(Intrinsics.ObjProto_toString, (OrdinaryObject) objectPrototypeToString);
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class Realm method initializePromiseObjects.
/**
* <h1>25 Control Abstraction Objects</h1><br>
* <h2>25.4 Promise Objects</h2>
*
* @param realm
* the realm instance
*/
private static void initializePromiseObjects(Realm realm) {
EnumMap<Intrinsics, OrdinaryObject> intrinsics = realm.intrinsics;
// allocation phase
PromiseConstructor promiseConstructor = new PromiseConstructor(realm);
PromisePrototype promisePrototype = new PromisePrototype(realm);
// registration phase
intrinsics.put(Intrinsics.Promise, promiseConstructor);
intrinsics.put(Intrinsics.PromisePrototype, promisePrototype);
// initialization phase
promiseConstructor.initialize(realm);
promisePrototype.initialize(realm);
}
Aggregations