forked from qt-creator/qt-creator
Merge remote branch 'origin/2.0'
Conflicts: src/plugins/projectexplorer/taskwindow.cpp src/shared/proparser/profileevaluator.cpp
This commit is contained in:
@@ -53,7 +53,7 @@ const Interpreter::Value *Evaluate::operator()(AST::Node *ast)
|
||||
const Value *result = reference(ast);
|
||||
|
||||
if (const Reference *ref = value_cast<const Reference *>(result))
|
||||
result = ref->value(_context);
|
||||
result = _context->lookupReference(ref);
|
||||
|
||||
if (! result)
|
||||
result = _engine->undefinedValue();
|
||||
|
||||
@@ -1510,6 +1510,18 @@ const ObjectValue *Context::lookupType(const QmlJS::Document *doc, const QString
|
||||
return objectValue;
|
||||
}
|
||||
|
||||
const Value *Context::lookupReference(const Reference *reference)
|
||||
{
|
||||
if (_referenceStack.contains(reference))
|
||||
return 0;
|
||||
|
||||
_referenceStack.append(reference);
|
||||
const Value *v = reference->value(this);
|
||||
_referenceStack.removeLast();
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
const Value *Context::property(const ObjectValue *object, const QString &name) const
|
||||
{
|
||||
const Properties properties = _properties.value(object);
|
||||
@@ -1659,7 +1671,7 @@ const ObjectValue *ObjectValue::prototype(Context *context) const
|
||||
const ObjectValue *prototypeObject = value_cast<const ObjectValue *>(_prototype);
|
||||
if (! prototypeObject) {
|
||||
if (const Reference *prototypeReference = value_cast<const Reference *>(_prototype)) {
|
||||
prototypeObject = value_cast<const ObjectValue *>(prototypeReference->value(context));
|
||||
prototypeObject = value_cast<const ObjectValue *>(context->lookupReference(prototypeReference));
|
||||
}
|
||||
}
|
||||
return prototypeObject;
|
||||
|
||||
@@ -294,6 +294,7 @@ public:
|
||||
const Value *lookup(const QString &name);
|
||||
const ObjectValue *lookupType(const Document *doc, AST::UiQualifiedId *qmlTypeName);
|
||||
const ObjectValue *lookupType(const Document *doc, const QStringList &qmlTypeName);
|
||||
const Value *lookupReference(const Reference *reference);
|
||||
|
||||
const Value *property(const ObjectValue *object, const QString &name) const;
|
||||
void setProperty(const ObjectValue *object, const QString &name, const Value *value);
|
||||
@@ -314,6 +315,7 @@ private:
|
||||
ScopeChain _scopeChain;
|
||||
int _qmlScopeObjectIndex;
|
||||
bool _qmlScopeObjectSet;
|
||||
QList<const Reference *> _referenceStack;
|
||||
};
|
||||
|
||||
class QMLJS_EXPORT Reference: public Value
|
||||
@@ -323,14 +325,16 @@ public:
|
||||
virtual ~Reference();
|
||||
|
||||
Engine *engine() const;
|
||||
virtual const Value *value(Context *context) const;
|
||||
|
||||
// Value interface
|
||||
virtual const Reference *asReference() const;
|
||||
virtual void accept(ValueVisitor *) const;
|
||||
|
||||
private:
|
||||
virtual const Value *value(Context *context) const;
|
||||
|
||||
Engine *_engine;
|
||||
friend class Context;
|
||||
};
|
||||
|
||||
class QMLJS_EXPORT ColorValue: public Value
|
||||
@@ -754,9 +758,9 @@ public:
|
||||
|
||||
AST::UiQualifiedId *qmlTypeName() const;
|
||||
|
||||
private:
|
||||
virtual const Value *value(Context *context) const;
|
||||
|
||||
private:
|
||||
AST::UiQualifiedId *_qmlTypeName;
|
||||
const Document *_doc;
|
||||
};
|
||||
@@ -769,6 +773,7 @@ public:
|
||||
ASTVariableReference(AST::VariableDeclaration *ast, Engine *engine);
|
||||
virtual ~ASTVariableReference();
|
||||
|
||||
private:
|
||||
virtual const Value *value(Context *context) const;
|
||||
};
|
||||
|
||||
@@ -804,6 +809,8 @@ public:
|
||||
QString onChangedSlotName() const { return _onChangedSlotName; }
|
||||
|
||||
virtual bool getSourceLocation(QString *fileName, int *line, int *column) const;
|
||||
|
||||
private:
|
||||
virtual const Value *value(Context *context) const;
|
||||
};
|
||||
|
||||
@@ -821,6 +828,8 @@ public:
|
||||
QString slotName() const { return _slotName; }
|
||||
|
||||
virtual bool getSourceLocation(QString *fileName, int *line, int *column) const;
|
||||
|
||||
private:
|
||||
virtual const Value *value(Context *context) const;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user