Title: [86697] trunk/Source/WebKit/qt
- Revision
- 86697
- Author
- [email protected]
- Date
- 2011-05-17 12:35:37 -0700 (Tue, 17 May 2011)
Log Message
2011-05-17 Caio Marcelo de Oliveira Filho <[email protected]>
Reviewed by Andreas Kling.
[Qt] Simplify syntax in test code to make prepare-ChangeLog less confused
https://bugs.webkit.org/show_bug.cgi?id=60978
Backslash to escape newlines was confusing both prepare-ChangeLog and the
QtCreator highlight system.
* tests/qwebframe/tst_qwebframe.cpp:
(tst_QWebFrame::evalJSV):
Remove usage of backslash to escape newlines in string literal.
Modified Paths
Diff
Modified: trunk/Source/WebKit/qt/ChangeLog (86696 => 86697)
--- trunk/Source/WebKit/qt/ChangeLog 2011-05-17 19:29:25 UTC (rev 86696)
+++ trunk/Source/WebKit/qt/ChangeLog 2011-05-17 19:35:37 UTC (rev 86697)
@@ -1,3 +1,17 @@
+2011-05-17 Caio Marcelo de Oliveira Filho <[email protected]>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Simplify syntax in test code to make prepare-ChangeLog less confused
+ https://bugs.webkit.org/show_bug.cgi?id=60978
+
+ Backslash to escape newlines was confusing both prepare-ChangeLog and the
+ QtCreator highlight system.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+ (tst_QWebFrame::evalJSV):
+ Remove usage of backslash to escape newlines in string literal.
+
2011-05-17 Young Han Lee <[email protected]>
Reviewed by Csaba Osztrogonác.
Modified: trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp (86696 => 86697)
--- trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp 2011-05-17 19:29:25 UTC (rev 86696)
+++ trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp 2011-05-17 19:35:37 UTC (rev 86697)
@@ -682,18 +682,19 @@
// Also, consider a QMetaType::Void QVariant to be undefined
QString escaped = s;
escaped.replace('\'', "\\'"); // Don't preescape your single quotes!
- evalJS("var retvalue;\
- var typevalue; \
- try {\
- retvalue = eval('" + escaped + "'); \
- typevalue = typeof retvalue; \
- if (retvalue instanceof Array) \
- typevalue = 'array'; \
- } \
- catch(e) {\
- retvalue = e.name + ': ' + e.message;\
- typevalue = 'error';\
- }");
+ QString code("var retvalue; "
+ "var typevalue; "
+ "try { "
+ " retvalue = eval('%1'); "
+ " typevalue = typeof retvalue; "
+ " if (retvalue instanceof Array) "
+ " typevalue = 'array'; "
+ "} catch(e) { "
+ " retvalue = e.name + ': ' + e.message; "
+ " typevalue = 'error'; "
+ "}");
+ evalJS(code.arg(escaped));
+
QVariant ret = evalJSV("retvalue");
if (ret.userType() != QMetaType::Void)
type = evalJS("typevalue");
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes