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

Unified Diff: pkg/polymer_expressions/lib/expression.dart

Issue 24983003: Use const instead of runtime type for equality of EmptyExpression. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer_expressions/lib/expression.dart
===================================================================
--- pkg/polymer_expressions/lib/expression.dart (revision 27990)
+++ pkg/polymer_expressions/lib/expression.dart (working copy)
@@ -8,7 +8,7 @@
// Helper functions for building expression trees programmatically
-EmptyExpression empty() => new EmptyExpression();
+EmptyExpression empty() => const EmptyExpression();
Literal literal(v) => new Literal(v);
MapLiteral mapLiteral(List<MapLiteralEntry> entries) => new MapLiteral(entries);
MapLiteralEntry mapLiteralEntry(Literal key, Expression value) =>
@@ -24,7 +24,7 @@
class AstFactory {
- EmptyExpression empty() => new EmptyExpression();
+ EmptyExpression empty() => const EmptyExpression();
Literal literal(v) => new Literal(v);
@@ -52,12 +52,13 @@
/// Base class for all expressions
abstract class Expression {
+ const Expression();
accept(Visitor v);
}
class EmptyExpression extends Expression {
+ const EmptyExpression();
accept(Visitor v) => v.visitEmptyExpression(this);
- bool operator ==(o) => o is EmptyExpression;
}
class Literal<T> extends Expression {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698