Fix broken Maroon game / regression in PropertyChanges {} element
authorSimon Hausmann <simon.hausmann@digia.com>
Tue, 10 Dec 2013 14:25:22 +0000 (15:25 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 10 Dec 2013 14:46:09 +0000 (15:46 +0100)
commit29b6d2e45c7434fccf2e6878630e62d5dcce38db
treed2d0ad7639c9863c00cdd8558d9663bea813c3f3
parentfb72bb3cf27d1f94760709aaab82e3524ae936f4
Fix broken Maroon game / regression in PropertyChanges {} element

Commit 0aadcf8077840068eb182269e9ed9c31ad12f45e that pre-compiles the
expressions in PropertyChanges {} introduced a regression in where the
evaluation context was incorrect and thus bindings would not be able to
access the correct properties. For example

    PropertyChanges {
        target: someObject
        y: height / 2
    }

Here height should be looked up in the context of "someObject", not of the
PropertyChanges element.

This patch introduces an auto-test that verifies that the lookup context is
correct and fixes the bug by disabling accelerated compile time property
lookups for binding expressions that are requested from a custom parser.

Change-Id: I5cb607d07211b453ddfc9928ccbf5f9ecec85575
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/compiler/qqmlcodegenerator.cpp
src/qml/compiler/qqmlcodegenerator_p.h
src/qml/qml/qqmlcompiler.cpp
src/qml/qml/qqmlcompiler_p.h
src/qml/qml/qqmltypeloader.cpp
tests/auto/qml/qqmllanguage/data/customParserBindingScopes.qml [new file with mode: 0644]
tests/auto/qml/qqmllanguage/testtypes.cpp
tests/auto/qml/qqmllanguage/testtypes.h
tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp