QmlJS: Fix lookup for enums.

* Also look for enums in prototypes.
* Report back which QmlObjectValue had the enum.
* Fix a bug where enum lookup was always skipped.

Change-Id: I9c9fd8f8cf9bd8cc5f1bb5688fef5786267cd794
Reviewed-on: http://codereview.qt.nokia.com/4192
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
Christian Kamm
2011-09-05 13:35:16 +02:00
parent b8b8f167b1
commit 312d43f215
3 changed files with 48 additions and 50 deletions

View File

@@ -441,8 +441,8 @@ public:
bool hasProperty(const QString &typeName) const;
bool hasChildInPackage() const;
LanguageUtils::FakeMetaEnum getEnum(const QString &typeName) const;
const QmlEnumValue *getEnumValue(const QString &typeName) const;
LanguageUtils::FakeMetaEnum getEnum(const QString &typeName, const QmlObjectValue **foundInScope = 0) const;
const QmlEnumValue *getEnumValue(const QString &typeName, const QmlObjectValue **foundInScope = 0) const;
protected:
const Value *findOrCreateSignature(int index, const LanguageUtils::FakeMetaMethod &method,
QString *methodName) const;