summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/qt/tests/qobjectbridge
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-06-20 13:01:08 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-06-20 13:01:08 +0200
commit49233e234e5c787396cadb2cea33b31ae0cd65c1 (patch)
tree5410cb9a8fd53168bb60d62c54b654d86f03c38d /Source/WebKit/qt/tests/qobjectbridge
parentb211c645d8ab690f713515dfdc84d80b11c27d2c (diff)
Imported WebKit commit 3a8c29f35d00659d2ce7a0ccdfa8304f14e82327 (http://svn.webkit.org/repository/webkit/trunk@120813)
New snapshot with Windows build fixes
Diffstat (limited to 'Source/WebKit/qt/tests/qobjectbridge')
-rw-r--r--Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp b/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp
index 8b7eb4af8..291f9b294 100644
--- a/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp
+++ b/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp
@@ -662,9 +662,8 @@ private slots:
private:
QString evalJS(const QString& s)
{
- // Convert an undefined return variant to the string "undefined"
QVariant ret = evalJSV(s);
- if (ret.userType() == QMetaType::Void)
+ if (!ret.isValid())
return "undefined";
return ret.toString();
}
@@ -684,7 +683,6 @@ private:
// As a special measure, if we get an exception we set the type to 'error'
// (in ecma, an Error object has typeof object, but qtscript has a convenience function)
// Similarly, an array is an object, but we'd prefer to have a type of 'array'
- // Also, consider a QMetaType::Void QVariant to be undefined
QString escaped = s;
escaped.replace('\'', "\\'"); // Don't preescape your single quotes!
QString code("var retvalue; "
@@ -701,7 +699,7 @@ private:
evalJS(code.arg(escaped));
QVariant ret = evalJSV("retvalue");
- if (ret.userType() != QMetaType::Void)
+ if (ret.isValid())
type = evalJS("typevalue");
else {
ret = QString("undefined");