diff options
Diffstat (limited to 'src/qml/jsruntime/qv4value.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4value.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4value.cpp b/src/qml/jsruntime/qv4value.cpp index 0347188ae0..6a717cde8d 100644 --- a/src/qml/jsruntime/qv4value.cpp +++ b/src/qml/jsruntime/qv4value.cpp @@ -327,6 +327,11 @@ PersistentValue::PersistentValue(const Value &val) { } +PersistentValue::PersistentValue(ReturnedValue val) + : d(new PersistentValuePrivate(Value::fromReturnedValue(val))) +{ +} + PersistentValue::PersistentValue(const PersistentValue &other) : d(other.d) { @@ -360,6 +365,16 @@ PersistentValue &PersistentValue::operator =(const Value &other) return *this; } +PersistentValue &PersistentValue::operator =(const ReturnedValue &other) +{ + if (!d) { + d = new PersistentValuePrivate(Value::fromReturnedValue(other)); + return *this; + } + d = d->detach(Value::fromReturnedValue(other)); + return *this; +} + PersistentValue::~PersistentValue() { if (d) |