Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1070)

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java

Issue 12593009: Don't cast to NodeElement where not needed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index d84e226145a5c51fbb159576949e4521981f2fe3..03ad658a9b5e1665ea97e42486a72c286419a425 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -46,7 +46,6 @@ import com.google.dart.compiler.resolver.EnclosingElement;
import com.google.dart.compiler.resolver.FieldElement;
import com.google.dart.compiler.resolver.LibraryElement;
import com.google.dart.compiler.resolver.MethodElement;
-import com.google.dart.compiler.resolver.NodeElement;
import com.google.dart.compiler.resolver.ResolverErrorCode;
import com.google.dart.compiler.resolver.TypeErrorCode;
import com.google.dart.compiler.resolver.VariableElement;
@@ -1553,9 +1552,9 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
invocation = (DartUnqualifiedInvocation) stmt.getExpression();
}
// Check that unqualified foo() invocation is resolved to the top-level (library) function.
- NodeElement element = invocation.getTarget().getElement();
+ Element element = invocation.getTarget().getElement();
assertNotNull(element);
- assertSame(testUnit, element.getNode().getParent());
+ assertTrue(element.getEnclosingElement() instanceof LibraryElement);
}
/**
@@ -5170,7 +5169,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
assertSame(typeA, type);
// .named
DartIdentifier nameNode = findNode(DartIdentifier.class, "named;");
- NodeElement nameElement = nameNode.getElement();
+ Element nameElement = nameNode.getElement();
assertNotNull(nameElement);
assertSame(elementA.lookupConstructor("named"), nameElement);
}

Powered by Google App Engine
This is Rietveld 408576698