forked from qt-creator/qt-creator
QmlJS: Add more value_casts.
And switch all existing dynamic_casts to value_casts. Change-Id: I93b89358e4802080f40b332074c64f4e91a2bc4c Reviewed-on: http://codereview.qt-project.org/6311 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
@@ -62,7 +62,7 @@ const Value *Evaluate::value(AST::Node *ast)
|
||||
{
|
||||
const Value *result = reference(ast);
|
||||
|
||||
if (const Reference *ref = value_cast<const Reference *>(result)) {
|
||||
if (const Reference *ref = value_cast<Reference>(result)) {
|
||||
if (_referenceContext)
|
||||
result = _referenceContext->lookupReference(ref);
|
||||
else
|
||||
@@ -176,7 +176,7 @@ bool Evaluate::visit(AST::UiQualifiedId *ast)
|
||||
_result = value;
|
||||
|
||||
} else {
|
||||
const ObjectValue *base = value_cast<const ObjectValue *>(value);
|
||||
const ObjectValue *base = value_cast<ObjectValue>(value);
|
||||
|
||||
for (AST::UiQualifiedId *it = ast->next; base && it; it = it->next) {
|
||||
const QString &name = it->name.toString();
|
||||
@@ -187,7 +187,7 @@ bool Evaluate::visit(AST::UiQualifiedId *ast)
|
||||
if (! it->next)
|
||||
_result = value;
|
||||
else
|
||||
base = value_cast<const ObjectValue *>(value);
|
||||
base = value_cast<ObjectValue>(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -328,7 +328,7 @@ bool Evaluate::visit(AST::FieldMemberExpression *ast)
|
||||
|
||||
bool Evaluate::visit(AST::NewMemberExpression *ast)
|
||||
{
|
||||
if (const FunctionValue *ctor = value_cast<const FunctionValue *>(value(ast->base))) {
|
||||
if (const FunctionValue *ctor = value_cast<FunctionValue>(value(ast->base))) {
|
||||
_result = ctor->construct();
|
||||
}
|
||||
return false;
|
||||
@@ -336,7 +336,7 @@ bool Evaluate::visit(AST::NewMemberExpression *ast)
|
||||
|
||||
bool Evaluate::visit(AST::NewExpression *ast)
|
||||
{
|
||||
if (const FunctionValue *ctor = value_cast<const FunctionValue *>(value(ast->expression))) {
|
||||
if (const FunctionValue *ctor = value_cast<FunctionValue>(value(ast->expression))) {
|
||||
_result = ctor->construct();
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user