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_resolved_ast_test; | 5 library dart2js.serialization_resolved_ast_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
10 import 'package:compiler/src/commandline_options.dart'; | 10 import 'package:compiler/src/commandline_options.dart'; |
| 11 import 'package:compiler/src/common.dart'; |
11 import 'package:compiler/src/common/backend_api.dart'; | 12 import 'package:compiler/src/common/backend_api.dart'; |
12 import 'package:compiler/src/common/names.dart'; | 13 import 'package:compiler/src/common/names.dart'; |
13 import 'package:compiler/src/compiler.dart'; | 14 import 'package:compiler/src/compiler.dart'; |
14 import 'package:compiler/src/elements/elements.dart'; | 15 import 'package:compiler/src/elements/elements.dart'; |
15 import 'package:compiler/src/filenames.dart'; | 16 import 'package:compiler/src/filenames.dart'; |
16 import 'package:compiler/src/serialization/equivalence.dart'; | 17 import 'package:compiler/src/serialization/equivalence.dart'; |
17 import '../memory_compiler.dart'; | 18 import '../memory_compiler.dart'; |
18 import 'helper.dart'; | 19 import 'helper.dart'; |
19 import 'test_data.dart'; | 20 import 'test_data.dart'; |
20 import 'test_helper.dart'; | 21 import 'test_helper.dart'; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 }, | 72 }, |
72 checkResolvedAsts, | 73 checkResolvedAsts, |
73 verbose: verbose); | 74 verbose: verbose); |
74 } | 75 } |
75 | 76 |
76 | 77 |
77 /// Check equivalence of [impact1] and [impact2]. | 78 /// Check equivalence of [impact1] and [impact2]. |
78 void checkResolvedAsts(Compiler compiler1, Element member1, | 79 void checkResolvedAsts(Compiler compiler1, Element member1, |
79 Compiler compiler2, Element member2, | 80 Compiler compiler2, Element member2, |
80 {bool verbose: false}) { | 81 {bool verbose: false}) { |
| 82 if (!compiler2.serialization.isDeserialized(member2)) { |
| 83 return; |
| 84 } |
81 ResolvedAst resolvedAst1 = compiler1.resolution.getResolvedAst(member1); | 85 ResolvedAst resolvedAst1 = compiler1.resolution.getResolvedAst(member1); |
82 ResolvedAst resolvedAst2 = | 86 ResolvedAst resolvedAst2 = compiler2.serialization.getResolvedAst(member2); |
83 compiler2.serialization.deserializer.getResolvedAst(member2); | |
84 | 87 |
85 if (resolvedAst1 == null || resolvedAst2 == null) return; | 88 if (resolvedAst1 == null || resolvedAst2 == null) return; |
86 | 89 |
87 if (verbose) { | 90 if (verbose) { |
88 print('Checking resolved asts for $member1 vs $member2'); | 91 print('Checking resolved asts for $member1 vs $member2'); |
89 } | 92 } |
90 | 93 |
91 testResolvedAstEquivalence( | 94 testResolvedAstEquivalence( |
92 resolvedAst1, resolvedAst2, const CheckStrategy()); | 95 resolvedAst1, resolvedAst2, const CheckStrategy()); |
93 } | 96 } |
OLD | NEW |