| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 sameElement: sameKey); | 235 sameElement: sameKey); |
| 236 if (unfound.isNotEmpty || remaining.isNotEmpty) { | 236 if (unfound.isNotEmpty || remaining.isNotEmpty) { |
| 237 String message = | 237 String message = |
| 238 "Map key mismatch for `$property` on $object1 vs $object2: \n" | 238 "Map key mismatch for `$property` on $object1 vs $object2: \n" |
| 239 "Common:\n ${common.join('\n ')}\n" | 239 "Common:\n ${common.join('\n ')}\n" |
| 240 "Unfound:\n ${unfound.join('\n ')}\n" | 240 "Unfound:\n ${unfound.join('\n ')}\n" |
| 241 "Extra: \n ${remaining.join('\n ')}"; | 241 "Extra: \n ${remaining.join('\n ')}"; |
| 242 throw message; | 242 throw message; |
| 243 } | 243 } |
| 244 for (List pair in common) { | 244 for (List pair in common) { |
| 245 check(object1, object2, 'Map value for `$property`', map1[pair[0]], | 245 check(pair[0], pair[1], 'Map value for `$property`', map1[pair[0]], |
| 246 map2[pair[1]], sameValue); | 246 map2[pair[1]], sameValue); |
| 247 } | 247 } |
| 248 return true; | 248 return true; |
| 249 } | 249 } |
| 250 | 250 |
| 251 /// Checks the equivalence of the identity (but not properties) of [element1] | 251 /// Checks the equivalence of the identity (but not properties) of [element1] |
| 252 /// and [element2]. | 252 /// and [element2]. |
| 253 /// | 253 /// |
| 254 /// Uses [object1], [object2] and [property] to provide context for failures. | 254 /// Uses [object1], [object2] and [property] to provide context for failures. |
| 255 bool checkElementIdentities(Object object1, Object object2, String property, | 255 bool checkElementIdentities(Object object1, Object object2, String property, |
| (...skipping 565 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 |