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

Unified Diff: lib/compiler/implementation/resolver.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/resolver.dart
diff --git a/lib/compiler/implementation/resolver.dart b/lib/compiler/implementation/resolver.dart
index ef8c2274e9123266caef50952b78fc5b8ae411e7..30a4c24dbff0ce0261d9ac46fbdd92e6ff731392 100644
--- a/lib/compiler/implementation/resolver.dart
+++ b/lib/compiler/implementation/resolver.dart
@@ -24,7 +24,7 @@ class TreeElementMapping implements TreeElements {
operator []=(Node node, Element element) {
assert(invariant(node, () {
- if (node is FunctionExpression && node.modifiers != null) {
+ if (node is FunctionExpression) {
return !node.modifiers.isExternal();
}
return true;
@@ -1242,7 +1242,7 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
name = node.name.asIdentifier().source;
}
FunctionElement enclosing = new FunctionElement.node(
- name, node, ElementKind.FUNCTION, new Modifiers.empty(),
+ name, node, ElementKind.FUNCTION, Modifiers.EMPTY,
scope.element);
setupFunction(node, enclosing);
defineElement(node, enclosing, doAddToScope: node.name !== null);
@@ -2305,7 +2305,7 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
new FunctionExpression(new Identifier(element.position()),
new NodeList.empty(),
new Block(new NodeList.empty()),
- null, null, null, null);
+ null, Modifiers.EMPTY, null, null);
}
isBlackListed(DartType type) {
@@ -2667,8 +2667,7 @@ class ConstructorResolver extends CommonResolverVisitor<Element> {
new SourceString(fullConstructorName),
MessageKind.CANNOT_FIND_CONSTRUCTOR,
[fullConstructorName]);
- } else if (inConstContext &&
- (result.modifiers == null || !result.modifiers.isConst())) {
+ } else if (inConstContext && !result.modifiers.isConst()) {
error(diagnosticNode, MessageKind.CONSTRUCTOR_IS_NOT_CONST);
}
return result;

Powered by Google App Engine
This is Rietveld 408576698