summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-03-26 14:02:20 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-03-26 14:10:36 (GMT)
commit9ffc533ffbba156ff69dc1bd3a9a4a2cb53b68af (patch)
treec9bfe6a9e5fbe3d1393f0ff4ceba51f4904a01bf /src
parentc7627129e0ab3133ea0a95e93cd8643b5a97e189 (diff)
downloadQt-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')
-rw-r--r--src/script/qscriptengine.cpp3
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);
}
/*!