OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 // Partial test that the closed world computed from [WorldImpact]s derived from | 5 // Partial test that the closed world computed from [WorldImpact]s derived from |
6 // kernel is equivalent to the original computed from resolution. | 6 // kernel is equivalent to the original computed from resolution. |
7 library dart2js.kernel.closed_world_from_dill_test; | 7 library dart2js.kernel.closed_world_from_dill_test; |
8 | 8 |
9 import 'dart:async'; | 9 import 'dart:async'; |
10 import 'dart:io'; | 10 import 'dart:io'; |
(...skipping 13 matching lines...) Expand all Loading... |
24 import 'package:expect/expect.dart'; | 24 import 'package:expect/expect.dart'; |
25 import '../memory_compiler.dart'; | 25 import '../memory_compiler.dart'; |
26 import '../equivalence/check_functions.dart'; | 26 import '../equivalence/check_functions.dart'; |
27 import '../serialization/helper.dart'; | 27 import '../serialization/helper.dart'; |
28 import 'test_helpers.dart'; | 28 import 'test_helpers.dart'; |
29 | 29 |
30 import 'compiler_helper.dart'; | 30 import 'compiler_helper.dart'; |
31 | 31 |
32 const SOURCE = const { | 32 const SOURCE = const { |
33 'main.dart': ''' | 33 'main.dart': ''' |
| 34 |
| 35 class ClassWithSetter { |
| 36 void set setter(_) {} |
| 37 } |
| 38 |
| 39 class Mixin { |
| 40 method1() {} |
| 41 method2() {} |
| 42 method3() {} |
| 43 } |
| 44 class Class1 = Object with Mixin; |
| 45 class Class2 extends Object with Mixin { |
| 46 method3() {} |
| 47 } |
| 48 |
34 main() { | 49 main() { |
35 print('Hello World'); | 50 print('Hello World'); |
| 51 ''.contains; // Trigger member closurization. |
| 52 new ClassWithSetter().setter = null; |
| 53 new Class1().method1(); |
| 54 new Class2().method2(); |
| 55 new Class2().method3(); |
36 } | 56 } |
37 ''' | 57 ''' |
38 }; | 58 }; |
39 | 59 |
40 main(List<String> args) { | 60 main(List<String> args) { |
41 asyncTest(() async { | 61 asyncTest(() async { |
42 await mainInternal(args); | 62 await mainInternal(args); |
43 }); | 63 }); |
44 } | 64 } |
45 | 65 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 enqueuer1, enqueuer2, elementEquivalence: equivalence.entityEquivalence, | 133 enqueuer1, enqueuer2, elementEquivalence: equivalence.entityEquivalence, |
114 typeEquivalence: (ResolutionDartType a, DartType b) { | 134 typeEquivalence: (ResolutionDartType a, DartType b) { |
115 return equivalence.typeEquivalence(unalias(a), b); | 135 return equivalence.typeEquivalence(unalias(a), b); |
116 }, elementFilter: elementFilter, verbose: arguments.verbose); | 136 }, elementFilter: elementFilter, verbose: arguments.verbose); |
117 | 137 |
118 checkClosedWorlds(closedWorld1, closedWorld2, | 138 checkClosedWorlds(closedWorld1, closedWorld2, |
119 strategy: equivalence.defaultStrategy, verbose: arguments.verbose); | 139 strategy: equivalence.defaultStrategy, verbose: arguments.verbose); |
120 | 140 |
121 return ResultKind.success; | 141 return ResultKind.success; |
122 } | 142 } |
OLD | NEW |