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:io'; | 7 import 'dart:io'; |
8 import 'memory_compiler.dart'; | 8 import 'memory_compiler.dart'; |
9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
10 import 'package:compiler/src/common/resolution.dart'; | 10 import 'package:compiler/src/common/resolution.dart'; |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 Compiler compiler1, | 333 Compiler compiler1, |
334 Compiler compiler2, | 334 Compiler compiler2, |
335 {bool verbose: false}) { | 335 {bool verbose: false}) { |
336 checkLoadedLibraryMembers( | 336 checkLoadedLibraryMembers( |
337 compiler1, | 337 compiler1, |
338 compiler2, | 338 compiler2, |
339 (Element member1) { | 339 (Element member1) { |
340 return compiler1.resolution.hasResolutionImpact(member1); | 340 return compiler1.resolution.hasResolutionImpact(member1); |
341 }, | 341 }, |
342 checkImpacts, | 342 checkImpacts, |
343 verbose: true); | 343 verbose: verbose); |
344 } | 344 } |
345 | 345 |
346 /// Check equivalence of resolution impact for [member1] and [member2]. | 346 /// Check equivalence of resolution impact for [member1] and [member2]. |
347 void checkImpacts(Compiler compiler1, Element member1, | 347 void checkImpacts(Compiler compiler1, Element member1, |
348 Compiler compiler2, Element member2, | 348 Compiler compiler2, Element member2, |
349 {bool verbose: false}) { | 349 {bool verbose: false}) { |
350 ResolutionImpact impact1 = compiler1.resolution.getResolutionImpact(member1); | 350 ResolutionImpact impact1 = compiler1.resolution.getResolutionImpact(member1); |
351 ResolutionImpact impact2 = | 351 ResolutionImpact impact2 = |
352 compiler2.serialization.deserializer.getResolutionImpact(member2); | 352 compiler2.serialization.deserializer.getResolutionImpact(member2); |
353 | 353 |
354 if (impact1 == null || impact2 == null) return; | 354 if (impact1 == null || impact2 == null) return; |
355 | 355 |
356 if (verbose) { | 356 if (verbose) { |
357 print('Checking impacts for $member1 vs $member2'); | 357 print('Checking impacts for $member1 vs $member2'); |
358 } | 358 } |
359 | 359 |
360 testResolutionImpactEquivalence(impact1, impact2, const CheckStrategy()); | 360 testResolutionImpactEquivalence(impact1, impact2, const CheckStrategy()); |
361 } | 361 } |
OLD | NEW |