Search in sources :

Example 76 with ExecutionContext

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;
}
Also used : ExecutionContext(com.github.anba.es6draft.runtime.ExecutionContext) ScriptObject(com.github.anba.es6draft.runtime.types.ScriptObject)

Example 77 with ExecutionContext

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);
}
Also used : ExecutionContext(com.github.anba.es6draft.runtime.ExecutionContext) ScriptObject(com.github.anba.es6draft.runtime.types.ScriptObject) AbstractOperations(com.github.anba.es6draft.runtime.AbstractOperations)

Example 78 with ExecutionContext

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);
}
Also used : ExecutionContext(com.github.anba.es6draft.runtime.ExecutionContext) ScriptObject(com.github.anba.es6draft.runtime.types.ScriptObject) AbstractOperations(com.github.anba.es6draft.runtime.AbstractOperations)

Example 79 with ExecutionContext

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);
}
Also used : ExecutionContext(com.github.anba.es6draft.runtime.ExecutionContext) ScriptObject(com.github.anba.es6draft.runtime.types.ScriptObject) AbstractOperations(com.github.anba.es6draft.runtime.AbstractOperations)

Example 80 with ExecutionContext

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);
}
Also used : ExecutionContext(com.github.anba.es6draft.runtime.ExecutionContext) ScriptObject(com.github.anba.es6draft.runtime.types.ScriptObject) AbstractOperations(com.github.anba.es6draft.runtime.AbstractOperations)

Aggregations

ExecutionContext (com.github.anba.es6draft.runtime.ExecutionContext)95 ScriptObject (com.github.anba.es6draft.runtime.types.ScriptObject)61 Realm (com.github.anba.es6draft.runtime.Realm)17 FunctionObject (com.github.anba.es6draft.runtime.types.builtins.FunctionObject)16 LexicalEnvironment (com.github.anba.es6draft.runtime.LexicalEnvironment)15 OrdinaryObject (com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject)14 AbstractOperations (com.github.anba.es6draft.runtime.AbstractOperations)11 Declaration (com.github.anba.es6draft.ast.Declaration)10 HoistableDeclaration (com.github.anba.es6draft.ast.HoistableDeclaration)10 Name (com.github.anba.es6draft.ast.scope.Name)10 Callable (com.github.anba.es6draft.runtime.types.Callable)10 ArrayObject (com.github.anba.es6draft.runtime.types.builtins.ArrayObject)10 HashSet (java.util.HashSet)10 StatementListItem (com.github.anba.es6draft.ast.StatementListItem)9 MethodName (com.github.anba.es6draft.compiler.assembler.MethodName)9 TryCatchLabel (com.github.anba.es6draft.compiler.assembler.TryCatchLabel)8 DeclarativeEnvironmentRecord (com.github.anba.es6draft.runtime.DeclarativeEnvironmentRecord)8 ScriptException (com.github.anba.es6draft.runtime.internal.ScriptException)8 ArrayDeque (java.util.ArrayDeque)8 FunctionDeclaration (com.github.anba.es6draft.ast.FunctionDeclaration)7