aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4runtime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 500d1ae0ba..be5de62243 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -381,12 +381,8 @@ QV4::ReturnedValue Runtime::As::call(ExecutionEngine *engine, const Value &lval,
return Encode::null();
// Try to convert the value type
- if (Scoped<QQmlTypeWrapper> typeWrapper(scope, rval); typeWrapper) {
- const QMetaType metaType = typeWrapper->d()->type().typeId();
- const QVariant result = engine->toVariant(lval, metaType);
- if (result.metaType() == metaType)
- return engine->metaTypeToJS(metaType, result.constData());
- }
+ if (Scoped<QQmlTypeWrapper> typeWrapper(scope, rval); typeWrapper)
+ return coerce(engine, lval, typeWrapper->d()->type(), false);
return Encode::undefined();
}