Made the error recovering more robust.

This commit is contained in:
Roberto Raggi
2010-01-28 16:29:45 +01:00
parent da81d59e24
commit 6fe1f5b96c
3 changed files with 17 additions and 30 deletions

View File

@@ -87,7 +87,9 @@ ObjectValue *Bind::scopeChainAt(Document::Ptr currentDocument, const Snapshot &s
}
LinkImports()(binds);
ObjectValue *scope = Link()(binds, currentBind, currentObject);
ObjectValue *scope = interp->globalObject();
if (currentBind)
scope = Link()(binds, currentBind, currentObject);
qDeleteAll(binds);
return scope;