QmlJS: Adjust existing code for updated QML parser.

Change-Id: I153723eeb9973be025daf47e317f7b9d076a3c72
Reviewed-on: http://codereview.qt-project.org/4733
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
Christian Kamm
2011-09-13 09:57:24 +02:00
parent b531209002
commit 4b2f42cf87
30 changed files with 234 additions and 249 deletions

View File

@@ -168,10 +168,10 @@ bool Evaluate::visit(AST::UiArrayMemberList *)
bool Evaluate::visit(AST::UiQualifiedId *ast)
{
if (! ast->name)
if (ast->name.isEmpty())
return false;
const Value *value = _scopeChain->lookup(ast->name->asString());
const Value *value = _scopeChain->lookup(ast->name.toString());
if (! ast->next) {
_result = value;
@@ -179,11 +179,11 @@ bool Evaluate::visit(AST::UiQualifiedId *ast)
const ObjectValue *base = value_cast<const ObjectValue *>(value);
for (AST::UiQualifiedId *it = ast->next; base && it; it = it->next) {
NameId *name = it->name;
if (! name)
const QString &name = it->name.toString();
if (name.isEmpty())
break;
const Value *value = base->lookupMember(name->asString(), _context);
const Value *value = base->lookupMember(name, _context);
if (! it->next)
_result = value;
else
@@ -216,10 +216,10 @@ bool Evaluate::visit(AST::ThisExpression *)
bool Evaluate::visit(AST::IdentifierExpression *ast)
{
if (! ast->name)
if (ast->name.isEmpty())
return false;
_result = _scopeChain->lookup(ast->name->asString());
_result = _scopeChain->lookup(ast->name.toString());
return false;
}
@@ -314,12 +314,12 @@ bool Evaluate::visit(AST::ArrayMemberExpression *)
bool Evaluate::visit(AST::FieldMemberExpression *ast)
{
if (! ast->name)
if (ast->name.isEmpty())
return false;
if (const Value *base = _valueOwner->convertToObject(value(ast->base))) {
if (const ObjectValue *obj = base->asObjectValue()) {
_result = obj->lookupMember(ast->name->asString(), _context);
_result = obj->lookupMember(ast->name.toString(), _context);
}
}