Fix multi-line string content.
authorErik Verbruggen <erik.verbruggen@me.com>
Tue, 19 Mar 2013 12:04:54 +0000 (13:04 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 20 Mar 2013 04:06:54 +0000 (05:06 +0100)
ECMA5.1, paragraph 7.8.4, item 9 under semantics: The SV of
   LineContinuation :: \ LineTerminatorSequence
is the empty character sequence.

So, do not add any line-terminator inside a multi-line string. Escaped
characters like \r and \n are added of course.

Change-Id: I8c58b7971b1d1bc90adc795ea278541758246e01
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/parser/qqmljslexer.cpp
tests/auto/qml/v4/data/equals.qml

index 0df4927..cb78238 100644 (file)
@@ -782,22 +782,11 @@ again:
                     return T_ERROR;
 
                 case '\r':
-                    if (isLineTerminatorSequence() == 2) {
-                        _tokenText += QLatin1Char('\r');
-                        u = QLatin1Char('\n');
-                    } else {
-                        u = QLatin1Char('\r');
-                    }
-                    scanChar();
-                    break;
-
                 case '\n':
                 case 0x2028u:
                 case 0x2029u:
-                    u = _char;
                     scanChar();
-                    break;
-
+                    continue;
 
                 default:
                     // non escape character
index c32603c..2862bb7 100644 (file)
@@ -44,5 +44,8 @@ QtObject {
     property bool test32: true != zero
     property bool test33: true == 1
     property bool test34: true != 1
+
+    property bool test35: "a\
+b" === "ab"
 }