OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'package:compiler/implementation/apiimpl.dart'; | 6 import 'package:compiler/src/apiimpl.dart'; |
7 import 'package:compiler/implementation/dart2jslib.dart' show NullSink; | 7 import 'package:compiler/src/dart2jslib.dart' show NullSink; |
8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
9 import 'package:compiler/implementation/filenames.dart'; | 9 import 'package:compiler/src/filenames.dart'; |
10 import 'package:compiler/implementation/source_file_provider.dart'; | 10 import 'package:compiler/src/source_file_provider.dart'; |
11 import 'package:compiler/implementation/elements/elements.dart' | 11 import 'package:compiler/src/elements/elements.dart' |
12 show ClassElement; | 12 show ClassElement; |
13 import 'package:compiler/implementation/resolution/class_members.dart' | 13 import 'package:compiler/src/resolution/class_members.dart' |
14 show ClassMemberMixin; | 14 show ClassMemberMixin; |
15 import "package:async_helper/async_helper.dart"; | 15 import "package:async_helper/async_helper.dart"; |
16 | 16 |
17 | 17 |
18 const String DART2JS_SOURCE = | 18 const String DART2JS_SOURCE = |
19 'sdk/lib/_internal/compiler/implementation/dart2js.dart'; | 19 'pkg/compiler/lib/src/dart2js.dart'; |
20 const List<String> DART2JS_OPTIONS = const <String>[ | 20 const List<String> DART2JS_OPTIONS = const <String>[ |
21 '--categories=Client,Server', | 21 '--categories=Client,Server', |
22 '--disable-type-inference' | 22 '--disable-type-inference' |
23 ]; | 23 ]; |
24 | 24 |
25 Iterable<ClassElement> computeLiveClasses(Compiler compiler) { | 25 Iterable<ClassElement> computeLiveClasses(Compiler compiler) { |
26 return new Set<ClassElement>() | 26 return new Set<ClassElement>() |
27 ..addAll(compiler.resolverWorld.instantiatedClasses) | 27 ..addAll(compiler.resolverWorld.instantiatedClasses) |
28 ..addAll(compiler.codegenWorld.instantiatedClasses); | 28 ..addAll(compiler.codegenWorld.instantiatedClasses); |
29 } | 29 } |
30 | 30 |
31 void checkClassInvariants(ClassElement cls) { | 31 void checkClassInvariants(ClassElement cls) { |
(...skipping 17 matching lines...) Expand all Loading... |
49 Expect.isTrue(passed, "Compilation of dart2js failed."); | 49 Expect.isTrue(passed, "Compilation of dart2js failed."); |
50 | 50 |
51 computeLiveClasses(compiler).forEach(checkClassInvariants); | 51 computeLiveClasses(compiler).forEach(checkClassInvariants); |
52 }); | 52 }); |
53 } | 53 } |
54 | 54 |
55 void main () { | 55 void main () { |
56 var uri = currentDirectory.resolve(DART2JS_SOURCE); | 56 var uri = currentDirectory.resolve(DART2JS_SOURCE); |
57 asyncTest(() => checkElementInvariantsAfterCompiling(uri)); | 57 asyncTest(() => checkElementInvariantsAfterCompiling(uri)); |
58 } | 58 } |
OLD | NEW |