OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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_model_test; | 5 library dart2js.serialization_model_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 bool found = false; | 213 bool found = false; |
214 for (ClassHierarchyNode other in node2.directSubclasses) { | 214 for (ClassHierarchyNode other in node2.directSubclasses) { |
215 if (areElementsEquivalent(child.cls, other.cls)) { | 215 if (areElementsEquivalent(child.cls, other.cls)) { |
216 checkClassHierarchyNodes(compiler1, compiler2, | 216 checkClassHierarchyNodes(compiler1, compiler2, |
217 child, other, verbose: verbose); | 217 child, other, verbose: verbose); |
218 found = true; | 218 found = true; |
219 break; | 219 break; |
220 } | 220 } |
221 } | 221 } |
222 if (!found) { | 222 if (!found) { |
| 223 if (child.isInstantiated) { |
| 224 print('Missing subclass ${child.cls} of ${node1.cls} ' |
| 225 'in ${node2.directSubclasses}'); |
| 226 print(compiler1.world.dump( |
| 227 verbose ? compiler1.coreClasses.objectClass : node1.cls)); |
| 228 print(compiler2.world.dump( |
| 229 verbose ? compiler2.coreClasses.objectClass : node2.cls)); |
| 230 } |
223 Expect.isFalse(child.isInstantiated, | 231 Expect.isFalse(child.isInstantiated, |
224 'Missing subclass ${child.cls} of ${node1.cls}'); | 232 'Missing subclass ${child.cls} of ${node1.cls} in ' |
| 233 '${node2.directSubclasses}'); |
225 } | 234 } |
226 } | 235 } |
227 checkMixinUses(compiler1, compiler2, node1.cls, node2.cls, verbose: verbose); | 236 checkMixinUses(compiler1, compiler2, node1.cls, node2.cls, verbose: verbose); |
228 } | 237 } |
229 | 238 |
230 void checkSets( | 239 void checkSets( |
231 Iterable set1, | 240 Iterable set1, |
232 Iterable set2, | 241 Iterable set2, |
233 String messagePrefix, | 242 String messagePrefix, |
234 bool sameElement(a, b), | 243 bool sameElement(a, b), |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 return true; | 399 return true; |
391 } | 400 } |
392 | 401 |
393 String nodeToString(Node node) { | 402 String nodeToString(Node node) { |
394 String text = '$node'; | 403 String text = '$node'; |
395 if (text.length > 40) { | 404 if (text.length > 40) { |
396 return '(${node.runtimeType}) ${text.substring(0, 37)}...'; | 405 return '(${node.runtimeType}) ${text.substring(0, 37)}...'; |
397 } | 406 } |
398 return '(${node.runtimeType}) $text'; | 407 return '(${node.runtimeType}) $text'; |
399 } | 408 } |
OLD | NEW |