aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/parser/qqmljslexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/parser/qqmljslexer.cpp')
-rw-r--r--src/qml/qml/parser/qqmljslexer.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/qml/qml/parser/qqmljslexer.cpp b/src/qml/qml/parser/qqmljslexer.cpp
index 4e15065e30..158640c47e 100644
--- a/src/qml/qml/parser/qqmljslexer.cpp
+++ b/src/qml/qml/parser/qqmljslexer.cpp
@@ -610,7 +610,13 @@ again:
if (_engine) {
while (!_char.isNull()) {
- if (isLineTerminator() || _char == QLatin1Char('\\')) {
+ if (isLineTerminator()) {
+ if (qmlMode())
+ break;
+ _errorCode = IllegalCharacter;
+ _errorMessage = QCoreApplication::translate("QQmlParser", "Stray newline in string literal");
+ return T_ERROR;
+ } else if (_char == QLatin1Char('\\')) {
break;
} else if (_char == quote) {
_tokenSpell = _engine->midRef(startCode - _code.unicode() - 1, _codePtr - startCode);