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

Unified Diff: pkg/typed_mock/lib/typed_mock.dart

Issue 318683003: Make matcher classes constant. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « no previous file | pkg/typed_mock/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/typed_mock/lib/typed_mock.dart
diff --git a/pkg/typed_mock/lib/typed_mock.dart b/pkg/typed_mock/lib/typed_mock.dart
index eb9ae7302983f441a55756386b999bd3918de983..ab962d45cd22bc3c6a3e9c2cf858c462f11e7c17 100644
--- a/pkg/typed_mock/lib/typed_mock.dart
+++ b/pkg/typed_mock/lib/typed_mock.dart
@@ -364,6 +364,8 @@ class TypedMock {
/// [ArgumentMatcher] checks whether the given argument satisfies some
/// condition.
abstract class ArgumentMatcher {
+ const ArgumentMatcher();
+
/// Checks whether this matcher accepts the given argument.
bool matches(val);
}
@@ -372,7 +374,7 @@ abstract class ArgumentMatcher {
class _ArgumentMatcher_equals extends ArgumentMatcher {
final expected;
- _ArgumentMatcher_equals(this.expected);
+ const _ArgumentMatcher_equals(this.expected);
@override
bool matches(val) {
@@ -382,6 +384,8 @@ class _ArgumentMatcher_equals extends ArgumentMatcher {
class _ArgumentMatcher_anyBool extends ArgumentMatcher {
+ const _ArgumentMatcher_anyBool();
+
@override
bool matches(val) {
return val is bool;
@@ -389,10 +393,12 @@ class _ArgumentMatcher_anyBool extends ArgumentMatcher {
}
/// Matches any [bool] value.
-final anyBool = new _ArgumentMatcher_anyBool() as dynamic;
+final anyBool = const _ArgumentMatcher_anyBool() as dynamic;
class _ArgumentMatcher_anyInt extends ArgumentMatcher {
+ const _ArgumentMatcher_anyInt();
+
@override
bool matches(val) {
return val is int;
@@ -400,10 +406,12 @@ class _ArgumentMatcher_anyInt extends ArgumentMatcher {
}
/// Matches any [int] value.
-final anyInt = new _ArgumentMatcher_anyInt() as dynamic;
+final anyInt = const _ArgumentMatcher_anyInt() as dynamic;
class _ArgumentMatcher_anyObject extends ArgumentMatcher {
+ const _ArgumentMatcher_anyObject();
+
@override
bool matches(val) {
return true;
@@ -411,10 +419,12 @@ class _ArgumentMatcher_anyObject extends ArgumentMatcher {
}
/// Matches any [Object] (or subclass) value.
-final anyObject = new _ArgumentMatcher_anyObject() as dynamic;
+final anyObject = const _ArgumentMatcher_anyObject() as dynamic;
class _ArgumentMatcher_anyString extends ArgumentMatcher {
+ const _ArgumentMatcher_anyString();
+
@override
bool matches(val) {
return val is String;
@@ -422,4 +432,4 @@ class _ArgumentMatcher_anyString extends ArgumentMatcher {
}
/// Matches any [String] value.
-final anyString = new _ArgumentMatcher_anyString() as dynamic;
+final anyString = const _ArgumentMatcher_anyString() as dynamic;
« no previous file with comments | « no previous file | pkg/typed_mock/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698