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

Unified Diff: compiler/java/com/google/dart/compiler/parser/DartParser.java

Issue 10699027: Flag uninitialized final variables in a class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: # Created 8 years, 6 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/java/com/google/dart/compiler/parser/DartParser.java
diff --git a/compiler/java/com/google/dart/compiler/parser/DartParser.java b/compiler/java/com/google/dart/compiler/parser/DartParser.java
index 7ab38506b0d9126b9f4348f9fd5bfeb8e7685dd8..c0d869f500d7f9b62f491f7c4ca83543c4bc82f2 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -223,7 +223,7 @@ public class DartParser extends CompletionHooksParserBase {
public static String read(Source source) throws IOException {
return read(source.getSourceReader());
}
-
+
public static String read(Reader reader) throws IOException {
try {
return CharStreams.toString(reader);
@@ -738,6 +738,7 @@ public class DartParser extends CompletionHooksParserBase {
if (expect(Token.STRING)) {
nativeName = done(DartStringLiteral.get(ctx.getTokenString()));
}
+ modifiers = modifiers.makeNative();
}
// Parse the members.
@@ -1684,6 +1685,9 @@ public class DartParser extends CompletionHooksParserBase {
DartExpression value = null;
if (optional(Token.ASSIGN)) {
value = parseExpression();
+ if (value != null) {
+ modifiers = modifiers.makeInitialized();
+ }
}
fields.add(done(new DartField(name, modifiers, null, value)));
} while (optional(Token.COMMA));

Powered by Google App Engine
This is Rietveld 408576698