diff options
Diffstat (limited to 'src/libs/qmljs/qmljsscopebuilder.cpp')
-rw-r--r-- | src/libs/qmljs/qmljsscopebuilder.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libs/qmljs/qmljsscopebuilder.cpp b/src/libs/qmljs/qmljsscopebuilder.cpp index 92f90ab4a7..ed52edb6a8 100644 --- a/src/libs/qmljs/qmljsscopebuilder.cpp +++ b/src/libs/qmljs/qmljsscopebuilder.cpp @@ -36,6 +36,7 @@ #include "qmljscontext.h" #include "qmljsevaluate.h" #include "qmljsscopechain.h" +#include "qmljsutils.h" #include "parser/qmljsast_p.h" #include <utils/qtcassert.h> @@ -174,11 +175,7 @@ void ScopeBuilder::setQmlScopeObject(Node *node) prototype = isPropertyChangesObject(_scopeChain->context(), prototype); // find the target script binding if (prototype) { - UiObjectInitializer *initializer = 0; - if (UiObjectDefinition *definition = cast<UiObjectDefinition *>(node)) - initializer = definition->initializer; - if (UiObjectBinding *binding = cast<UiObjectBinding *>(node)) - initializer = binding->initializer; + UiObjectInitializer *initializer = initializerOfObject(node); if (initializer) { for (UiObjectMemberList *m = initializer->members; m; m = m->next) { if (UiScriptBinding *scriptBinding = cast<UiScriptBinding *>(m->member)) { |