use of com.github.anba.es6draft.runtime.ExecutionContext in project es6draft by anba.
the class ObservableConstructor method construct.
/**
* Observable ( subscriber )
*/
@Override
public ObservableObject construct(ExecutionContext callerContext, Constructor newTarget, Object... args) {
ExecutionContext calleeContext = calleeContext();
Object subscriber = argument(args, 0);
/* step 2 */
if (!IsCallable(subscriber)) {
throw newTypeError(calleeContext, Messages.Key.NotCallable);
}
/* steps 3-4 */
ObservableObject observable = new ObservableObject(calleeContext.getRealm(), (Callable) subscriber, GetPrototypeFromConstructor(calleeContext, newTarget, Intrinsics.ObservablePrototype));
/* step 5 */
return observable;
}
use of com.github.anba.es6draft.runtime.ExecutionContext in project es6draft by anba.
the class Bool32x4Constructor method call.
@Override
public Object call(ExecutionContext callerContext, Object thisValue, Object... args) {
ExecutionContext calleeContext = calleeContext();
Object[] fields = new Object[VECTOR_LENGTH];
for (int i = 0; i < VECTOR_LENGTH; ++i) {
fields[i] = i < args.length ? args[i] : UNDEFINED;
}
return SIMDCreateBool(calleeContext, SIMD_TYPE, fields, AbstractOperations::ToBoolean);
}
use of com.github.anba.es6draft.runtime.ExecutionContext in project es6draft by anba.
the class Bool8x16Constructor method call.
@Override
public Object call(ExecutionContext callerContext, Object thisValue, Object... args) {
ExecutionContext calleeContext = calleeContext();
Object[] fields = new Object[VECTOR_LENGTH];
for (int i = 0; i < VECTOR_LENGTH; ++i) {
fields[i] = i < args.length ? args[i] : UNDEFINED;
}
return SIMDCreateBool(calleeContext, SIMD_TYPE, fields, AbstractOperations::ToBoolean);
}
use of com.github.anba.es6draft.runtime.ExecutionContext in project es6draft by anba.
the class Float64x2Constructor method call.
@Override
public Object call(ExecutionContext callerContext, Object thisValue, Object... args) {
ExecutionContext calleeContext = calleeContext();
Object[] fields = new Object[VECTOR_LENGTH];
for (int i = 0; i < VECTOR_LENGTH; ++i) {
fields[i] = i < args.length ? args[i] : UNDEFINED;
}
return SIMDCreateFloat(calleeContext, SIMD_TYPE, fields, AbstractOperations::ToNumber);
}
use of com.github.anba.es6draft.runtime.ExecutionContext in project es6draft by anba.
the class Int16x8Constructor method call.
@Override
public Object call(ExecutionContext callerContext, Object thisValue, Object... args) {
ExecutionContext calleeContext = calleeContext();
Object[] fields = new Object[VECTOR_LENGTH];
for (int i = 0; i < VECTOR_LENGTH; ++i) {
fields[i] = i < args.length ? args[i] : UNDEFINED;
}
return SIMDCreateInt(calleeContext, SIMD_TYPE, fields, AbstractOperations::ToInt16);
}
Aggregations