| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 203 |
| 204 void forEach(void f(TypeInformation type)) { | 204 void forEach(void f(TypeInformation type)) { |
| 205 positional.forEach(f); | 205 positional.forEach(f); |
| 206 named.values.forEach(f); | 206 named.values.forEach(f); |
| 207 } | 207 } |
| 208 | 208 |
| 209 bool every(bool f(TypeInformation type)) { | 209 bool every(bool f(TypeInformation type)) { |
| 210 return positional.every(f) && named.values.every(f); | 210 return positional.every(f) && named.values.every(f); |
| 211 } | 211 } |
| 212 | 212 |
| 213 bool contains(TypeInformation type) { | 213 bool contains(Object type) { |
| 214 return positional.contains(type) || named.containsValue(type); | 214 return positional.contains(type) || named.containsValue(type); |
| 215 } | 215 } |
| 216 } | 216 } |
| 217 | 217 |
| 218 class ArgumentsTypesIterator implements Iterator<TypeInformation> { | 218 class ArgumentsTypesIterator implements Iterator<TypeInformation> { |
| 219 final Iterator<TypeInformation> positional; | 219 final Iterator<TypeInformation> positional; |
| 220 final Iterator<TypeInformation> named; | 220 final Iterator<TypeInformation> named; |
| 221 bool _iteratePositional = true; | 221 bool _iteratePositional = true; |
| 222 | 222 |
| 223 ArgumentsTypesIterator(ArgumentsTypes iteratee) | 223 ArgumentsTypesIterator(ArgumentsTypes iteratee) |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 if (newType != type) { | 544 if (newType != type) { |
| 545 locals[variable] = newType; | 545 locals[variable] = newType; |
| 546 } | 546 } |
| 547 }); | 547 }); |
| 548 } | 548 } |
| 549 | 549 |
| 550 void updateField(Element element, TypeInformation type) { | 550 void updateField(Element element, TypeInformation type) { |
| 551 fieldScope.updateField(element, type); | 551 fieldScope.updateField(element, type); |
| 552 } | 552 } |
| 553 } | 553 } |
| OLD | NEW |