aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/localstorage/plugin.cpp18
-rw-r--r--src/imports/xmllistmodel/qqmlxmllistmodel.cpp2
2 files changed, 11 insertions, 9 deletions
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index 83d73c5bc9..14c49a08e1 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -204,7 +204,7 @@ static ReturnedValue qmlsqldatabase_rows_index(QQmlSqlDatabaseWrapper *r, Execut
if (v.isNull()) {
row->put(v4->newIdentifier(record.fieldName(ii)), Value::nullValue());
} else {
- row->put(v4->newIdentifier(record.fieldName(ii)), v8->fromVariant(v));
+ row->put(v4->newIdentifier(record.fieldName(ii)), Value::fromReturnedValue(v8->fromVariant(v)));
}
}
if (hasProperty)
@@ -257,7 +257,8 @@ static ReturnedValue qmlsqldatabase_executeSql(SimpleCallContext *ctx)
QSqlQuery query(db);
bool err = false;
- Value result = Value::undefinedValue();
+ Scope scope(QV8Engine::getV4(engine));
+ ScopedValue result(scope, Value::undefinedValue());
if (query.prepare(sql)) {
if (ctx->argumentCount > 1) {
@@ -268,17 +269,18 @@ static ReturnedValue qmlsqldatabase_executeSql(SimpleCallContext *ctx)
query.bindValue(ii, engine->toVariant(QV4::Value::fromReturnedValue(array->getIndexed(ii)), -1));
} else if (Object *object = values.asObject()) {
ObjectIterator it(object, ObjectIterator::WithProtoChain|ObjectIterator::EnumerableOnly);
+ ScopedValue key(scope);
while (1) {
Value value;
- Value key = it.nextPropertyName(&value);
- if (key.isNull())
+ key = it.nextPropertyName(&value);
+ if (key->isNull())
break;
QVariant v = engine->toVariant(value, -1);
- if (key.isString()) {
- query.bindValue(key.stringValue()->toQString(), v);
+ if (key->isString()) {
+ query.bindValue(key->stringValue()->toQString(), v);
} else {
- assert(key.isInteger());
- query.bindValue(key.integerValue(), v);
+ assert(key->isInteger());
+ query.bindValue(key->integerValue(), v);
}
}
} else {
diff --git a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
index c12bfee924..9f6437625d 100644
--- a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
+++ b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
@@ -926,7 +926,7 @@ QQmlV4Handle QQuickXmlListModel::get(int index) const
Object *o = v4engine->newObject();
for (int ii = 0; ii < d->roleObjects.count(); ++ii) {
Property *p = o->insertMember(v4engine->newIdentifier(d->roleObjects[ii]->name()), PropertyAttributes());
- p->value = v8engine->fromVariant(d->data.value(ii).value(index));
+ p->value = Value::fromReturnedValue(v8engine->fromVariant(d->data.value(ii).value(index)));
}
return QQmlV4Handle(Value::fromObject(o));