forked from qt-creator/qt-creator
There's no need to create a namespace object when the importId is invalid.
This commit is contained in:
@@ -128,11 +128,11 @@ bool Bind::visit(UiImport *ast)
|
||||
ObjectValue *namespaceObject;
|
||||
|
||||
if (ast->asToken.isValid()) { // with namespace we insert an object in the type env. to hold the imported types
|
||||
namespaceObject = _interp->newObject(/*prototype */ 0);
|
||||
|
||||
if (!ast->importId)
|
||||
return false; // this should never happen, but better be safe than sorry
|
||||
|
||||
namespaceObject = _interp->newObject(/*prototype */ 0);
|
||||
|
||||
_typeEnvironment->setProperty(ast->importId->asString(), namespaceObject);
|
||||
|
||||
} else { // without namespace we insert all types directly into the type env.
|
||||
|
Reference in New Issue
Block a user