aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v8/qv8engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/v8/qv8engine.cpp')
-rw-r--r--src/qml/qml/v8/qv8engine.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp
index d0c8c08fce..ce5d3c8370 100644
--- a/src/qml/qml/v8/qv8engine.cpp
+++ b/src/qml/qml/v8/qv8engine.cpp
@@ -106,12 +106,15 @@ static void restoreJSValue(QDataStream &stream, void *data)
quint32 isNullOrUndefined;
stream >> isNullOrUndefined;
+
+ // ### Optimize for the common case where we have an valid persistent
+ d->persistent.clear();
+
if (isNullOrUndefined & 0x1) {
- d->value = QV4::Primitive::nullValue().asReturnedValue();
+ d->unboundData = QVariant(QMetaType::VoidStar, (void *)0);
} else if (isNullOrUndefined & 0x2) {
- d->value = QV4::Primitive::undefinedValue().asReturnedValue();
+ d->unboundData = QVariant();
} else {
- d->value = QV4::Primitive::emptyValue().asReturnedValue();
d->unboundData.load(stream);
}
}