Rewrite multiline strings properly
authorAlan Alpert <alan.alpert@nokia.com>
Tue, 31 Jan 2012 22:07:39 +0000 (08:07 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 9 Feb 2012 00:34:24 +0000 (01:34 +0100)
commit5060b58fdde00ca3fa4dc29bd58b80138a271b10
tree7b64064c463c4184e1666f6539ca60a9cac3f91e
parente8420af07158dc3aa5c6ea7ddae6f8be4976e454
Rewrite multiline strings properly

Because the bindings rewriter works on code strings, it would leave
multiline strings across multiple lines (which is illegal in ECMAScript.

It now manually breaks them up when it sees them, by replacing a \n
character with a literal \n.

Since RewriteSignalHandler now likes to have the AST passed in too, the
related method in QDeclarativeCompiler (and its customers) have been
altered to use the QDeclarativeScript::Value instead of just a string.

Task-number: QTBUG-23387
Change-Id: Id060de37e70590c9da2a902038ed02d948fdd70f
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
src/declarative/qml/qdeclarativecompiler.cpp
src/declarative/qml/qdeclarativecompiler_p.h
src/declarative/qml/qdeclarativecustomparser.cpp
src/declarative/qml/qdeclarativecustomparser_p.h
src/declarative/qml/qdeclarativerewrite.cpp
src/declarative/qml/qdeclarativerewrite_p.h
src/quick/util/qdeclarativeconnections.cpp
tests/auto/declarative/qdeclarativeecmascript/data/rewriteMultiLineStrings.qml [new file with mode: 0644]
tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp