@@ -6,90 +6,36 @@ import 'core_matchers.dart';
6
6
import 'interfaces.dart' ;
7
7
8
8
/// A matcher for ArgumentErrors.
9
- const Matcher isArgumentError = const _ArgumentError ();
10
-
11
- class _ArgumentError extends TypeMatcher {
12
- const _ArgumentError () : super ("ArgumentError" );
13
- bool matches (item, Map matchState) => item is ArgumentError ;
14
- }
9
+ const Matcher isArgumentError = const TypeMatcher <ArgumentError >();
15
10
16
11
/// A matcher for ConcurrentModificationError.
17
12
const Matcher isConcurrentModificationError =
18
- const _ConcurrentModificationError ();
19
-
20
- class _ConcurrentModificationError extends TypeMatcher {
21
- const _ConcurrentModificationError () : super ("ConcurrentModificationError" );
22
- bool matches (item, Map matchState) => item is ConcurrentModificationError ;
23
- }
13
+ const TypeMatcher <ConcurrentModificationError >();
24
14
25
15
/// A matcher for CyclicInitializationError.
26
- const Matcher isCyclicInitializationError = const _CyclicInitializationError ();
27
-
28
- class _CyclicInitializationError extends TypeMatcher {
29
- const _CyclicInitializationError () : super ("CyclicInitializationError" );
30
- bool matches (item, Map matchState) => item is CyclicInitializationError ;
31
- }
16
+ const Matcher isCyclicInitializationError =
17
+ const TypeMatcher <CyclicInitializationError >();
32
18
33
19
/// A matcher for Exceptions.
34
- const Matcher isException = const _Exception ();
35
-
36
- class _Exception extends TypeMatcher {
37
- const _Exception () : super ("Exception" );
38
- bool matches (item, Map matchState) => item is Exception ;
39
- }
20
+ const Matcher isException = const TypeMatcher <Exception >();
40
21
41
22
/// A matcher for FormatExceptions.
42
- const Matcher isFormatException = const _FormatException ();
43
-
44
- class _FormatException extends TypeMatcher {
45
- const _FormatException () : super ("FormatException" );
46
- bool matches (item, Map matchState) => item is FormatException ;
47
- }
23
+ const Matcher isFormatException = const TypeMatcher <FormatException >();
48
24
49
25
/// A matcher for NoSuchMethodErrors.
50
- const Matcher isNoSuchMethodError = const _NoSuchMethodError ();
51
-
52
- class _NoSuchMethodError extends TypeMatcher {
53
- const _NoSuchMethodError () : super ("NoSuchMethodError" );
54
- bool matches (item, Map matchState) => item is NoSuchMethodError ;
55
- }
26
+ const Matcher isNoSuchMethodError = const TypeMatcher <NoSuchMethodError >();
56
27
57
28
/// A matcher for NullThrownError.
58
- const Matcher isNullThrownError = const _NullThrownError ();
59
-
60
- class _NullThrownError extends TypeMatcher {
61
- const _NullThrownError () : super ("NullThrownError" );
62
- bool matches (item, Map matchState) => item is NullThrownError ;
63
- }
29
+ const Matcher isNullThrownError = const TypeMatcher <NullThrownError >();
64
30
65
31
/// A matcher for RangeErrors.
66
- const Matcher isRangeError = const _RangeError ();
67
-
68
- class _RangeError extends TypeMatcher {
69
- const _RangeError () : super ("RangeError" );
70
- bool matches (item, Map matchState) => item is RangeError ;
71
- }
32
+ const Matcher isRangeError = const TypeMatcher <RangeError >();
72
33
73
34
/// A matcher for StateErrors.
74
- const Matcher isStateError = const _StateError ();
75
-
76
- class _StateError extends TypeMatcher {
77
- const _StateError () : super ("StateError" );
78
- bool matches (item, Map matchState) => item is StateError ;
79
- }
35
+ const Matcher isStateError = const TypeMatcher <StateError >();
80
36
81
37
/// A matcher for UnimplementedErrors.
82
- const Matcher isUnimplementedError = const _UnimplementedError ();
83
-
84
- class _UnimplementedError extends TypeMatcher {
85
- const _UnimplementedError () : super ("UnimplementedError" );
86
- bool matches (item, Map matchState) => item is UnimplementedError ;
87
- }
38
+ const Matcher isUnimplementedError = const TypeMatcher <UnimplementedError >();
88
39
89
40
/// A matcher for UnsupportedError.
90
- const Matcher isUnsupportedError = const _UnsupportedError ();
91
-
92
- class _UnsupportedError extends TypeMatcher {
93
- const _UnsupportedError () : super ("UnsupportedError" );
94
- bool matches (item, Map matchState) => item is UnsupportedError ;
95
- }
41
+ const Matcher isUnsupportedError = const TypeMatcher <UnsupportedError >();
0 commit comments