Commit aceeea96 authored by Roberto Raggi's avatar Roberto Raggi

Mark the bindings when searching for class or namespaces.

parent fc2175b2
...@@ -404,6 +404,11 @@ Binding *ClassBinding::findClassOrNamespaceBinding(Identifier *id, QSet<Binding ...@@ -404,6 +404,11 @@ Binding *ClassBinding::findClassOrNamespaceBinding(Identifier *id, QSet<Binding
if (id->isEqualTo(identifier())) if (id->isEqualTo(identifier()))
return this; return this;
if (processed->contains(this))
return 0;
processed->insert(this);
foreach (ClassBinding *nestedClassBinding, children) { foreach (ClassBinding *nestedClassBinding, children) {
if (id->isEqualTo(nestedClassBinding->identifier())) if (id->isEqualTo(nestedClassBinding->identifier()))
return nestedClassBinding; return nestedClassBinding;
...@@ -412,6 +417,7 @@ Binding *ClassBinding::findClassOrNamespaceBinding(Identifier *id, QSet<Binding ...@@ -412,6 +417,7 @@ Binding *ClassBinding::findClassOrNamespaceBinding(Identifier *id, QSet<Binding
foreach (ClassBinding *baseClassBinding, baseClassBindings) { foreach (ClassBinding *baseClassBinding, baseClassBindings) {
if (! baseClassBinding) if (! baseClassBinding)
continue; continue;
else if (Binding *b = baseClassBinding->findClassOrNamespaceBinding(id, processed)) else if (Binding *b = baseClassBinding->findClassOrNamespaceBinding(id, processed))
return b; return b;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment