Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Alan Alpert
authored and
Qt by Nokia
committed
Feb 9, 2012
1 parent
e8420af
commit 5060b58
Showing
9 changed files
with
182 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tests/auto/declarative/qdeclarativeecmascript/data/rewriteMultiLineStrings.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import QtQuick 2.0 | ||
|
||
Item { | ||
id: root; | ||
property bool test: str == str2 && (txt != null && txt.str == root.str) | ||
property Text txt: null | ||
//Constant doesn't hit rewriter | ||
property string str: 'same | ||
multiline | ||
string 5 !' | ||
property string str2: ''; | ||
Component { | ||
id: comp | ||
Text { | ||
property var value: 1 | ||
property string str: 'same | ||
multiline | ||
string ' + value + " !" | ||
Component.onCompleted: { //Separate codepath for signal handers in rewriter | ||
root.str2 = 'same | ||
multiline | ||
string ' + value + " !" | ||
} | ||
} | ||
} | ||
Component.onCompleted: txt = comp.createObject(root,{"value" : 5}) | ||
/* | ||
Timer { | ||
interval: 1000 | ||
running: true | ||
repeat: true | ||
onTriggered: console.debug( "Test: " + test + '\n' + str + '\n:\n' + str2 + "\n:\n" + txt.str) | ||
} | ||
*/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters