2011-05-17 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
authorcaio.oliveira@openbossa.org <caio.oliveira@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 May 2011 19:35:37 +0000 (19:35 +0000)
committercaio.oliveira@openbossa.org <caio.oliveira@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 May 2011 19:35:37 +0000 (19:35 +0000)
        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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@86697 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/qt/ChangeLog
Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp

index 2f7745f..d7cc084 100644 (file)
@@ -1,3 +1,17 @@
+2011-05-17  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
+
+        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  <joybro@company100.net>
 
         Reviewed by Csaba Osztrogon√°c.
index 6bfb50f..a982119 100644 (file)
@@ -682,18 +682,19 @@ private:
         // 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");