void QQuickLocalStorage::openDatabaseSync(QQmlV4Function *args)
{
#ifndef QT_NO_SETTINGS
- QV8Engine *engine = args->engine();
QV4::Scope scope(args->v4engine());
+ QV8Engine *engine = scope.engine->v8Engine;
QV4::ScopedContext ctx(scope, args->v4engine()->currentContext());
- if (engine->engine()->offlineStoragePath().isEmpty())
+ if (scope.engine->qmlEngine()->offlineStoragePath().isEmpty())
V4THROW_SQL2(SQLEXCEPTION_DATABASE_ERR, QQmlEngine::tr("SQL: can't create database, offline storage is disabled."));
- qmlsqldatabase_initDatabasesPath(engine);
+ qmlsqldatabase_initDatabasesPath(scope.engine->v8Engine);
QSqlDatabase database;
md5.addData(dbname.toUtf8());
QString dbid(QLatin1String(md5.result().toHex()));
- QString basename = qmlsqldatabase_databaseFile(dbid, engine);
+ QString basename = qmlsqldatabase_databaseFile(dbid, scope.engine->v8Engine);
bool created = false;
QString version = dbversion;
QV4::ScopedValue qmlGlobal(scope, d()->qmlGlobal);
QQmlV4Function func(callData, rv, qmlGlobal,
QmlContextWrapper::getContext(qmlGlobal),
- scope.engine->v8Engine);
+ scope.engine);
QQmlV4Function *funcptr = &func;
void *args[] = { 0, &funcptr };
mode = QQmlIncubator::AsynchronousIfNested;
}
- QQmlComponentExtension *e = componentExtension(args->engine());
+ QQmlComponentExtension *e = componentExtension(args->v4engine()->v8Engine);
- QV4::Scoped<QV4::QmlIncubatorObject> r(scope, v4->memoryManager->alloc<QV4::QmlIncubatorObject>(args->engine(), mode));
+ QV4::Scoped<QV4::QmlIncubatorObject> r(scope, v4->memoryManager->alloc<QV4::QmlIncubatorObject>(args->v4engine()->v8Engine, mode));
QV4::ScopedObject p(scope, e->incubationProto.value());
r->setPrototype(p);
QQmlContextData *context() { return ctx; }
QV4::ReturnedValue qmlGlobal() { return callData->thisObject.asReturnedValue(); }
void setReturnValue(QV4::ReturnedValue rv) { retVal = rv; }
- QV8Engine *engine() const { return e; }
- QV4::ExecutionEngine *v4engine() const;
+ QV4::ExecutionEngine *v4engine() const { return e; }
private:
friend struct QV4::QObjectMethod;
QQmlV4Function();
QQmlV4Function &operator=(const QQmlV4Function &);
QQmlV4Function(QV4::CallData *callData, QV4::ValueRef retVal,
- const QV4::ValueRef global, QQmlContextData *c, QV8Engine *e)
+ const QV4::ValueRef global, QQmlContextData *c, QV4::ExecutionEngine *e)
: callData(callData), retVal(retVal), ctx(c), e(e)
{
callData->thisObject.val = global.asReturnedValue();
QV4::CallData *callData;
QV4::ValueRef retVal;
QQmlContextData *ctx;
- QV8Engine *e;
+ QV4::ExecutionEngine *e;
};
class Q_QML_PRIVATE_EXPORT QQmlV4Handle
return 0;
}
-inline QV4::ExecutionEngine *QQmlV4Function::v4engine() const
-{
- return QV8Engine::getV4(e);
-}
QT_END_NAMESPACE
void MyQmlObject::v8function(QQmlV4Function *function)
{
- QV8Engine::getV4(function->engine())->throwError(QStringLiteral("Exception thrown from within QObject slot"));
+ function->v4engine()->throwError(QStringLiteral("Exception thrown from within QObject slot"));
}
static QJSValue script_api(QQmlEngine *engine, QJSEngine *scriptEngine)