QmlJS: Only collect linker errors for the current file being checked.

Avoids bug where import errors would show up in all files.

Reviewed-by: Roberto Raggi
This commit is contained in:
Christian Kamm
2010-03-29 11:32:11 +02:00
parent 7c04d11f44
commit 285e2ffbb2
4 changed files with 24 additions and 19 deletions

View File

@@ -20,7 +20,8 @@ class Link
{
public:
// Link all documents in snapshot
Link(Interpreter::Context *context, const Snapshot &snapshot, const QStringList &importPaths);
Link(Interpreter::Context *context, const Document::Ptr &doc, const Snapshot &snapshot,
const QStringList &importPaths);
~Link();
// Get the scope chain for the currentObject inside doc.
@@ -49,7 +50,10 @@ private:
AST::UiImport *import);
void importObject(Bind *bind, const QString &name, Interpreter::ObjectValue *object, NameId *targetNamespace);
void error(const Document::Ptr &doc, const AST::SourceLocation &loc, const QString &message);
private:
Document::Ptr _doc;
Snapshot _snapshot;
Interpreter::Context *_context;
QMultiHash<QString, Document::Ptr> _documentByPath;