| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 dart2js.serialization_test_helper; | 5 library dart2js.serialization_test_helper; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'package:compiler/src/common/resolution.dart'; | 8 import 'package:compiler/src/common/resolution.dart'; |
| 9 import 'package:compiler/src/constants/expressions.dart'; | 9 import 'package:compiler/src/constants/expressions.dart'; |
| 10 import 'package:compiler/src/constants/values.dart'; | 10 import 'package:compiler/src/constants/values.dart'; |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 } else { | 280 } else { |
| 281 return check(object1, object2, property, type1, type2, | 281 return check(object1, object2, property, type1, type2, |
| 282 (a, b) => const TypeEquivalence(const CheckStrategy()).visit(a, b)); | 282 (a, b) => const TypeEquivalence(const CheckStrategy()).visit(a, b)); |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 | 285 |
| 286 /// Checks the pair-wise equivalence of the types in [list1] and [list2]. | 286 /// Checks the pair-wise equivalence of the types in [list1] and [list2]. |
| 287 /// | 287 /// |
| 288 /// Uses [object1], [object2] and [property] to provide context for failures. | 288 /// Uses [object1], [object2] and [property] to provide context for failures. |
| 289 bool checkTypeLists(Object object1, Object object2, String property, | 289 bool checkTypeLists(Object object1, Object object2, String property, |
| 290 List<ResolutionDartType> list1, List<ResolutionDartType> list2) { | 290 List<DartType> list1, List<DartType> list2) { |
| 291 return checkListEquivalence( | 291 return checkListEquivalence( |
| 292 object1, object2, property, list1, list2, checkTypes); | 292 object1, object2, property, list1, list2, checkTypes); |
| 293 } | 293 } |
| 294 | 294 |
| 295 /// Checks the equivalence of [exp1] and [exp2]. | 295 /// Checks the equivalence of [exp1] and [exp2]. |
| 296 /// | 296 /// |
| 297 /// Uses [object1], [object2] and [property] to provide context for failures. | 297 /// Uses [object1], [object2] and [property] to provide context for failures. |
| 298 bool checkConstants(Object object1, Object object2, String property, | 298 bool checkConstants(Object object1, Object object2, String property, |
| 299 ConstantExpression exp1, ConstantExpression exp2) { | 299 ConstantExpression exp1, ConstantExpression exp2) { |
| 300 if (identical(exp1, exp2)) return true; | 300 if (identical(exp1, exp2)) return true; |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 strategy.testTypeLists(a, b, 'namedParameterTypes', | 821 strategy.testTypeLists(a, b, 'namedParameterTypes', |
| 822 aType.namedParameterTypes, b.namedParameterTypes); | 822 aType.namedParameterTypes, b.namedParameterTypes); |
| 823 } | 823 } |
| 824 return false; | 824 return false; |
| 825 default: | 825 default: |
| 826 throw new UnsupportedError('Unsupported equivalence: ' | 826 throw new UnsupportedError('Unsupported equivalence: ' |
| 827 '$a (${a.runtimeType}) vs $b (${b.runtimeType})'); | 827 '$a (${a.runtimeType}) vs $b (${b.runtimeType})'); |
| 828 } | 828 } |
| 829 } | 829 } |
| 830 } | 830 } |
| OLD | NEW |