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 library locals_handler; | 5 library locals_handler; |
6 | 6 |
7 import 'dart:collection' show IterableMixin; | 7 import 'dart:collection' show IterableMixin; |
8 | 8 |
9 import '../options.dart' show CompilerOptions; | 9 import '../options.dart' show CompilerOptions; |
10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 | 184 |
185 String toString() => "{ positional = $positional, named = $named }"; | 185 String toString() => "{ positional = $positional, named = $named }"; |
186 | 186 |
187 bool operator ==(other) { | 187 bool operator ==(other) { |
188 if (positional.length != other.positional.length) return false; | 188 if (positional.length != other.positional.length) return false; |
189 if (named.length != other.named.length) return false; | 189 if (named.length != other.named.length) return false; |
190 for (int i = 0; i < positional.length; i++) { | 190 for (int i = 0; i < positional.length; i++) { |
191 if (positional[i] != other.positional[i]) return false; | 191 if (positional[i] != other.positional[i]) return false; |
192 } | 192 } |
193 named.forEach((name, type) { | 193 named.forEach((name, type) { |
194 // TODO(ahe): This is a bug. | |
ahe
2017/06/15 09:36:39
I'll file an issue about this and update the comme
ahe
2017/06/15 11:41:57
Done.
| |
195 // ignore: RETURN_OF_INVALID_TYPE | |
194 if (other.named[name] != type) return false; | 196 if (other.named[name] != type) return false; |
195 }); | 197 }); |
196 return true; | 198 return true; |
197 } | 199 } |
198 | 200 |
199 int get hashCode => throw new UnsupportedError('ArgumentsTypes.hashCode'); | 201 int get hashCode => throw new UnsupportedError('ArgumentsTypes.hashCode'); |
200 | 202 |
201 bool hasNoArguments() => positional.isEmpty && named.isEmpty; | 203 bool hasNoArguments() => positional.isEmpty && named.isEmpty; |
202 | 204 |
203 void forEach(void f(TypeInformation type)) { | 205 void forEach(void f(TypeInformation type)) { |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
543 if (newType != type) { | 545 if (newType != type) { |
544 locals[variable] = newType; | 546 locals[variable] = newType; |
545 } | 547 } |
546 }); | 548 }); |
547 } | 549 } |
548 | 550 |
549 void updateField(Element element, TypeInformation type) { | 551 void updateField(Element element, TypeInformation type) { |
550 fieldScope.updateField(element, type); | 552 fieldScope.updateField(element, type); |
551 } | 553 } |
552 } | 554 } |
OLD | NEW |