QmlJS: Allow lookups on const Contexts. Pass const Contexts where ok.

In preparation for caching Contexts.

Reviewed-by: Erik Verbruggen
This commit is contained in:
Christian Kamm
2010-08-25 11:51:34 +02:00
parent 44f4db7a39
commit 898098c1f2
15 changed files with 45 additions and 43 deletions

View File

@@ -168,11 +168,11 @@ class EnumerateProperties: private Interpreter::MemberProcessor
QHash<QString, const Interpreter::Value *> _properties;
bool _globalCompletion;
bool _enumerateGeneratedSlots;
Interpreter::Context *_context;
const Interpreter::Context *_context;
const Interpreter::ObjectValue *_currentObject;
public:
EnumerateProperties(Interpreter::Context *context)
EnumerateProperties(const Interpreter::Context *context)
: _globalCompletion(false),
_enumerateGeneratedSlots(false),
_context(context),
@@ -692,7 +692,7 @@ int CodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
const QList<AST::Node *> path = semanticInfo.astPath(editor->position());
LookupContext::Ptr lookupContext = LookupContext::create(document, snapshot, path);
Interpreter::Context *context = lookupContext->context();
const Interpreter::Context *context = lookupContext->context();
// Search for the operator that triggered the completion.
QChar completionOperator;