diff options
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 8 | ||||
-rw-r--r-- | src/script/api/qscriptvalue.h | 2 | ||||
-rw-r--r-- | src/script/api/qscriptvalue_p.h | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index b0e09ded40..494eac83af 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -371,6 +371,14 @@ void QScriptValuePrivate::operator delete(void *ptr) } /*! + \internal +*/ +QScriptValue::QScriptValue(QScriptValuePrivate *d) + : d_ptr(d) +{ +} + +/*! Constructs an invalid QScriptValue. */ QScriptValue::QScriptValue() diff --git a/src/script/api/qscriptvalue.h b/src/script/api/qscriptvalue.h index 67b9514698..afa247ae6a 100644 --- a/src/script/api/qscriptvalue.h +++ b/src/script/api/qscriptvalue.h @@ -220,6 +220,8 @@ private: // force compile error, prevent QScriptValue(QScriptEngine*, bool) to be called inline QScriptValue(QScriptEngine *, void *); + QScriptValue(QScriptValuePrivate*); + private: QExplicitlySharedDataPointer<QScriptValuePrivate> d_ptr; diff --git a/src/script/api/qscriptvalue_p.h b/src/script/api/qscriptvalue_p.h index 06bc92744d..09338658c1 100644 --- a/src/script/api/qscriptvalue_p.h +++ b/src/script/api/qscriptvalue_p.h @@ -96,9 +96,7 @@ public: static inline QScriptValue toPublic(QScriptValuePrivate *d) { - QScriptValue tmp; - tmp.d_ptr = d; - return tmp; + return QScriptValue(d); } QScriptValue property(const JSC::Identifier &id, int resolveMode) const; |