Example #1
0
ReturnedValue QmlBindingWrapper::call(Managed *that, CallData *)
{
    ExecutionEngine *engine = that->engine();
    CHECK_STACK_LIMITS(engine);

    Scope scope(engine);
    QmlBindingWrapper *This = static_cast<QmlBindingWrapper *>(that);
    Q_ASSERT(This->function);

    CallContext *ctx = This->qmlContext;
    std::fill(ctx->locals, ctx->locals + ctx->function->varCount, Primitive::undefinedValue());
    engine->pushContext(ctx);
    ScopedValue result(scope, This->function->code(ctx, This->function->codeData));
    engine->popContext();

    return result.asReturnedValue();
}