forked from qt-creator/qt-creator
QmlJS: Enforce Context always being linked.
The default way of creating a Context is through Link. Change-Id: Ia81f7ce90ba2b33d02eed432a61be836d404bedd Reviewed-on: http://codereview.qt.nokia.com/1041 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
@@ -779,9 +779,10 @@ QList<const ObjectValue *> ScopeChain::all() const
|
||||
}
|
||||
|
||||
|
||||
Context::Context(const QmlJS::Snapshot &snapshot)
|
||||
Context::Context(const QmlJS::Snapshot &snapshot, ValueOwner *valueOwner, const ImportsPerDocument &imports)
|
||||
: _snapshot(snapshot),
|
||||
_valueOwner(new ValueOwner),
|
||||
_valueOwner(valueOwner),
|
||||
_imports(imports),
|
||||
_qmlScopeObjectIndex(-1),
|
||||
_qmlScopeObjectSet(false)
|
||||
{
|
||||
@@ -819,13 +820,6 @@ const Imports *Context::imports(const QmlJS::Document *doc) const
|
||||
return _imports.value(doc).data();
|
||||
}
|
||||
|
||||
void Context::setImports(const QmlJS::Document *doc, const Imports *imports)
|
||||
{
|
||||
if (!doc)
|
||||
return;
|
||||
_imports[doc] = QSharedPointer<const Imports>(imports);
|
||||
}
|
||||
|
||||
const Value *Context::lookup(const QString &name, const ObjectValue **foundInScope) const
|
||||
{
|
||||
QList<const ObjectValue *> scopes = _scopeChain.all();
|
||||
|
Reference in New Issue
Block a user