diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2012-05-30 10:16:13 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-29 06:38:54 +0200 |
commit | 04774bb14c81688f86a2b31b8624bde8ebf59062 (patch) | |
tree | 9d04d18712988caca2a3f193feb94cfaa35b47bb /tests/auto | |
parent | d65fb68de12b6d811f7b94ba3209847f73ca94cc (diff) |
Evaluate bindings more intelligently during construction
Instead of just evaluating bindings in a fixed order, and possibly
having to evaluate a single binding multiple times, prior to reading
a property, we check if there are any bindings "pending" on it and
evaluate them then. A pending binding is one that has been assigned
to the property, but not yet evaluated.
To minimize side effects we only do this for "safe" bindings. A
safe binding is one that has no side effects, which we currently
define as not calling functions or otherwise assigning values during
its evaluation. This isn't an entirely foolproof way to ensure that
the evaluation has no side effects, but it should be good enough.
Change-Id: I98aa76a95719e5d182e8941738d64f8d409f404a
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qml/v4/tst_v4.cpp | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 96c0ec1080..e5661bd883 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -610,7 +610,7 @@ void tst_qqmlecmascript::methods() void tst_qqmlecmascript::bindingLoop() { QQmlComponent component(&engine, testFileUrl("bindingLoop.qml")); - QString warning = component.url().toString() + ":5:9: QML MyQmlObject: Binding loop detected for property \"stringProperty\""; + QString warning = component.url().toString() + ":9:9: QML MyQmlObject: Binding loop detected for property \"stringProperty\""; QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); QObject *object = component.create(); QVERIFY(object != 0); diff --git a/tests/auto/qml/v4/tst_v4.cpp b/tests/auto/qml/v4/tst_v4.cpp index d39649a09a..e4a8a2e7ee 100644 --- a/tests/auto/qml/v4/tst_v4.cpp +++ b/tests/auto/qml/v4/tst_v4.cpp @@ -989,7 +989,6 @@ void tst_v4::debuggingDumpInstructions() QStringList expectedPreAddress; expectedPreAddress << "\t\tNoop"; expectedPreAddress << "\t0:0:"; - expectedPreAddress << "\t\tSubscribe\t\tObject_Reg(0) Notify_Signal(0) -> Subscribe_Slot(0)"; expectedPreAddress << "\t\tSubscribeId\t\tId_Offset(0) -> Subscribe_Slot(0)"; expectedPreAddress << "\t\tFetchAndSubscribe\tObject_Reg(0) Fast_Accessor(0x0) -> Output_Reg(0) Subscription_Slot(0)"; expectedPreAddress << "\t\tLoadId\t\t\tId_Offset(0) -> Output_Reg(0)"; |