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

Unified Diff: lib/compiler/implementation/scanner/listener.dart

Issue 10996062: Use static final empty Modifier instead of null. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Missing uses fixed. Created 8 years, 3 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: lib/compiler/implementation/scanner/listener.dart
diff --git a/lib/compiler/implementation/scanner/listener.dart b/lib/compiler/implementation/scanner/listener.dart
index 3298428766a661c10ad6f2cbe62d4ec997f1dd80..d023b0acb6c318096f9a90f2c9ccc3c67b82721e 100644
--- a/lib/compiler/implementation/scanner/listener.dart
+++ b/lib/compiler/implementation/scanner/listener.dart
@@ -855,8 +855,12 @@ class ElementListener extends Listener {
}
void handleModifiers(int count) {
- NodeList modifierNodes = makeNodeList(count, null, null, ' ');
- pushNode(new Modifiers(modifierNodes));
+ if (count == 0) {
+ pushNode(Modifiers.EMPTY);
+ } else {
+ NodeList modifierNodes = makeNodeList(count, null, null, ' ');
+ pushNode(new Modifiers(modifierNodes));
+ }
}
Token expected(String string, Token token) {
@@ -1494,7 +1498,7 @@ class NodeListener extends ElementListener {
TypeAnnotation returnType = popNode();
pushNode(null); // Signal "no type" to endFormalParameter.
pushNode(new FunctionExpression(name, formals, null, returnType,
- null, null, null));
+ Modifiers.EMPTY, null, null));
}
void handleValuedFormalParameter(Token equals, Token token) {
@@ -1608,7 +1612,7 @@ class NodeListener extends ElementListener {
Statement body = popNode();
NodeList formals = popNode();
pushNode(new FunctionExpression(null, formals, body, null,
- null, null, null));
+ Modifiers.EMPTY, null, null));
}
void handleIsOperator(Token operathor, Token not, Token endToken) {

Powered by Google App Engine
This is Rietveld 408576698