diff options
Diffstat (limited to 'src/script/bridge/qscriptvariant.cpp')
-rw-r--r-- | src/script/bridge/qscriptvariant.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/script/bridge/qscriptvariant.cpp b/src/script/bridge/qscriptvariant.cpp index 7bc1122..d352a98 100644 --- a/src/script/bridge/qscriptvariant.cpp +++ b/src/script/bridge/qscriptvariant.cpp @@ -134,12 +134,15 @@ static JSC::JSValue JSC_HOST_CALL variantProtoFuncToString(JSC::ExecState *exec, const QVariant &v = static_cast<QVariantDelegate*>(delegate)->value(); JSC::UString result; JSC::JSValue value = variantProtoFuncValueOf(exec, callee, thisValue, args); - if (value && !value.isObject()) + if (value.isObject()) { + result = QScript::qtStringToJSCUString(v.toString()); + if (result.isEmpty()) { + result = "QVariant("; + result += v.typeName(); + result += ")"; + } + } else { result = value.toString(exec); - if (result.isEmpty()) { - result = "QVariant("; - result += v.typeName(); - result += ")"; } return JSC::jsString(exec, result); } |