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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java

Issue 9052002: Issue 999: NPE from CompileTimeConstantAnalyzer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Cleanup of ErrorExpectation + static imports Created 9 years 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
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/CompilerTestCase.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java b/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
index 6a6e2953a5273d92ff9368623963c95fbd1ab9df..352be8eebd1639e05a1a81cb3632e39062b79c3c 100644
--- a/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
@@ -129,16 +129,18 @@ public class CompileTimeConstantAnalyzer {
* determined.
*/
private Type getMostSpecificType(DartNode node) {
- Element element = (Element) node.getSymbol();
- Type type = inferredTypes.get(node);
- if (type != null) {
- return type;
- }
- if (element != null) {
- type = element.getType();
+ if (node != null) {
+ Element element = (Element) node.getSymbol();
+ Type type = inferredTypes.get(node);
if (type != null) {
return type;
}
+ if (element != null) {
+ type = element.getType();
+ if (type != null) {
+ return type;
+ }
+ }
}
return dynamicType;
}
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/CompilerTestCase.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698