ScopeChain Class

(QmlJS::ScopeChain)

The ScopeChain class describes the scopes used for global lookup in a specific location. More...

Header: #include <ScopeChain>

Detailed Description

A ScopeChain is used to perform global lookup with the lookup() function and to access information about the enclosing scopes.

Once constructed for a Document in a Context it represents the root scope of that Document. From there, a ScopeBuilder can be used to push and pop scopes corresponding to functions, object definitions, etc.

It is an error to use the same ScopeChain from multiple threads; use a copy. Copying is cheap. Initial construction is currently expensive.

When a QmlJSEditor::QmlJSEditorDocument is available, there's no need to construct a new ScopeChain. Instead use QmlJSEditorDocument::semanticInfo()::scopeChain().

See also Document, Context, and ScopeBuilder.