diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-03-26 14:02:20 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-03-26 14:10:36 (GMT) |
commit | 9ffc533ffbba156ff69dc1bd3a9a4a2cb53b68af (patch) | |
tree | c9bfe6a9e5fbe3d1393f0ff4ceba51f4904a01bf /src/script | |
parent | c7627129e0ab3133ea0a95e93cd8643b5a97e189 (diff) | |
download | Qt-9ffc533ffbba156ff69dc1bd3a9a4a2cb53b68af.zip Qt-9ffc533ffbba156ff69dc1bd3a9a4a2cb53b68af.tar.gz Qt-9ffc533ffbba156ff69dc1bd3a9a4a2cb53b68af.tar.bz2 |
Fix regression in qscriptvalue_cast (primitive-->complex type cast)
qscriptvalue_cast implementation was changed from 4.4 to 4.5 because
of the introduction of QScriptValue constructors that don't take an
engine pointer. However, when the old constructors are used, the
behavior of qscriptvalue_cast should be as before, which this patch
ensures. In short: If we have an engine pointer, use it.
Task-number: 248802
Reviewed-by: Ariya Hidayat
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/qscriptengine.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/script/qscriptengine.cpp b/src/script/qscriptengine.cpp index d4e1923..d8908ed 100644 --- a/src/script/qscriptengine.cpp +++ b/src/script/qscriptengine.cpp @@ -1169,7 +1169,8 @@ bool QScriptEngine::convert(const QScriptValue &value, int type, void *ptr) bool QScriptEngine::convertV2(const QScriptValue &value, int type, void *ptr) { QScriptValueImpl impl = QScriptValuePrivate::valueOf(value); - return QScriptEnginePrivate::convert(impl, type, ptr, /*engine=*/0); + QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(value.engine()); + return QScriptEnginePrivate::convert(impl, type, ptr, eng_p); } /*! |