OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of masks; | 5 part of masks; |
6 | 6 |
7 /** | 7 /** |
8 * A type mask that wraps an other one, and delegate all its | 8 * A type mask that wraps an other one, and delegate all its |
9 * implementation methods to it. | 9 * implementation methods to it. |
10 */ | 10 */ |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 } | 47 } |
48 | 48 |
49 bool containsOnlyBool(ClosedWorld closedWorld) { | 49 bool containsOnlyBool(ClosedWorld closedWorld) { |
50 return forwardTo.containsOnlyBool(closedWorld); | 50 return forwardTo.containsOnlyBool(closedWorld); |
51 } | 51 } |
52 | 52 |
53 bool containsOnlyString(ClosedWorld closedWorld) { | 53 bool containsOnlyString(ClosedWorld closedWorld) { |
54 return forwardTo.containsOnlyString(closedWorld); | 54 return forwardTo.containsOnlyString(closedWorld); |
55 } | 55 } |
56 | 56 |
57 bool containsOnly(ClassElement element) { | 57 bool containsOnly(Entity cls) { |
58 return forwardTo.containsOnly(element); | 58 return forwardTo.containsOnly(cls); |
59 } | 59 } |
60 | 60 |
61 bool satisfies(ClassElement cls, ClosedWorld closedWorld) { | 61 bool satisfies(Entity cls, ClosedWorld closedWorld) { |
62 return forwardTo.satisfies(cls, closedWorld); | 62 return forwardTo.satisfies(cls, closedWorld); |
63 } | 63 } |
64 | 64 |
65 bool contains(ClassElement type, ClosedWorld closedWorld) { | 65 bool contains(Entity cls, ClosedWorld closedWorld) { |
66 return forwardTo.contains(type, closedWorld); | 66 return forwardTo.contains(cls, closedWorld); |
67 } | 67 } |
68 | 68 |
69 bool containsAll(ClosedWorld closedWorld) { | 69 bool containsAll(ClosedWorld closedWorld) { |
70 return forwardTo.containsAll(closedWorld); | 70 return forwardTo.containsAll(closedWorld); |
71 } | 71 } |
72 | 72 |
73 ClassElement singleClass(ClosedWorld closedWorld) { | 73 Entity singleClass(ClosedWorld closedWorld) { |
74 return forwardTo.singleClass(closedWorld); | 74 return forwardTo.singleClass(closedWorld); |
75 } | 75 } |
76 | 76 |
77 TypeMask union(other, ClosedWorld closedWorld) { | 77 TypeMask union(other, ClosedWorld closedWorld) { |
78 if (this == other) { | 78 if (this == other) { |
79 return this; | 79 return this; |
80 } else if (equalsDisregardNull(other)) { | 80 } else if (equalsDisregardNull(other)) { |
81 return other.isNullable ? other : this; | 81 return other.isNullable ? other : this; |
82 } else if (other.isEmptyOrNull) { | 82 } else if (other.isEmptyOrNull) { |
83 return other.isNullable ? this.nullable() : this; | 83 return other.isNullable ? this.nullable() : this; |
(...skipping 29 matching lines...) Expand all Loading... |
113 return forwardTo == other.forwardTo.nonNullable(); | 113 return forwardTo == other.forwardTo.nonNullable(); |
114 } | 114 } |
115 } | 115 } |
116 | 116 |
117 bool operator ==(other) { | 117 bool operator ==(other) { |
118 return equalsDisregardNull(other) && isNullable == other.isNullable; | 118 return equalsDisregardNull(other) && isNullable == other.isNullable; |
119 } | 119 } |
120 | 120 |
121 int get hashCode => throw "Subclass should implement hashCode getter"; | 121 int get hashCode => throw "Subclass should implement hashCode getter"; |
122 } | 122 } |
OLD | NEW |