Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(403)

Side by Side Diff: tests/compiler/dart2js/related_types.dart

Issue 1335983004: Add ImportElement and ExportElement (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 related_types; 5 library related_types;
6 6
7 import 'package:compiler/src/commandline_options.dart';
7 import 'package:compiler/src/compiler.dart'; 8 import 'package:compiler/src/compiler.dart';
8 import 'package:compiler/src/core_types.dart'; 9 import 'package:compiler/src/core_types.dart';
9 import 'package:compiler/src/dart_types.dart'; 10 import 'package:compiler/src/dart_types.dart';
10 import 'package:compiler/src/diagnostics/messages.dart'; 11 import 'package:compiler/src/diagnostics/messages.dart';
11 import 'package:compiler/src/elements/elements.dart'; 12 import 'package:compiler/src/elements/elements.dart';
13 import 'package:compiler/src/filenames.dart';
12 import 'package:compiler/src/resolution/semantic_visitor.dart'; 14 import 'package:compiler/src/resolution/semantic_visitor.dart';
13 import 'package:compiler/src/tree/tree.dart'; 15 import 'package:compiler/src/tree/tree.dart';
14 import 'package:compiler/src/universe/universe.dart'; 16 import 'package:compiler/src/universe/universe.dart';
15 import 'package:compiler/src/world.dart'; 17 import 'package:compiler/src/world.dart';
18 import 'memory_compiler.dart';
19
20 main(List<String> arguments) async {
21 if (arguments.isNotEmpty) {
22 Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.last));
23 CompilationResult result = await runCompiler(
24 entryPoint: entryPoint,
25 options: [Flags.analyzeOnly, '--categories=Client,Server']);
26 if (result.isSuccess) {
27 checkRelatedTypes(result.compiler);
28 }
29 } else {
30 print('Usage dart related_types.dart <entry-point>');
31 }
32 }
16 33
17 /// Check all loaded libraries in [compiler] for unrelated types. 34 /// Check all loaded libraries in [compiler] for unrelated types.
18 void checkRelatedTypes(Compiler compiler) { 35 void checkRelatedTypes(Compiler compiler) {
19 for (LibraryElement library in compiler.libraryLoader.libraries) { 36 for (LibraryElement library in compiler.libraryLoader.libraries) {
20 checkLibraryElement(compiler, library); 37 checkLibraryElement(compiler, library);
21 } 38 }
22 } 39 }
23 40
24 /// Check [library] for unrelated types. 41 /// Check [library] for unrelated types.
25 void checkLibraryElement(Compiler compiler, LibraryElement library) { 42 void checkLibraryElement(Compiler compiler, LibraryElement library) {
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 ClassElement findClass(DartType type) => type.accept(this, null); 421 ClassElement findClass(DartType type) => type.accept(this, null);
405 422
406 @override 423 @override
407 ClassElement visitType(DartType type, _) => null; 424 ClassElement visitType(DartType type, _) => null;
408 425
409 @override 426 @override
410 ClassElement visitInterfaceType(InterfaceType type, _) { 427 ClassElement visitInterfaceType(InterfaceType type, _) {
411 return type.element; 428 return type.element;
412 } 429 }
413 } 430 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/reexport_handled_test.dart ('k') | tests/compiler/dart2js/serialization_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698